Function at 0x515748
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
add esp, 0xfffffe98
push ebx
push esi
push edi
xor edx, edx
mov dword [ebp - 0x164], edx
mov dword [ebp - 0x168], edx
mov dword [ebp - 0x160], edx
mov dword [ebp - 0x158], edx
mov dword [ebp - 0x15c], edx
mov dword [ebp - 0x150], edx
mov dword [ebp - 0x154], edx
mov dword [ebp - 4], eax
xor eax, eax
push ebp
push 0x515b02
push dword fs:[eax]
mov dword fs:[eax], esp
mov eax, dword [ebp - 4]
add eax, 0x148
call fcn.00404f5c
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x13c]
mov edx, dword [eax]
call dword [edx + 0x44]
mov eax, dword [ebp - 4]
cmp byte [eax + 0x124], 0
je 0x5157c3
mov eax, dword [ebp - 4]
mov ebx, dword [eax + 0x90]
jmp 0x5157cc
mov eax, dword [ebp - 4]
mov ebx, dword [eax + 0x80]
lea ecx, [ebp - 0x20]
mov edx, ebx
mov eax, dword [ebp - 4]
call fcn.005156b0
test al, al
je 0x515ae4
imul eax, dword [ebp - 0x20], 0x3d
mov edx, dword [ebp - 4]
mov edx, dword [edx + 0x130]
mov edx, dword [edx + eax]
mov ecx, dword [ebp - 4]
mov ecx, dword [ecx + 0x130]
sub edx, dword [ecx + eax + 8]
mov dword [ebp - 0x1c], edx
push 0
push 0
sub ebx, dword [ebp - 0x1c]
push ebx
mov eax, dword [ebp - 4]
mov eax, dword [eax + 4]
push eax
call sub.kernel32.dll_SetFilePointer
push 0
lea eax, [ebp - 0x24]
push eax
push 0x28
lea eax, [ebp - 0x14c]
push eax
mov eax, dword [ebp - 4]
mov eax, dword [eax + 4]
push eax
call sub.kernel32.dll_ReadFile
cmp dword [ebp - 0x14c], 0
jne 0x515ae4
push 0
push 0
mov eax, dword [ebp - 0x140]
sub eax, dword [ebp - 0x1c]
push eax
mov eax, dword [ebp - 4]
mov eax, dword [eax + 4]
push eax
call sub.kernel32.dll_SetFilePointer
mov eax, dword [ebp - 0x138]
mov dword [ebp - 0x14], eax
mov eax, dword [ebp - 0x134]
cmp eax, dword [ebp - 0x14]
jge 0x51586e
mov dword [ebp - 0x14], eax
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x13c]
xor edx, edx
call fcn.00425028
xor eax, eax
push ebp
push 0x515add
push dword fs:[eax]
mov dword fs:[eax], esp
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x13c]
mov edx, dword [ebp - 0x14]
mov ecx, dword [eax]
call dword [ecx + 0x28]
push 0
push 0
mov eax, dword [ebp - 0x128]
sub eax, dword [ebp - 0x1c]
push eax
mov eax, dword [ebp - 4]
mov eax, dword [eax + 4]
push eax
call sub.kernel32.dll_SetFilePointer
mov esi, dword [ebp - 0x14]
dec esi
test esi, esi
jl 0x515924
inc esi
push 0
lea eax, [ebp - 0x24]
push eax
push 2
lea eax, [ebp - 0x16]
push eax
mov eax, dword [ebp - 4]
mov eax, dword [eax + 4]
push eax
call sub.kernel32.dll_ReadFile
push 0x515b1c
lea edx, [ebp - 0x154]
movzx eax, word [ebp - 0x16]
add eax, dword [ebp - 0x13c]
call fcn.0040b128
push dword [ebp - 0x154]
push 0x515b1c
lea eax, [ebp - 0x150]
mov edx, 3
call fcn.004052f0
mov edx, dword [ebp - 0x150]
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x13c]
mov ecx, dword [eax]
call dword [ecx + 0x38]
dec esi
jne 0x5158c0
mov esi, dword [ebp - 0x14]
dec esi
test esi, esi
jl 0x515a31
inc esi
xor ebx, ebx
push 0
push 0
mov eax, dword [ebp - 0x12c]
sub eax, dword [ebp - 0x1c]
mov edx, ebx
add edx, edx
add edx, edx
add eax, edx
push eax
mov eax, dword [ebp - 4]
mov eax, dword [eax + 4]
push eax
call sub.kernel32.dll_SetFilePointer
push 0
lea eax, [ebp - 0x24]
push eax
push 4
lea eax, [ebp - 0x10]
push eax
mov eax, dword [ebp - 4]
mov eax, dword [eax + 4]
push eax
call sub.kernel32.dll_ReadFile
push 0
push 0
mov eax, dword [ebp - 0x10]
sub eax, dword [ebp - 0x1c]
push eax
mov eax, dword [ebp - 4]
mov eax, dword [eax + 4]
push eax
call sub.kernel32.dll_SetFilePointer
push 0
lea eax, [ebp - 0x24]
push eax
push pe_nt_image_headers32
lea eax, [ebp - 0x124]
push eax
mov eax, dword [ebp - 4]
mov eax, dword [eax + 4]
push eax
call sub.kernel32.dll_ReadFile
lea edx, [ebp - 0x158]
lea eax, [ebp - 0x124]
call fcn.0040c318
lea eax, [ebp - 0x158]
push eax
lea ecx, [ebp - 0x15c]
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x13c]
mov edx, ebx
mov edi, dword [eax]
call dword [edi + 0xc]
mov edx, dword [ebp - 0x15c]
pop eax
call fcn.00405228
mov ecx, dword [ebp - 0x158]
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x13c]
mov edx, ebx
mov edi, dword [eax]
call dword [edi + 0x20]
mov eax, dword [ebp - 4]
push dword [eax + 0x148]
lea edx, [ebp - 0x160]
lea eax, [ebp - 0x124]
call fcn.0040c318
push dword [ebp - 0x160]
push 0x515b28
mov eax, dword [ebp - 4]
add eax, 0x148
mov edx, 3
call fcn.004052f0
inc ebx
dec esi
jne 0x515933
push 0
push 0
mov eax, dword [ebp - 0x130]
sub eax, dword [ebp - 0x1c]
push eax
mov eax, dword [ebp - 4]
mov eax, dword [eax + 4]
push eax
call sub.kernel32.dll_SetFilePointer
mov esi, dword [ebp - 0x14]
dec esi
test esi, esi
jl 0x515abf
inc esi
xor ebx, ebx
push 0
lea eax, [ebp - 0x24]
push eax
push 4
lea eax, [ebp - 0xc]
push eax
mov eax, dword [ebp - 4]
mov eax, dword [eax + 4]
push eax
call sub.kernel32.dll_ReadFile
lea ecx, [ebp - 0x164]
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x13c]
mov edx, ebx
mov edi, dword [eax]
call dword [edi + 0xc]
lea eax, [ebp - 0x164]
push eax
lea edx, [ebp - 0x168]
mov eax, dword [ebp - 0xc]
call fcn.0040b128
mov edx, dword [ebp - 0x168]
pop eax
call fcn.00405228
mov ecx, dword [ebp - 0x164]
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x13c]
mov edx, ebx
mov edi, dword [eax]
call dword [edi + 0x20]
inc ebx
dec esi
jne 0x515a56
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x515ae4
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x13c]
mov dl, 1
call fcn.00425028
ret
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x515b09
lea eax, [ebp - 0x168]
mov edx, 7
call fcn.00404f80
ret