Function at 0x4157c0
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x47e2f0
mov eax, dword fs:[0]
push eax
sub esp, 0x18
push ebx
push esi
push edi
mov eax, dword [0x4ac084]
xor eax, ebp
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov dword [ebp - 0x24], 0
call fcn.00403450
mov ecx, eax
xor eax, eax
test ecx, ecx
setne al
test eax, eax
jne 0x41580b
push 0x80004005
call fcn.004039a0
mov eax, dword [ecx]
call dword [eax + 0xc]
lea esi, [eax + 0x10]
mov dword [ebp - 0x14], esi
push 0
mov dword [ebp - 4], 0
call dword [sym.imp.KERNEL32.dll_SetLastError]
mov eax, dword [esi - 8]
mov ecx, 1
sub ecx, dword [esi - 4]
sub eax, 0x104
or eax, ecx
jge 0x415849
push 0x104
lea ecx, [ebp - 0x14]
call fcn.00403880
mov esi, dword [ebp - 0x14]
mov ebx, dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
push 0x104
push esi
push 0
call ebx
mov edi, eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x20], eax
cmp edi, 0xffffffff
jne 0x41587a
push dword [esi - 8]
push esi
call fcn.0045ed24
mov edi, eax
add esp, 8
mov eax, dword [ebp - 0x20]
test edi, edi
js 0x415936
cmp edi, dword [esi - 8]
jg 0x415936
xor ecx, ecx
mov dword [esi - 0xc], edi
mov word [esi + edi*2], cx
cmp eax, 0x7a
jne 0x4158ea
mov eax, dword [esi - 8]
mov ecx, 1
sub ecx, dword [esi - 4]
sub eax, 0x7fff
or eax, ecx
jge 0x4158bd
push 0x7fff
lea ecx, [ebp - 0x14]
call fcn.00403880
mov esi, dword [ebp - 0x14]
push 0x7fff
push esi
push 0
call ebx
cmp eax, 0xffffffff
jne 0x4158d8
push dword [esi - 8]
push esi
call fcn.0045ed24
add esp, 8
test eax, eax
js 0x415936
cmp eax, dword [esi - 8]
jg 0x415936
xor ecx, ecx
mov dword [esi - 0xc], eax
mov word [esi + eax*2], cx
push 0
push 0
push 3
push 0
push 7
push SysReAllocString
push esi
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov edi, eax
or ebx, 0xffffffff
cmp edi, ebx
je 0x415a44
mov dword [ebp - 0x10], 0
mov dword [ebp - 0x20], ebx
mov dword [ebp - 0x18], ebx
call fcn.00403450
mov ecx, eax
xor eax, eax
test ecx, ecx
setne al
test eax, eax
jne 0x415940
push 0x80004005
call fcn.004039a0
push 0x80070057
call fcn.004039a0
mov eax, dword [ecx]
call dword [eax + 0xc]
add eax, 0x10
mov dword [ebp - 0x1c], eax
push 2
push 0
push 0xfffffffffffffffc
push edi
mov byte [ebp - 4], 1
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
test eax, eax
je 0x415a1f
push 0
lea eax, [ebp - 0x10]
push eax
push 4
lea eax, [ebp - 0x20]
push eax
push edi
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x415a1f
cmp dword [ebp - 0x10], 4
jne 0x415a1f
push 2
push 0
push 0xfffffffffffffff4
push edi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
test eax, eax
je 0x415a1f
push 0
lea eax, [ebp - 0x10]
push eax
push 4
lea eax, [ebp - 0x18]
push eax
push edi
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x415a1f
cmp dword [ebp - 0x10], 4
jne 0x415a1f
mov eax, dword [ebp - 0x20]
test eax, eax
je 0x415a1f
cmp dword [ebp - 0x18], 0
jbe 0x415a1f
push 0
push 0
push eax
push edi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
test eax, eax
je 0x415a1f
push 0
lea eax, [ebp - 0x10]
push eax
mov eax, dword [ebp - 0x18]
lea ecx, [ebp - 0x1c]
push eax
shr eax, 1
push eax
call fcn.004038f0
push eax
push edi
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x415a1f
mov eax, dword [ebp - 0x18]
cmp dword [ebp - 0x10], eax
jne 0x415a1f
shr eax, 1
lea ecx, [ebp - 0x1c]
push eax
call fcn.00402dc0
mov ecx, dword [ebp + 8]
lea eax, [ebp - 0x1c]
push eax
call fcn.00402e10
mov dword [ebp - 0x24], 1
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov byte [ebp - 4], 0
mov eax, ebx
mov edx, dword [ebp - 0x1c]
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x415a44
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov dword [ebp - 4], 0xffffffff
add esi, 0xfffffff0
lock xadd dword [esi + 0xc], ebx
dec ebx
test ebx, ebx
jg 0x415a60
mov ecx, dword [esi]
push esi
mov edx, dword [ecx]
call dword [edx + 4]
mov eax, dword [ebp - 0x24]
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 4