Function at 0x10002c80
Capabilities:
Read file on windows

Disassembly:
sub esp, 0x18
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 + 0x30]
imul ebx, edi
add ebx, dword [esi + 0xc]
xor ebp, ebp
cmp eax, 1
mov dword [esp + 0x10], ebp
mov dword [esp + 0x14], ebx
jne 0x10002e6e
mov eax, dword [esi + 0x1c]
sub eax, 1
je 0x10002de3
sub eax, 1
je 0x10002dac
sub eax, 1
jne 0x10002f92
mov eax, dword [esi + 0x18]
push 0x400
push ebp
push eax
xor ebx, ebx
call fcn.100044b0
mov edx, dword [esi + 0x18]
mov eax, dword [esi + 0x24]
add esp, 0xc
push ebp
mov ebp, dword [sym.imp.KERNEL32.dll_ReadFile]
lea ecx, [esp + 0x14]
push ecx
push 0x400
push edx
push eax
call ebp
test eax, eax
je 0x10002d7a
mov edi, dword [esp + 0x2c]
mov ecx, 0x400
sub ecx, edi
mov dword [esp + 0x2c], ecx
jmp 0x10002d14
mov ecx, dword [esp + 0x2c]
mov eax, dword [esp + 0x10]
lea edx, [ebx + eax]
test edx, edx
je 0x10002dd4
cmp eax, 0x400
jne 0x10002d89
add ecx, edi
cmp ecx, dword [esp + 0x30]
ja 0x10002e1e
push eax
mov eax, dword [esi + 0x18]
push eax
push edi
call fcn.10004540
mov ecx, dword [esi + 0x18]
push 0x400
push 0
push ecx
add ebx, 0x400
add edi, 0x400
call fcn.100044b0
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 0x10002d10
pop edi
pop esi
pop ebp
mov eax, 0x20000106
pop ebx
add esp, 0x18
ret 0xc
cmp dword [esp + 0x30], eax
jb 0x10002e1e
test eax, eax
jne 0x10002d9d
mov edx, dword [esp + 0x34]
mov dword [edx], ebx
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
add esp, 0x18
ret 0xc
mov ecx, dword [esp + 0x2c]
mov edx, dword [esi + 0x24]
push ebp
lea eax, [esp + 0x14]
push eax
push edi
push ecx
push edx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x10002d7a
mov eax, dword [esp + 0x10]
cmp edi, eax
mov ecx, dword [esp + 0x34]
mov dword [ecx], eax
je 0x10002d9d
pop edi
pop esi
pop ebp
mov eax, 0x20000107
pop ebx
add esp, 0x18
ret 0xc
mov ebx, dword [esp + 0x2c]
mov eax, dword [esi + 0x24]
push ebp
mov ebp, dword [sym.imp.KERNEL32.dll_ReadFile]
lea edx, [esp + 0x14]
push edx
push 6
push ebx
push eax
call ebp
test eax, eax
je 0x10002d7a
cmp dword [esp + 0x10], 6
jne 0x10002dd4
movzx edi, byte [ebx + 2]
movzx ecx, byte [ebx + 3]
shl edi, 8
add edi, ecx
cmp edi, dword [esp + 0x30]
jbe 0x10002e2d
pop edi
pop esi
pop ebp
mov eax, 0x20000108
pop ebx
add esp, 0x18
ret 0xc
mov ecx, dword [esi + 0x24]
push 0
lea edx, [esp + 0x14]
push edx
lea eax, [edi - 6]
push eax
add ebx, 6
push ebx
push ecx
call ebp
test eax, eax
je 0x10002d7a
mov edx, dword [esp + 0x10]
add edx, 6
cmp edi, edx
jne 0x10002dd4
mov eax, dword [esp + 0x34]
mov dword [eax], edi
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
add esp, 0x18
ret 0xc
cmp eax, 2
jne 0x10002fbe
mov ecx, dword [esi + 0x18]
push 0x400
push ebp
push ecx
mov dword [esp + 0x20], ebp
call fcn.100044b0
mov eax, dword [esi + 0x18]
mov ecx, dword [esi + 0x24]
add esp, 0xc
push ebp
lea edx, [esp + 0x14]
push edx
push 0x400
push eax
push ecx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x10002f4f
mov edi, dword [esp + 0x2c]
mov ecx, 0x400
sub ecx, edi
mov dword [esp + 0x2c], ecx
jmp 0x10002ec4
mov ecx, dword [esp + 0x2c]
mov eax, dword [esp + 0x10]
mov edx, dword [esp + 0x14]
add edx, eax
jne 0x10002ee6
mov eax, dword [esi + 4]
add ebp, eax
cmp ebp, ebx
jae 0x10002dd4
push eax
call dword [sym.imp.KERNEL32.dll_Sleep]
jmp 0x10002f1a
cmp eax, 0x400
jne 0x10002f5e
lea eax, [edi + ecx]
cmp eax, dword [esp + 0x30]
ja 0x10002e1e
mov ecx, dword [esi + 0x18]
push 0x400
push ecx
push edi
call fcn.10004540
add dword [esp + 0x20], 0x400
add esp, 0xc
add edi, 0x400
mov edx, dword [esi + 0x18]
push 0x400
push 0
push edx
call fcn.100044b0
mov ecx, dword [esi + 0x18]
mov edx, dword [esi + 0x24]
add esp, 0xc
push 0
lea eax, [esp + 0x14]
push eax
push 0x400
push ecx
push edx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x10002ec0
pop edi
pop esi
pop ebp
mov eax, 0x20000106
pop ebx
add esp, 0x18
ret 0xc
mov ecx, dword [esp + 0x30]
cmp ecx, eax
jb 0x10002e1e
test eax, eax
jne 0x10002f78
mov edx, dword [esp + 0x34]
mov edi, dword [esp + 0x14]
mov dword [edx], edi
mov esi, dword [esi + 0x1c]
sub esi, 1
je 0x10002d9d
sub esi, 1
je 0x10002fa1
sub esi, 1
je 0x10002d9d
pop edi
pop esi
pop ebp
mov eax, 0x2000010a
pop ebx
add esp, 0x18
ret 0xc
mov edx, dword [esp + 0x14]
add edx, eax
cmp ecx, edx
je 0x10002d9d
pop edi
pop esi
pop ebp
mov eax, 0x20000109
pop ebx
add esp, 0x18
ret 0xc
cmp eax, 3
jne 0x10002d9d
mov eax, dword [esi + 0x1c]
sub eax, 1
je 0x10003151
sub eax, 1
je 0x1000309c
sub eax, 1
jne 0x10002f92
mov edx, dword [esi + 0x24]
lea eax, [esp + 0x1c]
push eax
lea ecx, [esp + 0x1c]
push ecx
push edx
xor edi, edi
xor ebp, ebp
call dword [sym.imp.KERNEL32.dll_ClearCommError]
test eax, eax
je 0x1000304b
lea ecx, [ecx]
cmp dword [esp + 0x18], 0
jne 0x10003102
mov eax, dword [esp + 0x20]
cmp eax, ebp
jbe 0x1000305a
cmp eax, dword [esp + 0x30]
mov ebp, eax
ja 0x10002e1e
mov eax, dword [esi + 4]
add edi, eax
cmp edi, ebx
jae 0x10002dd4
push eax
call dword [sym.imp.KERNEL32.dll_Sleep]
mov edx, dword [esi + 0x24]
lea eax, [esp + 0x1c]
push eax
lea ecx, [esp + 0x1c]
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, 0x18
ret 0xc
mov edx, dword [esp + 0x2c]
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 0x10002d7a
mov eax, dword [esp + 0x10]
cmp edi, eax
jne 0x10002d7a
mov ecx, dword [esp + 0x34]
pop edi
pop esi
pop ebp
mov dword [ecx], eax
mov eax, 1
pop ebx
add esp, 0x18
ret 0xc
mov ecx, dword [esi + 0x24]
mov ebp, dword [sym.imp.KERNEL32.dll_ClearCommError]
lea edx, [esp + 0x1c]
push edx
lea eax, [esp + 0x1c]
push eax
push ecx
xor edi, edi
call ebp
test eax, eax
je 0x100030f3
cmp dword [esp + 0x18], 0
jne 0x10003102
mov ebx, dword [esp + 0x30]
cmp dword [esp + 0x20], ebx
je 0x10003111
mov eax, dword [esi + 4]
add edi, eax
cmp edi, dword [esp + 0x14]
jae 0x10002dd4
push eax
call dword [sym.imp.KERNEL32.dll_Sleep]
mov ecx, dword [esi + 0x24]
lea edx, [esp + 0x1c]
push edx
lea eax, [esp + 0x1c]
push eax
push ecx
call ebp
test eax, eax
jne 0x100030b8
pop edi
pop esi
pop ebp
mov eax, 0x2000010b
pop ebx
add esp, 0x18
ret 0xc
pop edi
pop esi
pop ebp
mov eax, 0x2000010c
pop ebx
add esp, 0x18
ret 0xc
mov eax, dword [esp + 0x2c]
mov ecx, dword [esi + 0x24]
push 0
lea edx, [esp + 0x14]
push edx
push ebx
push eax
push ecx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x10002d7a
mov eax, dword [esp + 0x10]
cmp ebx, eax
jne 0x10002d7a
mov edx, dword [esp + 0x34]
pop edi
pop esi
pop ebp
mov dword [edx], eax
mov eax, 1
pop ebx
add esp, 0x18
ret 0xc
pop edi
pop esi
pop ebp
mov eax, 0x2000010d
pop ebx
add esp, 0x18
ret 0xc