Function at 0x4512a0
Capabilities:
Read file on windows
Resolve function by parsing pe exports

Disassembly:
sub esp, 0x38
mov eax, dword [esp + 0x64]
test eax, eax
mov dword [esp], 0x200
je 0x4512b5
mov dword [esp], eax
mov eax, dword [esp + 0x68]
mov edx, dword [esp + 0x44]
mov ecx, dword [esp + 0x60]
push ebx
push ebp
mov ebp, dword [esp + 0x5c]
push esi
mov esi, dword [esp + 0x4c]
test eax, eax
mov eax, dword [esp + 0x68]
push edi
mov edi, edx
mov ebx, eax
je 0x451306
or ebx, ecx
mov ebx, dword [esp + 0x68]
je 0x4512e9
mov esi, ebp
add esi, eax
mov edi, ebx
adc edi, ecx
mov eax, dword [esp + 0x10]
cmp eax, 1
jle 0x451363
cdq
push edx
push eax
push ebx
push ebp
mov dword [esp + 0x74], eax
mov dword [esp + 0x78], edx
call fcn.004b1940
jmp 0x451336
or ebx, ecx
mov ebx, dword [esp + 0x68]
je 0x451316
mov esi, ebp
add esi, eax
mov edi, ebx
adc edi, ecx
mov eax, dword [esp + 0x10]
cmp eax, 1
jle 0x451363
cdq
push edx
push eax
push ebx
push ebp
mov dword [esp + 0x74], eax
mov dword [esp + 0x78], edx
call fcn.004b1940
mov dword [esp + 0x78], eax
cdq
mov ecx, dword [esp + 0x64]
sub ebp, eax
mov eax, dword [esp + 0x78]
sbb ebx, edx
cdq
add ebp, eax
mov eax, dword [esp + 0x68]
push eax
push ecx
adc ebx, edx
push ebx
push ebp
call fcn.004b1940
mov dword [esp + 0x78], eax
cdq
sub ebp, eax
sbb ebx, edx
mov edx, dword [esp + 0x54]
jmp 0x45136b
mov dword [esp + 0x78], 0
cmp edi, edx
jl 0x45137d
jg 0x451377
cmp esi, dword [esp + 0x50]
jbe 0x45137d
mov esi, dword [esp + 0x50]
mov edi, edx
mov eax, ebp
and eax, 0xfffffe00
mov dword [esp + 0x28], eax
mov eax, esi
add eax, 0x1ff
mov ecx, edi
adc ecx, 0
and eax, 0xfffffe00
cmp ecx, edx
jl 0x4513af
jg 0x4513a9
cmp eax, dword [esp + 0x50]
jbe 0x4513af
mov edx, dword [esp + 0x54]
mov eax, dword [esp + 0x50]
mov ecx, edx
sub eax, dword [esp + 0x28]
mov dword [esp + 0x30], eax
mov eax, dword [esp + 0x78]
mov edx, ebx
sbb ecx, edx
cdq
mov dword [esp + 0x40], eax
add eax, ebp
mov dword [esp + 0x50], eax
mov eax, edx
adc eax, ebx
mov dword [esp + 0x54], eax
mov eax, dword [esp + 0x5c]
mov dword [esp + 0x34], ecx
mov dword [esp + 0x44], edx
cdq
mov ecx, eax
mov eax, esi
sub eax, ecx
mov ecx, edi
sbb ecx, edx
sub eax, dword [esp + 0x50]
mov dword [esp + 0x64], eax
sbb ecx, dword [esp + 0x54]
mov eax, dword [esp + 0x34]
mov dword [esp + 0x68], ecx
xor ecx, ecx
cmp eax, ecx
mov dword [esp + 0x38], ecx
mov dword [esp + 0x3c], ecx
jg 0x4514f5
jl 0x45141f
cmp dword [esp + 0x30], 0x7fffffff
ja 0x4514f5
mov edx, dword [esp + 0x28]
push 0
mov ecx, ebx
push ecx
mov ecx, dword [esp + 0x54]
push edx
push 2
push eax
mov eax, dword [esp + 0x44]
push eax
push ecx
call fcn.00444a50
mov ecx, eax
add esp, 0x1c
test ecx, ecx
mov dword [esp + 0x3c], ecx
je 0x4514f5
mov edi, dword [esp + 0x28]
mov eax, dword [esp + 0x50]
mov edx, dword [esp + 0x68]
sub eax, edi
add eax, ecx
xor edi, edi
xor esi, esi
test edx, edx
jl 0x4514e0
jg 0x45146e
mov edx, dword [esp + 0x64]
test edx, edx
jb 0x4514e0
mov edx, dword [esp + 0x5c]
dec edx
mov dword [esp + 0x78], edx
sub eax, dword [esp + 0x58]
mov ebx, eax
lea ecx, [ecx]
mov ebp, dword [esp + 0x78]
test ebp, ebp
mov edx, dword [esp + 0x58]
jl 0x45149d
lea esp, [esp]
mov al, byte [edx]
sub al, byte [ebx + edx]
inc edx
test al, al
jne 0x4514bc
dec ebp
jns 0x451490
mov ebx, dword [esp + 0x50]
mov edx, dword [esp + 0x54]
add edi, ebx
push ecx
adc esi, edx
call dword [sym.imp.KERNEL32.dll_UnmapViewOfFile]
mov eax, edi
pop edi
mov edx, esi
pop esi
pop ebp
pop ebx
add esp, 0x38
ret
movsx eax, al
test eax, eax
je 0x45149d
mov ebp, dword [esp + 0x10]
mov eax, ebp
cdq
add edi, eax
mov eax, dword [esp + 0x68]
adc esi, edx
add ebx, ebp
cmp esi, eax
jg 0x4514e0
jl 0x451480
cmp edi, dword [esp + 0x64]
jbe 0x451480
push ecx
call dword [sym.imp.KERNEL32.dll_UnmapViewOfFile]
pop edi
pop esi
pop ebp
or eax, 0xffffffff
or edx, 0xffffffff
pop ebx
add esp, 0x38
ret
mov ecx, dword [esp + 0x78]
mov eax, dword [esp + 0x5c]
add eax, ecx
mov dword [esp + 0x18], eax
cdq
mov ecx, esi
sub ecx, eax
push 0
mov eax, edi
sbb eax, edx
lea edx, [esp + 0x54]
push edx
mov dword [esp + 0x3c], eax
or eax, 0xffffffff
push ebx
mov dword [esp + 0x5c], eax
mov dword [esp + 0x60], eax
mov eax, dword [esp + 0x58]
push ebp
push eax
mov dword [esp + 0x44], ecx
call dword [sym.imp.KERNEL32.dll_SetFilePointerEx]
cmp ebp, dword [esp + 0x50]
jne 0x451827
cmp ebx, dword [esp + 0x54]
jne 0x451827
mov ecx, dword [esp + 0x18]
sub esi, ebp
sbb edi, ebx
shl ecx, 2
mov eax, ecx
cdq
cmp edx, edi
mov dword [esp + 0x64], ecx
jl 0x451569
jg 0x451563
cmp eax, esi
jbe 0x451569
mov ecx, esi
mov dword [esp + 0x64], ecx
mov eax, dword [esp + 0x18]
add eax, 0x1ff
and eax, 0xfffffe00
mov dword [esp + 0x28], eax
lea eax, [ecx + 0x1ff]
and eax, 0xfffffe00
cmp eax, 0x200000
mov dword [esp + 0x14], eax
jge 0x451599
mov dword [esp + 0x14], 0x200000
mov esi, dword [esp + 0x14]
mov dword [esp + 0x74], 0
mov ecx, dword [esp + 0x74]
lea esp, [esp]
lea eax, [esi + 0x100001]
push ecx
call fcn.00445f60
mov ecx, eax
add esp, 4
test ecx, ecx
je 0x4515cd
mov byte [esi + ecx + 0x100000], 0
test ecx, ecx
mov edi, ecx
mov dword [esp + 0x50], edi
je 0x4515e9
lea edi, [ecx + 0x100000]
and edi, 0xfff00000
mov dword [esp + 0x50], edi
jne 0x45160a
cmp esi, dword [esp + 0x64]
jl 0x4517ce
mov eax, esi
cdq
sub eax, edx
sar eax, 1
add eax, 0x1ff
and eax, 0xfffffe00
test edi, edi
mov esi, eax
je 0x4515b0
cmp esi, dword [esp + 0x28]
mov dword [esp + 0x14], esi
mov dword [esp + 0x74], ecx
mov dword [esp + 0x20], edi
jl 0x451807
push 0
mov dword [esp + 0x68], 0
call dword [sym.imp.KERNEL32.dll_SetLastError]
cmp ebx, dword [esp + 0x34]
mov dword [esp + 0x24], 0x3e8
jg 0x4517a5
jl 0x451650
cmp ebp, dword [esp + 0x30]
ja 0x4517a5
mov edi, edi
mov ecx, dword [esp + 0x30]
mov esi, dword [esp + 0x34]
mov eax, dword [esp + 0x64]
mov edi, dword [esp + 0x14]
sub ecx, ebp
sbb esi, ebx
add ecx, 0x1ff
adc esi, 0
sub edi, eax
mov eax, edi
cdq
and ecx, 0xfffffe00
cmp esi, edx
jl 0x451686
jg 0x451682
cmp ecx, eax
jbe 0x451686
mov ecx, eax
mov esi, edx
test esi, esi
jl 0x4517a5
jg 0x451698
test ecx, ecx
jbe 0x4517a5
mov eax, dword [esp + 0x50]
mov esi, dword [esp + 0x64]
push 0
lea edx, [esp + 0x20]
push edx
mov edx, dword [esp + 0x54]
push ecx
lea ecx, [esi + eax]
push ecx
push edx
mov dword [esp + 0x30], 0
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x4516cb
mov eax, dword [esp + 0x1c]
test eax, eax
jg 0x4516de
mov eax, dword [esp + 0x24]
dec eax
test eax, eax
mov dword [esp + 0x24], eax
jle 0x4517d6
xor eax, eax
cmp eax, edi
jle 0x4516e4
mov eax, edi
mov ecx, dword [esp + 0x18]
add eax, esi
cmp eax, ecx
mov dword [esp + 0x1c], eax
mov dword [esp + 0x64], eax
jl 0x45178f
mov eax, dword [esp + 0x78]
mov ecx, dword [esp + 0x20]
mov edx, dword [esp + 0x18]
mov edi, dword [esp + 0x10]
add ecx, eax
mov eax, dword [esp + 0x64]
sub eax, edx
add eax, edi
cdq
idiv edi
mov dword [esp + 0x50], ecx
mov dword [esp + 0x28], 0
mov esi, eax
test esi, esi
jle 0x451767
lea esp, [esp]
mov eax, dword [esp + 0x5c]
mov edx, dword [esp + 0x58]
mov ecx, dword [esp + 0x50]
call fcn.004465f0
test eax, eax
jne 0x4517e1
mov ecx, dword [esp + 0x28]
mov eax, edi
cdq
inc ecx
add ebp, eax
adc ebx, edx
mov edx, dword [esp + 0x50]
add edx, edi
cmp ecx, esi
mov dword [esp + 0x28], ecx
mov dword [esp + 0x50], edx
jl 0x451730
mov eax, dword [esp + 0x64]
imul esi, edi
mov edx, dword [esp + 0x20]
sub eax, esi
test eax, eax
mov dword [esp + 0x64], eax
mov dword [esp + 0x50], edx
jle 0x45178f
push eax
mov eax, edx
add esi, eax
push esi
push eax
call fcn.004aee50
add esp, 0xc
cmp ebx, dword [esp + 0x34]
jl 0x451650
jg 0x4517a5
cmp ebp, dword [esp + 0x30]
jbe 0x451650
mov eax, dword [esp + 0x74]
test eax, eax
je 0x451827
mov ecx, dword [0x51927c]
add eax, 0xfffffff8
push eax
push 0
push ecx
call dword [sym.imp.KERNEL32.dll_HeapFree]
pop edi
pop esi
pop ebp
or eax, 0xffffffff
or edx, 0xffffffff
pop ebx
add esp, 0x38
ret
mov dword [esp + 0x14], esi
mov dword [esp + 0x74], ecx
lea ecx, [esp + 0x74]
call fcn.0043f290
jmp 0x45181e
lea ecx, [esp + 0x74]
call fcn.0043f290
lea ecx, [esp + 0x38]
call fcn.0043f230
mov eax, dword [esp + 0x40]
mov edx, dword [esp + 0x44]
pop edi
pop esi
add eax, ebp
pop ebp
adc edx, ebx
pop ebx
add esp, 0x38
ret
test ecx, ecx
je 0x45181e
mov edx, dword [0x51927c]
add ecx, 0xfffffff8
push ecx
push 0
push edx
call dword [sym.imp.KERNEL32.dll_HeapFree]
lea ecx, [esp + 0x38]
call fcn.0043f230
pop edi
pop esi
pop ebp
or eax, 0xffffffff
or edx, 0xffffffff
pop ebx
add esp, 0x38
ret