Function at 0x10003160
Capabilities:
Read file on windows

Disassembly:
sub esp, 0x20
push ebx
push ebp
push esi
mov esi, ecx
mov eax, dword [esi + 8]
imul eax, dword [esp + 0x34]
add eax, dword [esi + 0xc]
push edi
mov dword [esp + 0x18], eax
mov eax, dword [esi + 0x20]
xor edi, edi
cmp eax, 1
mov dword [esp + 0x10], edi
je 0x1000333c
cmp eax, 2
je 0x1000333c
cmp eax, 3
jne 0x100034a5
mov eax, dword [esi + 0x1c]
sub eax, 1
je 0x1000332d
sub eax, 1
je 0x1000327a
sub eax, 1
jne 0x1000348b
mov edx, dword [esi + 0x24]
mov ebp, dword [sym.imp.KERNEL32.dll_ClearCommError]
lea eax, [esp + 0x24]
push eax
lea ecx, [esp + 0x18]
push ecx
push edx
xor ebx, ebx
call ebp
test eax, eax
je 0x10003229
jmp 0x100031e0
cmp dword [esp + 0x14], 0
jne 0x100032de
mov eax, dword [esp + 0x28]
cmp eax, ebx
jbe 0x10003238
cmp eax, dword [esp + 0x38]
mov ebx, eax
ja 0x10003438
mov eax, dword [esi + 4]
add edi, eax
cmp edi, dword [esp + 0x18]
jae 0x10003429
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 ebp
test eax, eax
jne 0x100031e0
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 0x1000341a
mov eax, dword [esp + 0x10]
cmp edi, eax
mov ecx, dword [esp + 0x3c]
mov dword [ecx], eax
je 0x100034a5
pop edi
pop esi
pop ebp
mov eax, 0x20000106
pop ebx
add esp, 0x20
ret 0xc
mov ecx, dword [esi + 0x24]
mov ebp, dword [sym.imp.KERNEL32.dll_ClearCommError]
lea edx, [esp + 0x24]
push edx
lea eax, [esp + 0x18]
push eax
push ecx
call ebp
test eax, eax
je 0x100032cf
cmp dword [esp + 0x14], 0
jne 0x100032de
mov ebx, dword [esp + 0x38]
cmp dword [esp + 0x28], ebx
je 0x100032ed
mov eax, dword [esi + 4]
add edi, eax
cmp edi, dword [esp + 0x18]
jae 0x10003429
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 ebp
test eax, eax
jne 0x10003294
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 ebx
push eax
push ecx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x1000341a
mov eax, dword [esp + 0x10]
cmp ebx, eax
mov edx, dword [esp + 0x3c]
mov dword [edx], eax
je 0x100034a5
pop edi
pop esi
pop ebp
mov eax, 0x20000106
pop ebx
add esp, 0x20
ret 0xc
pop edi
pop esi
pop ebp
mov eax, 0x2000010d
pop ebx
add esp, 0x20
ret 0xc
mov eax, dword [esi + 0x18]
push 0x400
push edi
push eax
xor ebp, ebp
mov dword [esp + 0x28], edi
call fcn.10004530
mov edx, dword [esi + 0x18]
mov eax, dword [esi + 0x24]
add esp, 0xc
push edi
lea ecx, [esp + 0x14]
push ecx
push 0x400
push edx
push eax
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x1000341a
mov ebx, dword [esp + 0x34]
mov eax, 0x400
sub eax, ebx
mov dword [esp + 0x20], eax
jmp 0x10003394
mov eax, dword [esp + 0x20]
mov edi, dword [esp + 0x10]
lea ecx, [edi + ebp]
test ecx, ecx
jne 0x100033bb
mov ecx, dword [esp + 0x1c]
mov eax, dword [esi + 4]
add ecx, eax
cmp ecx, dword [esp + 0x18]
mov dword [esp + 0x1c], ecx
jae 0x10003429
push eax
call dword [sym.imp.KERNEL32.dll_Sleep]
jmp 0x100033e5
cmp edi, 0x400
jne 0x10003447
add eax, ebx
cmp eax, dword [esp + 0x38]
ja 0x10003438
mov edx, dword [esi + 0x18]
push edi
push edx
push ebx
call fcn.100045c0
add esp, 0xc
add ebp, 0x400
add ebx, edi
mov eax, dword [esi + 0x18]
push 0x400
push 0
push eax
call fcn.10004530
mov edx, dword [esi + 0x18]
mov eax, dword [esi + 0x24]
add esp, 0xc
push 0
lea ecx, [esp + 0x14]
push ecx
push 0x400
push edx
push eax
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x10003390
pop edi
pop esi
pop ebp
mov eax, 0x20000106
pop ebx
add esp, 0x20
ret 0xc
pop edi
pop esi
pop ebp
mov eax, 0x20000107
pop ebx
add esp, 0x20
ret 0xc
pop edi
pop esi
pop ebp
mov eax, 0x20000108
pop ebx
add esp, 0x20
ret 0xc
mov eax, dword [esp + 0x38]
cmp eax, edi
jb 0x10003438
test edi, edi
je 0x10003479
lea ebx, [edi + ebp]
cmp ebx, eax
ja 0x10003438
mov ecx, dword [esi + 0x18]
mov edx, dword [esp + 0x34]
push edi
push ecx
lea eax, [edx + ebp]
push eax
call fcn.100045c0
mov ecx, dword [esp + 0x48]
mov eax, dword [esp + 0x44]
add esp, 0xc
mov dword [ecx], ebx
mov esi, dword [esi + 0x1c]
sub esi, 1
je 0x100034a5
sub esi, 1
je 0x1000349a
sub esi, 1
je 0x100034a5
pop edi
pop esi
pop ebp
mov eax, 0x2000010a
pop ebx
add esp, 0x20
ret 0xc
add ebp, edi
cmp eax, ebp
mov eax, 0x20000109
jne 0x100034aa
mov eax, 1
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x20
ret 0xc