Function at 0x40e5d0
Capabilities:
Read file on windows
Write file on windows

Disassembly:
push ebp
push edi
push esi
push ebx
sub esp, 0x2c
mov ebx, 1
mov eax, dword [esp + 0x40]
mov ebp, dword [esp + 0x44]
mov edx, dword [eax]
cmp ebx, edx
jge 0x40e600
lea esi, [esi]
mov eax, dword [ebp]
mov eax, dword [eax + ebx*4]
cmp byte [eax], 0x40
je 0x40e608
inc ebx
cmp ebx, edx
jl 0x40e5f0
add esp, 0x2c
pop ebx
pop esi
pop edi
pop ebp
ret
inc eax
mov ecx, 0x417870
mov dword [esp + 4], ecx
mov dword [esp], eax
call sub.msvcrt.dll_fopen
mov dword [esp + 0x1c], eax
test eax, eax
je 0x40e6b6
mov dword [esp], eax
mov edx, 2
xor edi, edi
mov dword [esp + 8], edx
mov dword [esp + 4], edi
call sub.msvcrt.dll_fseek
inc eax
je 0x40e69e
mov edx, dword [esp + 0x1c]
mov dword [esp], edx
call sub.msvcrt.dll_ftell
cmp eax, 0xffffffff
mov edi, eax
je 0x40e69e
xor ecx, ecx
xor esi, esi
mov dword [esp + 4], ecx
mov ecx, dword [esp + 0x1c]
mov dword [esp + 8], esi
mov dword [esp], ecx
call sub.msvcrt.dll_fseek
inc eax
je 0x40e69e
lea eax, [edi + 1]
mov dword [esp], eax
call fcn.0040e870
mov dword [esp + 0x28], eax
mov esi, dword [esp + 0x1c]
mov edx, 1
mov dword [esp + 8], edi
mov dword [esp + 4], edx
mov dword [esp + 0xc], esi
mov dword [esp], eax
call sub.msvcrt.dll_fread
cmp eax, edi
je 0x40e6c2
mov esi, dword [esp + 0x1c]
inc ebx
mov dword [esp], esi
call sub.msvcrt.dll_fclose
mov edi, dword [esp + 0x40]
mov edx, dword [edi]
jmp 0x40e5fc
mov eax, dword [esp + 0x40]
inc ebx
mov edx, dword [eax]
jmp 0x40e5fc
mov edi, dword [esp + 0x28]
mov byte [eax + edi], 0
mov dword [esp], edi
call fcn.0040e3a0
mov dword [esp + 0x24], eax
mov eax, dword [ebp]
mov dword [esp], eax
call fcn.0040e300
mov dword [ebp], eax
test eax, eax
mov edx, eax
je 0x40e7d3
mov ecx, dword [esp + 0x24]
xor edi, edi
mov dword [esp + 0x20], edi
mov eax, dword [ecx]
test eax, eax
je 0x40e716
cmp byte [eax], 0
je 0x40e716
inc dword [esp + 0x20]
mov edi, dword [esp + 0x24]
mov esi, dword [esp + 0x20]
mov eax, dword [edi + esi*4]
test eax, eax
jne 0x40e6fe
mov ecx, dword [esp + 0x40]
lea edi, [ebx*4]
mov eax, dword [esp + 0x20]
mov esi, dword [ecx]
mov dword [esp], edx
add eax, esi
lea eax, [eax*4 + 4]
mov dword [esp + 4], eax
call fcn.0040e900
mov dword [ebp], eax
mov esi, dword [esp + 0x40]
mov ecx, dword [esp + 0x20]
mov edx, dword [esi]
sub edx, ebx
shl edx, 2
mov dword [esp + 8], edx
lea edx, [eax + edi + 4]
mov dword [esp + 4], edx
lea edx, [ebx + ecx]
lea edx, [eax + edx*4]
mov dword [esp], edx
call sub.msvcrt.dll_memmove
mov edx, dword [ebp]
mov eax, dword [esp + 0x24]
add edi, edx
mov edx, dword [esp + 0x20]
shl edx, 2
cmp edx, 7
jbe 0x40e796
test edi, 4
je 0x40e796
mov esi, eax
mov eax, dword [eax]
sub edx, 4
mov dword [edi], eax
mov eax, esi
add edi, 4
add eax, 4
cld
mov ecx, edx
mov esi, eax
shr ecx, 2
dec ebx
rep movsd dword es:[edi], dword [esi]
mov edi, dword [esp + 0x40]
mov eax, dword [esp + 0x40]
mov edi, dword [edi]
add dword [esp + 0x20], edi
mov edx, dword [esp + 0x20]
dec edx
mov dword [eax], edx
mov edx, dword [esp + 0x24]
mov dword [esp], edx
call sub.msvcrt.dll_free
mov ecx, dword [esp + 0x28]
mov dword [esp], ecx
call sub.msvcrt.dll_free
jmp 0x40e69e
mov dword [esp], str._nout_of_memory_n
mov eax, dword [sym.imp.msvcrt.dll__iob]
mov ebp, 1
mov dword [esp + 4], ebp
add eax, 0x40
mov dword [esp + 0xc], eax
mov eax, 0xf
mov dword [esp + 8], eax
call sub.msvcrt.dll_fwrite
mov dword [esp], 1
call fcn.0040fa20
nop
nop
nop
nop
nop
nop
nop