Function at 0x4052a0
Capabilities:
Read file on windows

Disassembly:
mov eax, dword [esp + 0x14]
sub esp, 0xa0
test eax, eax
jne 0x4052b9
mov dword [esp + 0xb4], 0x4056d0
push ebx
mov ebx, dword [esp + 0xc0]
push ebp
push esi
test ebx, ebx
push edi
jne 0x4052d5
lea eax, [esp + 0x14]
mov dword [esp + 0xcc], eax
mov ebx, eax
mov ecx, dword [esp + 0xb4]
push 0x408074
push ecx
call dword [sym.imp.MSVCRT.dll_fopen]
mov esi, eax
add esp, 8
test esi, esi
jne 0x405302
pop edi
pop esi
mov dword [ebx], 3
pop ebp
pop ebx
add esp, 0xa0
ret
push 2
push 0
push esi
call dword [sym.imp.MSVCRT.dll_fseek]
add esp, 0xc
test eax, eax
je 0x405331
push esi
mov dword [ebx], 3
call dword [sym.imp.MSVCRT.dll_fclose]
add esp, 4
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xa0
ret
push esi
call dword [sym.imp.MSVCRT.dll_ftell]
cdq
mov edi, edx
add esp, 4
test edi, edi
mov ebp, eax
jg 0x405368
jl 0x40534b
cmp ebp, 1
jae 0x405368
push esi
mov dword [ebx], 3
call dword [sym.imp.MSVCRT.dll_fclose]
add esp, 4
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xa0
ret
push 0
push 0
push esi
call dword [sym.imp.MSVCRT.dll_fseek]
add esp, 0xc
test eax, eax
je 0x405397
push esi
mov dword [ebx], 3
call dword [sym.imp.MSVCRT.dll_fclose]
add esp, 4
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xa0
ret
test edi, edi
jg 0x4053bf
jl 0x4053a2
cmp ebp, 0x14
ja 0x4053bf
push esi
mov dword [ebx], 4
call dword [sym.imp.MSVCRT.dll_fclose]
add esp, 4
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xa0
ret
push esi
push 0x14
lea edx, [esp + 0x38]
push 1
push edx
call dword [sym.imp.MSVCRT.dll_fread]
add esp, 0x10
cmp eax, 0x14
mov dword [esp + 0x10], eax
je 0x4053f8
push esi
mov dword [ebx], 3
call dword [sym.imp.MSVCRT.dll_fclose]
add esp, 4
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xa0
ret
mov eax, dword [esp + 0x30]
lea ecx, [esp + 0x20]
push 0x4087a4
push ecx
mov dword [esp + 0x18], 4
mov dword [esp + 0x28], eax
mov byte [esp + 0x2c], 0
call dword [sym.imp.MSVCRT.dll__stricmp]
add esp, 8
test eax, eax
je 0x405441
push esi
mov dword [ebx], 4
call dword [sym.imp.MSVCRT.dll_fclose]
add esp, 4
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xa0
ret
mov ebx, dword [esp + 0x3c]
mov eax, dword [esp + 0x38]
cmp edi, ebx
mov dword [esp + 0x18], eax
mov dword [esp + 0x1c], ebx
jg 0x40545b
jl 0x4054d1
cmp ebp, eax
jbe 0x4054d1
mov ecx, dword [esp + 0x40]
cmp ecx, 0x400
mov dword [esp + 0x10], ecx
jle 0x40548f
mov eax, dword [esp + 0xcc]
push esi
mov dword [eax], 4
call dword [sym.imp.MSVCRT.dll_fclose]
add esp, 4
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xa0
ret
lea eax, [ecx + 0x14]
mov dword [esp + 0x14], eax
cdq
cmp edx, edi
jl 0x4054c5
jg 0x4054a1
cmp eax, ebp
jb 0x4054c5
mov ecx, dword [esp + 0xcc]
push esi
mov dword [ecx], 4
call dword [sym.imp.MSVCRT.dll_fclose]
add esp, 4
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xa0
ret
cmp edx, ebx
jl 0x4054f5
jg 0x4054d1
cmp eax, dword [esp + 0x38]
jbe 0x4054f5
mov edx, dword [esp + 0xcc]
push esi
mov dword [edx], 4
call dword [sym.imp.MSVCRT.dll_fclose]
add esp, 4
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xa0
ret
mov edi, dword [esp + 0xc0]
test edi, edi
je 0x40554f
mov eax, dword [edi]
mov dword [edi], ecx
cmp eax, ecx
jl 0x40554f
mov eax, dword [esp + 0xbc]
test eax, eax
je 0x40554f
push esi
push ecx
push 1
push eax
call dword [sym.imp.MSVCRT.dll_fread]
mov ecx, dword [edi]
add esp, 0x10
cmp ecx, eax
mov dword [esp + 0x10], eax
je 0x40554f
mov eax, dword [esp + 0xcc]
push esi
mov dword [eax], 3
call dword [sym.imp.MSVCRT.dll_fclose]
add esp, 4
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xa0
ret
mov edi, dword [esp + 0x18]
push 0
push edi
push esi
call dword [sym.imp.MSVCRT.dll_fseek]
add esp, 0xc
test eax, eax
je 0x405588
mov ecx, dword [esp + 0xcc]
push esi
mov dword [ecx], 1
call dword [sym.imp.MSVCRT.dll_fclose]
add esp, 4
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xa0
ret
sub ebp, edi
mov eax, ebp
push eax
mov dword [esp + 0x14], eax
call dword [sym.imp.MSVCRT.dll_malloc]
mov edi, eax
add esp, 4
test edi, edi
jne 0x4055c4
mov edx, dword [esp + 0xcc]
push esi
mov dword [edx], 2
call dword [sym.imp.MSVCRT.dll_fclose]
add esp, 4
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xa0
ret
mov eax, dword [esp + 0x10]
push esi
push eax
push 1
push edi
call dword [sym.imp.MSVCRT.dll_fread]
mov ecx, dword [esp + 0x20]
add esp, 0x10
cmp eax, ecx
je 0x405609
push edi
call dword [sym.imp.MSVCRT.dll_free]
mov ecx, dword [esp + 0xd0]
push esi
mov dword [ecx], 1
call dword [sym.imp.MSVCRT.dll_fclose]
add esp, 8
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xa0
ret
lea edx, [esp + 0x10]
push edx
push ecx
push edi
call fcn.004023d0
push edi
mov ebx, eax
call dword [sym.imp.MSVCRT.dll_free]
add esp, 0x10
test ebx, ebx
jne 0x405649
mov eax, dword [esp + 0xcc]
push esi
mov dword [eax], 1
call dword [sym.imp.MSVCRT.dll_fclose]
add esp, 4
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xa0
ret
mov ecx, dword [esp + 0xc8]
mov edx, dword [esp + 0xc4]
mov eax, dword [esp + 0xb8]
push ecx
mov ecx, dword [esp + 0x14]
push edx
mov edx, dword [esp + 0x1c]
push eax
push ecx
push ebx
push edx
push esi
call fcn.004056e0
add esp, 0x1c
test eax, eax
push ebx
jne 0x4056a3
call fcn.00402440
mov eax, dword [esp + 0xd0]
push esi
mov dword [eax], 3
call dword [sym.imp.MSVCRT.dll_fclose]
add esp, 8
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xa0
ret
call fcn.00402440
push esi
call dword [sym.imp.MSVCRT.dll_fclose]
add esp, 8
mov eax, 1
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xa0
ret