Function at 0x4158d1
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x1c
push ebx
push esi
mov esi, dword [ebp + 8]
test esi, esi
push edi
je 0x415c58
mov ebx, dword [ebp + 0xc]
test ebx, ebx
je 0x415c58
mov eax, dword [ebp + 0x10]
mov eax, dword [eax]
and dword [ebp - 4], 0
test eax, eax
mov edi, dword [ebx + 4]
mov dword [ebp - 0x14], edi
je 0x41593d
push 3
push eax
call fcn.00413d18
mov dword [ebp - 4], eax
pop ecx
add esi, 0x11c
mov eax, edi
pop ecx
mov ecx, dword [esi]
shl eax, 4
test dword [eax + ecx + 4], 0x20000
je 0x415c53
add eax, ecx
mov ecx, dword [eax]
add ecx, dword [ebp - 4]
xor ecx, dword [eax + 0xc]
mov dword [ebp - 4], ecx
jmp 0x415c53
push 1
push dword [0x468020]
call fcn.00413d18
push 2
push dword [0x468020]
mov edi, eax
call fcn.00413d18
add esp, 0x10
cmp dword [ebx + 8], edi
jne 0x4159d4
cmp dword [ebx + 0xc], eax
jne 0x4159d4
push 3
push dword [0x468020]
call fcn.00413d18
pop ecx
pop ecx
mov ecx, dword [ebp - 0x14]
mov dword [ebp - 4], eax
lea eax, [esi + 0x11c]
mov edx, dword [eax]
shl ecx, 4
test dword [ecx + edx + 4], 0x20000
je 0x41599f
mov eax, edx
add eax, ecx
mov ecx, dword [eax]
add ecx, dword [ebp - 4]
xor ecx, dword [eax + 0xc]
mov dword [ebp - 4], ecx
push dword [0x468020]
call fcn.00437cd0
pop ecx
inc eax
push eax
call fcn.00417b53
mov ecx, dword [ebp + 0x10]
xor edi, edi
cmp eax, edi
mov dword [ecx], eax
je 0x415b52
push dword [0x468020]
push eax
call fcn.00439720
pop ecx
pop ecx
jmp 0x415b52
mov eax, dword [0x46d630]
xor ebx, ebx
mov dword [ebp - 0x1c], eax
mov dword [ebp - 0x10], ebx
mov eax, dword [ebp - 0x10]
mov eax, dword [eax + 0x468038]
mov dword [0x46d630], eax
lea eax, [ebp - 0xc]
push eax
push ebx
push dword [0x468020]
push esi
call fcn.0041539e
test eax, eax
je 0x415b30
mov eax, dword [ebp - 0xc]
mov ecx, dword [eax + 0x118]
cmp dword [ecx], ebx
jne 0x415a28
cmp dword [0x46d630], ebx
je 0x415a28
push eax
call fcn.004147ed
jmp 0x415b30
push ebx
push eax
call fcn.004138da
mov edi, eax
cmp edi, ebx
jbe 0x415a65
lea eax, [edi + 1]
push eax
call fcn.00417b53
cmp eax, ebx
mov dword [ebp - 8], eax
jne 0x415a4a
push dword [ebp - 0xc]
jmp 0x415a1e
push ebx
push ebx
push edi
push eax
push dword [ebp - 0xc]
call fcn.00414916
test eax, eax
jne 0x415a65
push dword [ebp - 8]
call fcn.00413886
mov dword [ebp - 8], ebx
push dword [ebp - 0xc]
call fcn.004147ed
cmp dword [ebp - 8], ebx
je 0x415b30
mov ebx, dword [ebp - 8]
cmp byte [ebx], 0
je 0x415b26
push ebx
call fcn.00413bf2
lea edi, [eax + ebx]
mov al, byte [edi]
push 1
push ebx
mov byte [ebp + 0xb], al
mov byte [edi], 0
call fcn.00413d18
push 2
push ebx
mov dword [ebp - 0x18], eax
call fcn.00413d18
mov edx, dword [ebp - 0x18]
mov ecx, dword [ebp + 0xc]
add esp, 0x14
cmp dword [ecx + 8], edx
jne 0x415ab9
cmp dword [ecx + 0xc], eax
je 0x415acd
mov al, byte [ebp + 0xb]
push ebx
mov byte [edi], al
call fcn.00413c3b
mov ebx, eax
test ebx, ebx
pop ecx
jne 0x415a79
jmp 0x415b26
push 3
push ebx
call fcn.00413d18
pop ecx
pop ecx
mov ecx, dword [ebp - 0x14]
mov dword [ebp - 4], eax
lea eax, [esi + 0x11c]
mov edx, dword [eax]
shl ecx, 4
test dword [ecx + edx + 4], 0x20000
je 0x415b01
mov eax, edx
add eax, ecx
mov ecx, dword [eax]
add ecx, dword [ebp - 4]
xor ecx, dword [eax + 0xc]
mov dword [ebp - 4], ecx
push ebx
call fcn.00437cd0
pop ecx
inc eax
push eax
call fcn.00417b53
test eax, eax
mov ecx, dword [ebp + 0x10]
mov dword [ecx], eax
je 0x415b21
push ebx
push eax
call fcn.00439720
pop ecx
pop ecx
cmp byte [ebx], 0
jne 0x415b40
push dword [ebp - 8]
call fcn.00413886
xor ebx, ebx
add dword [ebp - 0x10], 4
cmp dword [ebp - 0x10], 0x1c
jb 0x4159e1
jmp 0x415b48
push dword [ebp - 8]
call fcn.00413886
mov eax, dword [ebp - 0x1c]
mov dword [0x46d630], eax
xor edi, edi
cmp dword [ebp - 4], edi
jne 0x415c53
mov ebx, dword [ebp - 0x14]
mov eax, dword [esi + 0x11c]
shl ebx, 4
test word [ebx + eax + 4], 0x300
je 0x415c53
push 4
push dword [0x468014]
lea eax, [esi + 0x124]
push eax
mov dword [ebp - 0x14], edi
call fcn.00437d5b
add esp, 0xc
test eax, eax
jne 0x415bc7
mov eax, dword [esi + 0x11c]
mov eax, dword [ebx + eax]
add eax, dword [esi + 0x15c]
push edi
push edi
push eax
push dword [esi + 0x120]
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
push edi
lea eax, [ebp - 0x1c]
push eax
push 4
lea eax, [ebp - 0x14]
push eax
push dword [esi + 0x120]
call dword [sym.imp.KERNEL32.dll_ReadFile]
mov cl, byte [esi + 0x142]
mov eax, dword [esi + 0x11c]
mov eax, dword [ebx + eax + 0xc]
mov edi, 0x200
shl edi, cl
xor edx, edx
div edi
test edx, edx
je 0x415be7
inc eax
lea eax, [eax*4 + 4]
push eax
mov dword [ebp - 0x10], eax
call fcn.00417b53
test eax, eax
mov dword [ebp + 8], eax
je 0x415c58
mov eax, dword [esi + 0x11c]
mov eax, dword [ebx + eax]
add eax, dword [esi + 0x15c]
push 0
add eax, dword [ebp - 0x14]
push 0
push eax
push dword [esi + 0x120]
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
push 0
lea eax, [ebp - 0x1c]
push eax
push dword [ebp - 0x10]
push dword [ebp + 8]
push dword [esi + 0x120]
call dword [sym.imp.KERNEL32.dll_ReadFile]
push edi
push dword [ebp - 0x10]
push dword [ebp + 8]
call fcn.00413e63
add esp, 0xc
push dword [ebp + 8]
mov dword [ebp - 4], eax
call fcn.00413886
mov eax, dword [ebp - 4]
jmp 0x415c5a
xor eax, eax
pop edi
pop esi
pop ebx
leave
ret