Function at 0x4028e0
Capabilities:
Read file on windows

Disassembly:
sub esp, 0x14
mov eax, dword [esp + 0x1c]
push ebx
xor ebx, ebx
push ebp
mov ebp, dword [esp + 0x20]
push esi
cmp eax, ebx
push edi
mov dword [esp + 0x1c], ebx
mov dword [esp + 0x10], ebx
mov dword [esp + 0x14], ebx
je 0x402bc7
push 0x8000
push eax
call dword [sym.imp.MSVCRT.dll__open]
mov edi, eax
add esp, 8
cmp edi, 0xffffffff
mov dword [esp + 0x18], edi
jne 0x402929
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x14
ret
push edi
call dword [sym.imp.MSVCRT.dll__filelength]
add esp, 4
cmp eax, ebx
mov dword [esp + 0x2c], eax
jbe 0x402c14
cmp word [esp + 0x30], 4
jne 0x402a0d
mov esi, dword [sym.imp.MSVCRT.dll_malloc]
add eax, eax
push eax
call esi
add esp, 4
cmp eax, ebx
mov dword [esp + 0x10], eax
je 0x402c14
mov ecx, dword [esp + 0x2c]
lea edx, [ecx + ecx]
push edx
call esi
add esp, 4
cmp eax, ebx
mov dword [esp + 0x14], eax
je 0x402bf0
mov eax, dword [esp + 0x2c]
mov ebx, dword [esp + 0x14]
push eax
push ebx
push edi
call dword [sym.imp.MSVCRT.dll__read]
mov eax, dword [esp + 0x38]
mov edx, dword [esp + 0x1c]
push eax
push ebx
lea ecx, [eax + eax]
lea eax, [esp + 0x3c]
lea esi, [edx + 8]
push eax
push esi
mov dword [esp + 0x44], ecx
call fcn.00406690
add esp, 0x1c
test eax, eax
jne 0x402bf0
mov ecx, dword [esp + 0x2c]
mov eax, dword [esp + 0x28]
push eax
push esi
lea edx, [ecx + ecx]
lea ecx, [esp + 0x34]
mov dword [esp + 0x34], edx
mov edx, ebx
push ecx
push edx
call fcn.00406540
add esp, 0x10
test eax, eax
jne 0x402bf0
mov eax, dword [esp + 0x2c]
mov esi, dword [esp + 0x10]
push eax
push esi
call fcn.00402840
mov ecx, dword [esp + 0x30]
add esi, 4
push ecx
push esi
call fcn.00402840
mov edx, dword [esp + 0x38]
add esp, 0x10
lea eax, [edx + 8]
mov dword [esp + 0x2c], eax
test eax, eax
jbe 0x402b91
push 0x410238
call dword [sym.imp.MSVCRT.dll_printf]
mov eax, dword [esp + 0x30]
add esp, 4
cmp eax, 0x7ffa
mov ebx, 0x7ffa
jae 0x402a35
mov ebx, eax
mov esi, dword [esp + 0x10]
sub eax, ebx
test esi, esi
mov dword [esp + 0x2c], eax
je 0x402a5e
mov ecx, ebx
mov edi, 0x421be0
mov eax, ecx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov edi, dword [esp + 0x18]
jmp 0x402a6e
push ebx
push 0x421be0
push edi
call dword [sym.imp.MSVCRT.dll__read]
add esp, 0xc
push ebx
lea ecx, [esp + 0x2c]
push 0x421be0
push ecx
push 0x429be4
mov dword [esp + 0x38], 0x20000
call fcn.00406690
mov eax, dword [esp + 0x38]
add esp, 0x10
cmp eax, ebx
jb 0x402abe
mov ecx, ebx
mov esi, 0x421be0
mov eax, ecx
mov edi, 0x429be4
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov edx, ebx
mov ecx, eax
and edx, 0xffff
and ecx, 3
mov dword [esp + 0x28], edx
rep movsb byte es:[edi], byte [esi]
jmp 0x402b00
push eax
lea ecx, [esp + 0x24]
push 0x429be4
push ecx
push 0x411bc8
mov dword [esp + 0x30], 0x10000
call fcn.00406540
mov eax, dword [esp + 0x30]
add esp, 0x10
cmp eax, ebx
jne 0x402bd8
mov ecx, ebx
mov edi, 0x421be0
mov esi, 0x411bc8
xor edx, edx
repe cmpsb byte [esi], byte es:[edi]
jne 0x402bd4
mov eax, dword [esp + 0x30]
push eax
push 0x429be0
call fcn.004027f0
push ebx
push 0x429be2
call fcn.004027f0
mov ecx, dword [esp + 0x38]
add ecx, 6
push ecx
push 0x429bdc
call fcn.004027f0
mov edx, dword [esp + 0x40]
add edx, 4
push edx
push 0x429be0
call fcn.004027a0
push eax
push 0x429bde
call fcn.004027f0
mov eax, dword [esp + 0x50]
add eax, 8
push eax
push 0x429bdc
push ebp
call dword [sym.imp.MSVCRT.dll_memmove]
mov eax, dword [esp + 0x5c]
mov ecx, dword [esp + 0x50]
mov edi, dword [esp + 0x4c]
add esp, 0x34
lea edx, [ecx + eax + 8]
mov ecx, dword [0x449be8]
lea ebp, [eax + ebp + 8]
mov eax, dword [esp + 0x2c]
inc ecx
mov dword [esp + 0x1c], edx
test eax, eax
mov dword [0x449be8], ecx
ja 0x402a15
mov eax, dword [esp + 0x10]
mov esi, dword [sym.imp.MSVCRT.dll_free]
test eax, eax
je 0x402ba5
push eax
call esi
add esp, 4
mov eax, dword [esp + 0x14]
test eax, eax
je 0x402bb3
push eax
call esi
add esp, 4
push edi
call dword [sym.imp.MSVCRT.dll__close]
mov ecx, dword [esp + 0x38]
mov edx, dword [esp + 0x20]
add esp, 4
mov dword [ecx], edx
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
add esp, 0x14
ret
mov edi, dword [esp + 0x18]
push 0xfe
push str.D:ProjectSourceUtil_SourcePorter_file_maker.cpp
push str._s_at_line__d_n
call dword [sym.imp.MSVCRT.dll_printf]
add esp, 0xc
mov eax, dword [esp + 0x10]
mov esi, dword [sym.imp.MSVCRT.dll_free]
xor ebx, ebx
cmp eax, ebx
je 0x402c06
push eax
call esi
add esp, 4
mov eax, dword [esp + 0x14]
cmp eax, ebx
je 0x402c14
push eax
call esi
add esp, 4
push edi
call dword [sym.imp.MSVCRT.dll__close]
mov eax, dword [esp + 0x38]
add esp, 4
pop edi
pop esi
mov dword [eax], ebx
pop ebp
xor eax, eax
pop ebx
add esp, 0x14
ret