Function at 0x405840
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
push ebx
xor ebx, ebx
push esi
mov esi, ecx
mov byte [esi], 0
push edi
mov dword [esi + 4], ebx
mov dword [esi + 8], ebx
mov dword [esi + 0xc], ebx
push ebx
mov dword [esi + 0x11c], ebx
mov dword [esi + 0x120], ebx
call fcn.0040ae86
mov dword [esi + 0x118], eax
push ebx
mov dword [esi + 0x128], ebx
mov dword [esi + 0x12c], ebx
call fcn.0040ae86
mov dword [esi + 0x124], eax
mov eax, dword [ebp + 8]
mov dword [esi + 0x130], 0xffffffff
mov eax, dword [eax]
add esp, 8
cmp eax, ebx
jne 0x4058a1
mov eax, 0x41a184
push ebx
push 0x80
push 3
push ebx
push 1
push 0x80000000
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov ecx, dword [ebp + 0xc]
mov edx, dword [ebp + 0x10]
mov dword [esi + 0x130], eax
mov dword [esi + 0x138], ecx
mov dword [esi + 0x13c], edx
mov dword [esi + 0x140], ebx
mov dword [esi + 0x144], ebx
mov dword [esi + 0x148], ebx
lea eax, [esi + 0x15c]
xor ecx, ecx
mov dword [esi + 0x150], eax
mov dword [esi + 0x154], ebx
mov dword [esi + 0x158], 1
mov word [eax], cx
cmp dword [esi + 0x130], 0xffffffff
je 0x405bd5
mov edx, dword [esi + 0x138]
mov eax, dword [esi + 0x13c]
push ebx
mov dword [ebp + 0xc], edx
mov dword [ebp + 0x10], eax
call dword [sym.imp.KERNEL32.dll_SetLastError]
mov edx, dword [ebp + 0xc]
mov eax, dword [esi + 0x130]
push ebx
lea ecx, [ebp + 0x10]
push ecx
push edx
push eax
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
xor ecx, ecx
mov dword [ebp + 0xc], eax
and eax, ecx
cmp eax, 0xffffffff
je 0x405955
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
je 0x40595b
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, dword [esi + 0x130]
push ebx
lea ecx, [ebp + 8]
push ecx
push 0x108
lea eax, [esi + 0x10]
push eax
push edx
mov dword [ebp + 8], ebx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x405985
call dword [sym.imp.KERNEL32.dll_GetLastError]
jmp 0x40598e
cmp dword [ebp + 8], ebx
je 0x405bd5
cmp dword [ebp + 8], 0x108
jne 0x405bd5
mov edx, 0x13
mov eax, 0x417420
lea ecx, [esi + 0x10]
jmp 0x4059b0
mov ebx, dword [ecx]
cmp ebx, dword [eax]
jne 0x405bd5
sub edx, 4
add eax, 4
add ecx, 4
cmp edx, 4
jae 0x4059b0
mov dl, byte [eax]
cmp dl, byte [ecx]
jne 0x405bd5
mov dl, byte [eax + 1]
cmp dl, byte [ecx + 1]
jne 0x405bd5
mov al, byte [eax + 2]
cmp al, byte [ecx + 2]
jne 0x405bd5
cmp dword [esi + 0x24], 1
jne 0x405bd5
cmp dword [esi + 0x38], 0x414d5a4c
jne 0x405bd5
mov eax, dword [esi + 0x28]
cmp eax, dword [esi + 0x11c]
jbe 0x405a4c
mov ecx, dword [esi + 0x118]
mov dword [esi + 0x11c], eax
shl eax, 4
push eax
push ecx
call fcn.0040af54
mov ecx, dword [esi + 0x11c]
add esp, 8
mov dword [esi + 0x118], eax
cmp dword [esi + 0x120], ecx
jbe 0x405a3f
mov dword [esi + 0x120], ecx
test eax, eax
setne al
test al, al
je 0x405bd5
mov ebx, dword [esi + 0x28]
mov eax, dword [esi + 0x118]
push 0
lea edx, [ebp + 8]
push edx
shl ebx, 4
push ebx
push eax
mov eax, dword [esi + 0x130]
push eax
mov dword [ebp + 8], 0
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x405a7e
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov eax, dword [ebp + 8]
cmp eax, ebx
jne 0x405bd5
mov ecx, dword [esi + 0x28]
mov eax, dword [esi + 0x2c]
mov dword [esi + 0x120], ecx
cmp eax, dword [esi + 0x128]
jbe 0x405ae1
lea edx, [eax*8]
mov dword [esi + 0x128], eax
mov eax, dword [esi + 0x124]
push edx
push eax
call fcn.0040af54
mov ecx, dword [esi + 0x128]
add esp, 8
mov dword [esi + 0x124], eax
cmp dword [esi + 0x12c], ecx
jbe 0x405ad4
mov dword [esi + 0x12c], ecx
test eax, eax
setne al
test al, al
je 0x405bd5
mov ebx, dword [esi + 0x2c]
mov eax, dword [esi + 0x124]
mov edx, dword [esi + 0x130]
push 0
add ebx, ebx
lea ecx, [ebp + 8]
push ecx
add ebx, ebx
add ebx, ebx
push ebx
push eax
push edx
mov dword [ebp + 8], 0
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x405b16
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov eax, dword [ebp + 8]
cmp eax, ebx
jne 0x405bd5
mov ecx, dword [esi + 0x30]
mov eax, dword [esi + 0x2c]
xor edx, edx
add ecx, dword [esi + 0x138]
push 0
adc edx, dword [esi + 0x13c]
push 0
push edx
push ecx
lea ecx, [esi + 0x130]
mov dword [esi + 0x12c], eax
call fcn.00401610
mov eax, dword [esi + 0x34]
push 0
push eax
lea ecx, [esi + 4]
call fcn.00401570
test al, al
je 0x405bd5
mov ecx, dword [esi + 0x34]
mov eax, dword [esi + 4]
push 0
lea edx, [ebp + 8]
push edx
push ecx
push eax
mov eax, dword [esi + 0x130]
push eax
mov dword [ebp + 8], 0
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x405b8a
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, dword [ebp + 8]
mov eax, dword [esi + 0x34]
cmp ecx, eax
jne 0x405bd5
push eax
lea ecx, [esi + 4]
call fcn.004015c0
xor ecx, ecx
cmp dword [esi + 0x120], ecx
jbe 0x405bd2
mov edx, dword [esi + 0xc]
mov eax, dword [esi + 0x118]
cmp dword [eax], edx
jae 0x405bd5
mov edi, dword [eax + 8]
add dword [esi + 0x140], edi
mov edi, dword [eax + 0xc]
adc dword [esi + 0x144], edi
inc ecx
add eax, 0x10
cmp ecx, dword [esi + 0x120]
jb 0x405bb0
mov byte [esi], 1
pop edi
mov eax, esi
pop esi
pop ebx
pop ebp
ret 0xc