Function at 0x10002c40
Capabilities:
Read file on windows

Disassembly:
sub esp, 0x20
push ebx
push ebp
push esi
mov esi, ecx
mov ebx, dword [esi + 8]
mov eax, dword [esi + 0x20]
push edi
mov edi, dword [esp + 0x38]
imul ebx, edi
add ebx, dword [esi + 0xc]
cmp eax, 1
mov dword [esp + 0x10], 0
mov dword [esp + 0x20], ebx
jne 0x10002e51
mov eax, dword [esi + 0x1c]
sub eax, 1
je 0x10002dc5
sub eax, 1
je 0x10002d8d
sub eax, 1
jne 0x10002f90
mov eax, dword [esi + 0x18]
push 0x400
xor ebx, ebx
push ebx
push eax
call fcn.10004530
mov edx, dword [esi + 0x18]
mov eax, dword [esi + 0x24]
mov ebp, dword [sym.imp.KERNEL32.dll_ReadFile]
add esp, 0xc
push ebx
lea ecx, [esp + 0x14]
push ecx
push 0x400
push edx
push eax
call ebp
test eax, eax
je 0x10002d3a
mov edi, dword [esp + 0x34]
mov ecx, 0x400
sub ecx, edi
mov dword [esp + 0x18], ecx
jmp 0x10002cd4
mov ecx, dword [esp + 0x18]
mov eax, dword [esp + 0x10]
lea edx, [ebx + eax]
test edx, edx
je 0x10002db6
cmp eax, 0x400
jne 0x10002d49
add ecx, edi
cmp ecx, dword [esp + 0x38]
ja 0x10002e01
push eax
mov eax, dword [esi + 0x18]
push eax
push edi
call fcn.100045c0
mov ecx, dword [esi + 0x18]
push 0x400
push 0
push ecx
add ebx, 0x400
add edi, 0x400
call fcn.10004530
mov eax, dword [esi + 0x18]
mov ecx, dword [esi + 0x24]
add esp, 0x18
push 0
lea edx, [esp + 0x14]
push edx
push 0x400
push eax
push ecx
call ebp
test eax, eax
jne 0x10002cd0
pop edi
pop esi
pop ebp
mov eax, 0x20000106
pop ebx
add esp, 0x20
ret 0xc
mov edx, dword [esp + 0x38]
cmp edx, eax
jb 0x10002e01
test eax, eax
je 0x10002d7e
lea ecx, [ebx + eax]
cmp ecx, edx
ja 0x10002e01
mov edx, dword [esp + 0x3c]
push eax
mov dword [edx], ecx
mov eax, dword [esi + 0x18]
mov ecx, dword [esp + 0x38]
push eax
add ebx, ecx
push ebx
call fcn.100045c0
add esp, 0xc
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
add esp, 0x20
ret 0xc
mov eax, dword [esp + 0x34]
mov ecx, dword [esi + 0x24]
push 0
lea edx, [esp + 0x14]
push edx
push edi
push eax
push ecx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x10002d3a
mov eax, dword [esp + 0x10]
cmp edi, eax
mov edx, dword [esp + 0x3c]
mov dword [edx], eax
je 0x10002d7e
pop edi
pop esi
pop ebp
mov eax, 0x20000107
pop ebx
add esp, 0x20
ret 0xc
mov ebx, dword [esp + 0x34]
mov ecx, dword [esi + 0x24]
mov ebp, dword [sym.imp.KERNEL32.dll_ReadFile]
push 0
lea eax, [esp + 0x14]
push eax
push 6
push ebx
push ecx
call ebp
test eax, eax
je 0x10002d3a
cmp dword [esp + 0x10], 6
jne 0x10002db6
movzx edi, byte [ebx + 2]
movzx edx, byte [ebx + 3]
shl edi, 8
add edi, edx
cmp edi, dword [esp + 0x38]
jbe 0x10002e10
pop edi
pop esi
pop ebp
mov eax, 0x20000108
pop ebx
add esp, 0x20
ret 0xc
mov edx, dword [esi + 0x24]
push 0
lea eax, [esp + 0x14]
push eax
lea ecx, [edi - 6]
push ecx
add ebx, 6
push ebx
push edx
call ebp
test eax, eax
je 0x10002d3a
mov eax, dword [esp + 0x10]
add eax, 6
cmp edi, eax
jne 0x10002db6
mov ecx, dword [esp + 0x3c]
mov dword [ecx], edi
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
add esp, 0x20
ret 0xc
cmp eax, 2
jne 0x10002fba
mov edx, dword [esi + 0x18]
xor ebp, ebp
push 0x400
push ebp
push edx
mov dword [esp + 0x28], ebp
call fcn.10004530
mov ecx, dword [esi + 0x18]
mov edx, dword [esi + 0x24]
add esp, 0xc
push ebp
lea eax, [esp + 0x14]
push eax
push 0x400
push ecx
push edx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x10002f31
mov ebx, dword [esp + 0x34]
mov eax, 0x400
sub eax, ebx
mov dword [esp + 0x18], eax
mov edi, dword [esp + 0x10]
lea eax, [edi + ebp]
test eax, eax
jne 0x10002ecd
mov ecx, dword [esp + 0x1c]
mov eax, dword [esi + 4]
add ecx, eax
cmp ecx, dword [esp + 0x20]
mov dword [esp + 0x1c], ecx
jae 0x10002db6
push eax
call dword [sym.imp.KERNEL32.dll_Sleep]
jmp 0x10002efc
cmp edi, 0x400
jne 0x10002f40
mov ecx, dword [esp + 0x18]
lea edx, [ebx + ecx]
cmp edx, dword [esp + 0x38]
ja 0x10002e01
mov eax, dword [esi + 0x18]
push edi
push eax
push ebx
call fcn.100045c0
add esp, 0xc
add ebp, 0x400
add ebx, edi
mov ecx, dword [esi + 0x18]
push 0x400
push 0
push ecx
call fcn.10004530
mov eax, dword [esi + 0x18]
mov ecx, dword [esi + 0x24]
add esp, 0xc
push 0
lea edx, [esp + 0x14]
push edx
push 0x400
push eax
push ecx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x10002ea2
pop edi
pop esi
pop ebp
mov eax, 0x20000106
pop ebx
add esp, 0x20
ret 0xc
mov ecx, dword [esp + 0x38]
cmp ecx, edi
jb 0x10002e01
test edi, edi
je 0x10002f76
lea eax, [edi + ebp]
cmp eax, ecx
ja 0x10002e01
mov edx, dword [esp + 0x3c]
mov ecx, dword [esp + 0x34]
mov dword [edx], eax
mov eax, dword [esi + 0x18]
push edi
push eax
lea edx, [ecx + ebp]
push edx
call fcn.100045c0
add esp, 0xc
mov esi, dword [esi + 0x1c]
sub esi, 1
je 0x10002d7e
sub esi, 1
je 0x10002f9f
sub esi, 1
je 0x10002d7e
pop edi
pop esi
pop ebp
mov eax, 0x2000010a
pop ebx
add esp, 0x20
ret 0xc
add ebp, edi
cmp dword [esp + 0x38], ebp
je 0x10002d7e
pop edi
pop esi
pop ebp
mov eax, 0x20000109
pop ebx
add esp, 0x20
ret 0xc
cmp eax, 3
jne 0x10002d7e
mov eax, dword [esi + 0x1c]
sub eax, 1
je 0x10003151
sub eax, 1
je 0x1000309c
sub eax, 1
jne 0x10002f90
mov edx, dword [esi + 0x24]
lea eax, [esp + 0x24]
push eax
lea ecx, [esp + 0x18]
push ecx
push edx
xor edi, edi
xor ebp, ebp
call dword [sym.imp.KERNEL32.dll_ClearCommError]
test eax, eax
je 0x1000304b
lea esp, [esp]
cmp dword [esp + 0x14], 0
jne 0x10003102
mov eax, dword [esp + 0x28]
cmp eax, ebp
jbe 0x1000305a
cmp eax, dword [esp + 0x38]
mov ebp, eax
ja 0x10002e01
mov eax, dword [esi + 4]
add edi, eax
cmp edi, ebx
jae 0x10002db6
push eax
call dword [sym.imp.KERNEL32.dll_Sleep]
mov edx, dword [esi + 0x24]
lea eax, [esp + 0x24]
push eax
lea ecx, [esp + 0x18]
push ecx
push edx
call dword [sym.imp.KERNEL32.dll_ClearCommError]
test eax, eax
jne 0x10003000
pop edi
pop esi
pop ebp
mov eax, 0x2000010b
pop ebx
add esp, 0x20
ret 0xc
mov edx, dword [esp + 0x34]
push 0
lea ecx, [esp + 0x14]
push ecx
push eax
mov edi, eax
mov eax, dword [esi + 0x24]
push edx
push eax
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x10002d3a
mov eax, dword [esp + 0x10]
cmp edi, eax
jne 0x10002d3a
mov ecx, dword [esp + 0x3c]
pop edi
pop esi
pop ebp
mov dword [ecx], eax
mov eax, 1
pop ebx
add esp, 0x20
ret 0xc
mov ecx, dword [esi + 0x24]
lea edx, [esp + 0x24]
push edx
lea eax, [esp + 0x18]
push eax
push ecx
xor edi, edi
call dword [sym.imp.KERNEL32.dll_ClearCommError]
test eax, eax
je 0x100030f3
cmp dword [esp + 0x14], 0
jne 0x10003102
mov ebp, dword [esp + 0x38]
cmp dword [esp + 0x28], ebp
je 0x10003111
mov eax, dword [esi + 4]
add edi, eax
cmp edi, ebx
jae 0x10002db6
push eax
call dword [sym.imp.KERNEL32.dll_Sleep]
mov ecx, dword [esi + 0x24]
lea edx, [esp + 0x24]
push edx
lea eax, [esp + 0x18]
push eax
push ecx
call dword [sym.imp.KERNEL32.dll_ClearCommError]
test eax, eax
jne 0x100030b6
pop edi
pop esi
pop ebp
mov eax, 0x2000010b
pop ebx
add esp, 0x20
ret 0xc
pop edi
pop esi
pop ebp
mov eax, 0x2000010c
pop ebx
add esp, 0x20
ret 0xc
mov eax, dword [esp + 0x34]
mov ecx, dword [esi + 0x24]
push 0
lea edx, [esp + 0x14]
push edx
push ebp
push eax
push ecx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x10002d3a
mov eax, dword [esp + 0x10]
cmp ebp, eax
jne 0x10002d3a
mov edx, dword [esp + 0x3c]
pop edi
pop esi
pop ebp
mov dword [edx], eax
mov eax, 1
pop ebx
add esp, 0x20
ret 0xc
pop edi
pop esi
pop ebp
mov eax, 0x2000010d
pop ebx
add esp, 0x20
ret 0xc