Function at 0x565ab0
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x2c
mov dword [ebp - 0xc], esi
mov esi, dword [ebp + 8]
mov dword [ebp - 8], ebx
push 0
mov eax, dword [esi + 0xec]
mov ebx, dword [esi + 0x98]
mov dword [ebp - 4], eax
mov eax, ebx
add eax, 0xffffffff
mov edx, dword [esi + 0x9c]
mov ecx, dword [esi + 0xf8]
mov dword [ebp - 0x1c], edx
adc edx, 0xffffffff
push ecx
push edx
push eax
mov dword [ebp - 0x10], edi
mov dword [ebp - 0x20], ecx
call fcn.0058d9c0
mov ecx, eax
mov edi, edx
test byte [esi + 0x171], 0x40
je 0x565b60
mov edx, dword [esi + 0xa0]
mov dword [ebp - 0x24], ebx
sub ebx, edx
mov dword [ebp - 0x2c], edx
mov eax, dword [esi + 0xa4]
mov edx, dword [ebp - 0x1c]
mov ebx, dword [ebp - 0x24]
sbb edx, eax
mov dword [ebp - 0x28], eax
jl 0x565b60
mov edx, ebx
sub edx, dword [esi + 0xa8]
mov edx, dword [ebp - 0x1c]
sbb edx, dword [esi + 0xac]
jge 0x565b60
mov dword [esi + 0xe8], 0
sub ebx, dword [ebp - 0x2c]
mov eax, dword [ebp - 0x1c]
push 0
sbb eax, dword [ebp - 0x28]
push dword [ebp - 0x20]
push eax
push ebx
call fcn.0058d9c0
add eax, dword [esi + 0x38]
mov dword [esi + 0x50], eax
jmp 0x565f68
push 0
mov dword [ebp - 0x18], ecx
lea edx, [ebp - 0x14]
push edx
push ecx
push dword [esi + 0xe4]
mov dword [ebp - 0x24], ecx
mov dword [ebp - 0x14], edi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov ecx, dword [ebp - 0x24]
mov dword [ebp - 0x18], eax
cmp eax, 0xffffffff
je 0x5660b6
mov ebx, dword [ebp - 0x14]
mov edx, 0xffffffff
sub eax, edx
sub ebx, edx
or eax, ebx
je 0x566098
mov edx, 0xffffffff
sub ecx, edx
sub edi, edx
mov dword [esi + 0xe8], 0
or ecx, edi
je 0x566069
movzx eax, byte [esi + 0x16a]
test eax, 0x80
movzx edx, byte [esi + 0x170]
jne 0x565bdd
test dl, 1
jne 0x565bdd
test dl, 2
je 0x565d7b
mov ebx, dword [esi + 0x80]
test ebx, ebx
je 0x565d7b
mov eax, dword [ebp - 4]
cmp eax, dword [esi + 0x134]
jne 0x565d7b
and edx, 0x80
movzx ecx, byte [esi + 0x171]
mov eax, dword [esi + 0xe4]
shr edx, 7
mov dword [ebp - 0x1c], ecx
mov dword [ebp - 0x20], eax
mov ecx, dword [esi + 0x140]
cmp dword [0x5ec960], 0
je 0x565cc2
cmp ecx, 2
je 0x565c33
cmp ecx, 1
jne 0x565c3f
xor edi, edi
mov eax, 0xffffffff
jmp 0x565d6a
test edx, edx
je 0x565c4c
cmp ecx, 0xfffffffa
je 0x565f81
test ecx, ecx
je 0x565f97
xor eax, eax
mov dword [ebp - 0x2c], eax
mov dword [ebp - 0x24], eax
test edx, edx
je 0x565c7f
test byte [ebp - 0x1c], 1
je 0x565c7f
push dword [ebp - 0x24]
mov dword [ebp - 0x28], ecx
call fcn.005b4350
push dword [ebp - 0x24]
call fcn.005b4370
mov ecx, dword [ebp - 0x28]
add esp, 8
cmp dword [ebp - 0x2c], 0
je 0x565cc2
push dword [ebp - 0x24]
push dword [ebp - 4]
push ebx
call fcn.005b4350
add esp, 0xc
mov edi, eax
cmp edi, 0xffffffff
je 0x565f90
push 0
push dword [ebp - 0x24]
push 2
push 0x5cb634
call fcn.005b4350
add esp, 0x10
mov byte [edi + ebx], 0xa
inc edi
mov eax, 1
jmp 0x565d6a
mov dword [ebp - 0x28], ecx
push 0
call dword [sym.imp.KERNEL32.dll_SetLastError]
mov eax, dword [esi + 0x13c]
test eax, eax
mov ecx, dword [ebp - 0x28]
jne 0x565cdf
mov eax, 0x20000
cmp eax, dword [ebp - 4]
jae 0x565ce8
test ecx, ecx
jne 0x565d00
push 0
lea eax, [ebp - 0x28]
push eax
push dword [ebp - 4]
push ebx
push dword [ebp - 0x20]
call dword [sym.imp.KERNEL32.dll_ReadFile]
mov edi, dword [ebp - 0x28]
jmp 0x565d6a
xor edi, edi
mov dword [ebp - 0x2c], edi
mov edi, ebx
mov ebx, eax
push 0
mov esi, ebx
lea edx, [ebp - 0x28]
push edx
push ebx
push edi
push dword [ebp - 0x20]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x565d4d
mov ecx, dword [ebp - 0x2c]
add ecx, dword [ebp - 0x28]
mov dword [ebp - 0x2c], ecx
mov ecx, dword [ebp + 8]
mov edx, dword [ebp - 4]
sub edx, dword [ebp - 0x28]
mov ecx, dword [ecx + 0x13c]
test ecx, ecx
mov dword [ebp - 4], edx
jne 0x565d44
mov ecx, 0x20000
cmp edx, ecx
ja 0x565d4a
mov ebx, edx
add edi, dword [ebp - 0x28]
cmp dword [ebp - 4], 0
je 0x565fc4
cmp esi, dword [ebp - 0x28]
jne 0x565fc4
test eax, eax
jne 0x565d09
mov edi, dword [ebp - 0x2c]
mov esi, dword [ebp + 8]
or byte [esi + 0x16f], 0x40
mov edx, 1
jmp 0x565edf
and edx, 0x80
mov ebx, dword [esi + 0xe4]
movzx eax, byte [esi + 0x171]
shr edx, 7
mov dword [ebp - 0x20], ebx
mov ebx, dword [esi + 0x38]
mov dword [ebp - 0x24], eax
mov edi, dword [esi + 0x140]
cmp dword [0x5ec960], 0
je 0x565e40
cmp edi, 2
je 0x565db7
cmp edi, 1
jne 0x565dc3
xor edi, edi
mov eax, 0xffffffff
jmp 0x565edd
test edx, edx
je 0x565dd0
cmp edi, 0xfffffffa
je 0x565fcf
test edi, edi
je 0x565fe8
xor eax, eax
mov dword [ebp - 0x2c], eax
mov dword [ebp - 0x28], eax
test edx, edx
je 0x565dfd
test byte [ebp - 0x24], 1
je 0x565dfd
push dword [ebp - 0x28]
call fcn.005b4350
push dword [ebp - 0x28]
call fcn.005b4370
add esp, 8
cmp dword [ebp - 0x2c], 0
je 0x565e40
push dword [ebp - 0x28]
push dword [ebp - 4]
push ebx
call fcn.005b4350
add esp, 0xc
mov edi, eax
cmp edi, 0xffffffff
je 0x565fe1
push 0
push dword [ebp - 0x28]
push 2
push 0x5cb634
call fcn.005b4350
add esp, 0x10
mov byte [edi + ebx], 0xa
inc edi
mov eax, 1
jmp 0x565edd
push 0
call dword [sym.imp.KERNEL32.dll_SetLastError]
mov eax, dword [esi + 0x13c]
test eax, eax
jne 0x565e57
mov eax, 0x20000
cmp eax, dword [ebp - 4]
jae 0x565e60
test edi, edi
jne 0x565e78
push 0
lea eax, [ebp - 0x24]
push eax
push dword [ebp - 4]
push ebx
push dword [ebp - 0x20]
call dword [sym.imp.KERNEL32.dll_ReadFile]
mov edi, dword [ebp - 0x24]
jmp 0x565edd
xor edi, edi
mov dword [ebp - 0x2c], edi
mov edi, ebx
mov ebx, eax
push 0
mov esi, ebx
lea edx, [ebp - 0x24]
push edx
push ebx
push edi
push dword [ebp - 0x20]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x565ec0
mov ecx, dword [ebp - 0x24]
add edi, ecx
mov edx, dword [ebp - 4]
add dword [ebp - 0x2c], ecx
sub edx, ecx
mov ecx, dword [ebp + 8]
mov dword [ebp - 4], edx
mov ecx, dword [ecx + 0x13c]
test ecx, ecx
jne 0x565eba
mov ecx, 0x20000
cmp edx, ecx
ja 0x565ec0
mov ebx, edx
cmp dword [ebp - 4], 0
je 0x56605e
cmp esi, dword [ebp - 0x24]
jne 0x56605e
test eax, eax
jne 0x565e81
mov edi, dword [ebp - 0x2c]
mov esi, dword [ebp + 8]
xor edx, edx
test eax, eax
je 0x566034
test edi, edi
je 0x566022
test byte [esi + 0x168], 1
je 0x565f05
cmp byte [esi + 0x155], 2
je 0x56600f
test edx, edx
jne 0x565f68
mov eax, dword [esi + 0xf8]
xor edx, edx
mov dword [ebp - 0x2c], eax
mov eax, edi
mov edi, dword [ebp - 0x2c]
div edi
mov ecx, dword [esi + 0x38]
mov dword [esi + 0x50], ecx
mov ecx, dword [esi + 0x98]
add eax, ecx
mov ebx, dword [esi + 0x9c]
mov edx, ebx
adc edx, 0
mov dword [esi + 0xa0], ecx
sub ecx, eax
mov dword [esi + 0xa4], ebx
sub ebx, edx
or ecx, ebx
jne 0x565f5c
add eax, 1
mov dword [esi + 0xa8], eax
adc edx, 0
mov dword [esi + 0xac], edx
jmp 0x565f68
mov dword [esi + 0xa8], eax
mov dword [esi + 0xac], edx
xor eax, eax
mov dword [esi + 0x108], 0
mov ebx, dword [ebp - 8]
mov esi, dword [ebp - 0xc]
mov edi, dword [ebp - 0x10]
mov esp, ebp
pop ebp
ret
mov dword [ebp - 0x24], eax
mov dword [ebp - 0x2c], 1
jmp 0x565c60
xor eax, eax
jmp 0x565d6a
mov dword [ebp - 0x28], ecx
mov dword [ebp - 0x2c], edx
call fcn.005b4370
mov edx, dword [ebp - 0x2c]
mov ecx, dword [ebp - 0x28]
mov dword [ebp - 0x24], eax
cmp dword [0x5ec960], 0
je 0x565c85
mov dword [ebp - 0x2c], 1
jmp 0x565c5c
mov edi, dword [ebp - 0x2c]
mov esi, dword [ebp + 8]
jmp 0x565d6a
mov eax, dword [ebp - 0x20]
mov dword [ebp - 0x28], eax
mov dword [ebp - 0x2c], 1
jmp 0x565de4
xor eax, eax
jmp 0x565edd
mov dword [ebp - 0x2c], edx
call fcn.005b4370
mov edx, dword [ebp - 0x2c]
mov dword [ebp - 0x28], eax
cmp dword [0x5ec960], 0
je 0x565e03
mov dword [ebp - 0x2c], 1
jmp 0x565de0
mov eax, dword [esi + 0x38]
movsx eax, byte [eax]
test eax, eax
je 0x566022
cmp eax, 0x40
jne 0x565f05
mov eax, 0x24
mov ebx, dword [ebp - 8]
mov esi, dword [ebp - 0xc]
mov edi, dword [ebp - 0x10]
mov esp, ebp
pop ebp
ret
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, 0x24
cmp eax, 0x26
mov dword [esi + 0xe8], eax
je 0x56604f
mov edx, 0x27
mov eax, edx
mov ebx, dword [ebp - 8]
mov esi, dword [ebp - 0xc]
mov edi, dword [ebp - 0x10]
mov esp, ebp
pop ebp
ret
mov edi, dword [ebp - 0x2c]
mov esi, dword [ebp + 8]
jmp 0x565edd
mov eax, dword [esi + 0x9c]
mov ecx, dword [esi + 0xa0]
mov edi, dword [esi + 0xa4]
mov edx, dword [esi + 0xf8]
mov ebx, dword [esi + 0x98]
mov dword [ebp - 0x1c], eax
mov dword [ebp - 0x20], edx
mov dword [ebp - 0x2c], ecx
mov dword [ebp - 0x28], edi
jmp 0x565b40
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [esi + 0xe8], eax
mov eax, 0x27
mov ebx, dword [ebp - 8]
mov esi, dword [ebp - 0xc]
mov edi, dword [ebp - 0x10]
mov esp, ebp
pop ebp
ret
mov dword [ebp - 0x24], ecx
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, dword [ebp - 0x24]
test eax, eax
je 0x5660d3
mov eax, 0xffffffff
mov dword [ebp - 0x18], eax
mov dword [ebp - 0x14], eax
jmp 0x566098
mov eax, dword [ebp - 0x18]
mov ebx, dword [ebp - 0x14]
jmp 0x565b8e