Function at 0x40e930
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x18
push ebx
push esi
push edi
mov edi, edx
xor eax, eax
xor edx, edx
mov dword [ebp - 8], eax
mov dword [ebp - 4], edx
test ecx, ecx
je 0x40eb2d
mov esi, dword [ecx + 0x7c]
test esi, esi
je 0x40eb2d
cmp dword [esi], eax
jne 0x40e966
lea eax, [edx - 0x64]
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov eax, dword [ebp + 8]
test eax, eax
jne 0x40e974
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov ecx, dword [esi + 0x5c]
mov dword [esi + 0x10], edi
mov dword [esi + 0x14], eax
cmp eax, ecx
jbe 0x40e986
mov dword [esi + 0x14], ecx
mov eax, ecx
test eax, eax
je 0x40eb1a
nop
mov ebx, dword [esi + 8]
test ebx, ebx
jne 0x40ea53
mov eax, dword [esi + 0x58]
test eax, eax
je 0x40ea53
mov ecx, dword [esi + 0x60]
mov ebx, 0x4000
mov edx, dword [esi + 0x68]
cmp eax, ebx
cmovb ebx, eax
add edx, dword [esi + 0x3c]
cmp byte [ecx], 0
je 0x40e9dd
cmp byte [ecx + 1], 0
je 0x40eb23
mov eax, dword [ecx + 0xc]
push 0
push 0
add eax, edx
push eax
push dword [ecx + 4]
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
jmp 0x40e9e0
mov dword [ecx + 0x18], edx
mov edi, dword [esi + 0x60]
mov dword [ebp - 0xc], edi
cmp byte [edi], 0
je 0x40ea0a
push 0
lea eax, [ebp - 0x14]
push eax
push ebx
push dword [esi]
push dword [edi + 4]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x40ea05
mov byte [edi + 8], 1
mov eax, dword [ebp - 0x14]
jmp 0x40ea38
mov edx, dword [edi + 0x18]
mov ecx, dword [edi + 0x14]
mov edi, ecx
sub edi, edx
lea eax, [edx + ebx]
cmp eax, ecx
mov eax, dword [ebp - 0xc]
cmovbe edi, ebx
push edi
mov eax, dword [eax + 0x10]
add eax, edx
push eax
push dword [esi]
call fcn.004d0380
mov eax, dword [ebp - 0xc]
add esp, 0xc
add dword [eax + 0x18], edi
mov eax, edi
xor edx, edx
div ebx
cmp eax, 1
jne 0x40eb23
add dword [esi + 0x3c], ebx
mov eax, dword [esi]
sub dword [esi + 0x58], ebx
mov dword [esi + 4], eax
mov dword [esi + 8], ebx
cmp dword [esi + 0x64], 0
jne 0x40eacc
mov eax, dword [esi + 0x14]
cmp eax, ebx
mov edi, eax
mov dword [ebp - 0x10], eax
cmovae edi, ebx
xor edx, edx
mov dword [ebp - 0xc], edi
test edi, edi
je 0x40ea8a
nop
mov eax, dword [esi + 4]
mov ecx, dword [esi + 0x10]
mov al, byte [edx + eax]
mov byte [edx + ecx], al
inc edx
cmp edx, edi
jb 0x40ea70
mov eax, dword [esi + 0x14]
mov ebx, dword [esi + 8]
mov dword [ebp - 0x10], eax
mov edi, dword [esi + 0x10]
mov edx, edi
push dword [ebp - 0xc]
mov ecx, dword [esi + 0x50]
call fcn.0040d050
mov ecx, dword [ebp - 0xc]
add esp, 4
mov edx, dword [ebp - 4]
sub ebx, ecx
sub dword [esi + 0x5c], ecx
add dword [esi + 4], ecx
add dword [esi + 0x18], ecx
mov dword [esi + 0x50], eax
mov eax, dword [ebp - 0x10]
sub eax, ecx
mov dword [esi + 8], ebx
mov dword [esi + 0x14], eax
add edx, ecx
lea eax, [edi + ecx]
mov dword [ebp - 4], edx
mov dword [esi + 0x10], eax
mov eax, dword [ebp - 8]
jmp 0x40eb10
mov edi, dword [esi + 0x18]
lea ecx, [esi + 4]
mov ebx, dword [esi + 0x10]
call fcn.0040d580
mov ecx, dword [esi + 0x50]
mov edx, ebx
mov dword [ebp - 8], eax
mov eax, dword [esi + 0x18]
sub eax, edi
push eax
mov dword [ebp - 0x10], eax
call fcn.0040d050
mov edx, dword [ebp - 4]
add esp, 4
mov dword [esi + 0x50], eax
mov eax, dword [ebp - 0x10]
add edx, eax
sub dword [esi + 0x5c], eax
mov eax, dword [ebp - 8]
mov dword [ebp - 4], edx
cmp eax, 1
je 0x40eb1a
test eax, eax
jne 0x40eb1a
cmp dword [esi + 0x14], 0
ja 0x40e990
mov eax, edx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
or eax, 0xffffffff
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
pop edi
pop esi
mov eax, 0xffffff9a
pop ebx
mov esp, ebp
pop ebp
ret