Function at 0x51c470
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x3c
mov dword [ebp - 0x14], ecx
cmp dword [ebp + 8], 0
jne 0x51c496
push 0
push 0
push 0
push 2
mov ecx, dword [ebp - 0x14]
call fcn.00520d10
xor al, al
jmp 0x51c79a
mov ecx, dword [ebp - 0x14]
call fcn.00519a10
mov ecx, dword [ebp - 0x14]
add ecx, 4
call fcn.0051ddd0
mov dword [ebp - 0xc], 0
push 2
push 0
mov eax, dword [ebp + 8]
push eax
call fcn.005448c8
add esp, 0xc
mov ecx, dword [ebp + 8]
push ecx
call fcn.00544cdb
add esp, 4
mov dword [ebp - 0xc], eax
push 0
push 0
mov edx, dword [ebp + 8]
push edx
call fcn.005448c8
add esp, 0xc
cmp dword [ebp - 0xc], 0
jg 0x51c4fc
push 0
push 0
push 0
push 0xc
mov ecx, dword [ebp - 0x14]
call fcn.00520d10
xor al, al
jmp 0x51c79a
mov eax, dword [ebp - 0xc]
add eax, 1
push eax
call fcn.00521d36
add esp, 4
mov dword [ebp - 0x24], eax
mov ecx, dword [ebp - 0x24]
mov dword [ebp - 8], ecx
mov edx, 1
imul eax, edx, 0
mov ecx, dword [ebp - 8]
mov byte [ecx + eax], 0
mov edx, dword [ebp + 8]
push edx
push 1
mov eax, dword [ebp - 0xc]
push eax
mov ecx, dword [ebp - 8]
push ecx
call fcn.0054478d
add esp, 0x10
cmp eax, 1
je 0x51c567
mov edx, dword [ebp - 8]
mov dword [ebp - 0x28], edx
mov eax, dword [ebp - 0x28]
push eax
call fcn.0053d801
add esp, 4
push 0
push 0
push 0
push 2
mov ecx, dword [ebp - 0x14]
call fcn.00520d10
xor al, al
jmp 0x51c79a
cmp dword [ebp + 0xc], 3
je 0x51c592
mov ecx, dword [ebp - 8]
movzx edx, byte [ecx]
cmp edx, 0xff
jne 0x51c6c4
mov eax, dword [ebp - 8]
movzx ecx, byte [eax + 1]
cmp ecx, 0xfe
jne 0x51c6c4
mov dword [ebp + 0xc], 0
mov edx, dword [ebp - 0x14]
mov byte [edx + 0x6d], 1
mov eax, dword [ebp - 0xc]
cdq
sub eax, edx
sar eax, 1
add eax, 1
xor ecx, ecx
mov edx, 2
mul edx
seto cl
neg ecx
or ecx, eax
push ecx
call fcn.00521d36
add esp, 4
mov dword [ebp - 0x2c], eax
mov eax, dword [ebp - 0x2c]
mov dword [ebp - 0x1c], eax
mov eax, dword [ebp - 0xc]
cdq
sub eax, edx
sar eax, 1
lea ecx, [eax + eax + 2]
push ecx
push 0
mov edx, dword [ebp - 0x1c]
push edx
call fcn.0053e230
add esp, 0xc
mov eax, dword [ebp - 8]
movzx ecx, byte [eax]
cmp ecx, 0xff
jne 0x51c620
mov edx, dword [ebp - 8]
movzx eax, byte [edx + 1]
cmp eax, 0xfe
jne 0x51c620
mov ecx, dword [ebp - 0xc]
sub ecx, 2
push ecx
mov edx, dword [ebp - 8]
add edx, 2
push edx
mov eax, dword [ebp - 0x1c]
push eax
call fcn.0053db60
add esp, 0xc
jmp 0x51c634
mov ecx, dword [ebp - 0xc]
push ecx
mov edx, dword [ebp - 8]
push edx
mov eax, dword [ebp - 0x1c]
push eax
call fcn.0053db60
add esp, 0xc
mov ecx, dword [ebp - 8]
mov dword [ebp - 0x30], ecx
mov edx, dword [ebp - 0x30]
push edx
call fcn.0053d801
add esp, 4
push 0
push 0
push 0
push 0
push 0xffffffffffffffff
mov eax, dword [ebp - 0x1c]
push eax
push 0
push 0xfde9
call dword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
mov dword [ebp - 0xc], eax
mov ecx, dword [ebp - 0xc]
add ecx, 1
push ecx
call fcn.00521d36
add esp, 4
mov dword [ebp - 0x34], eax
mov edx, dword [ebp - 0x34]
mov dword [ebp - 8], edx
mov eax, dword [ebp - 0xc]
add eax, 1
push eax
push 0
mov ecx, dword [ebp - 8]
push ecx
call fcn.0053e230
add esp, 0xc
push 0
push 0
mov edx, dword [ebp - 0xc]
push edx
mov eax, dword [ebp - 8]
push eax
push 0xffffffffffffffff
mov ecx, dword [ebp - 0x1c]
push ecx
push 0
push 0xfde9
call dword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
mov edx, dword [ebp - 0x1c]
mov dword [ebp - 0x38], edx
mov eax, dword [ebp - 0x38]
push eax
call fcn.0053d801
add esp, 4
jmp 0x51c6cb
mov ecx, dword [ebp - 0x14]
mov byte [ecx + 0x6d], 0
mov edx, dword [ebp - 8]
mov dword [ebp - 0x10], edx
mov eax, dword [ebp - 8]
mov dword [ebp - 0x18], eax
mov byte [ebp - 1], 0xd
mov byte [ebp - 2], 0xa
mov ecx, dword [ebp - 8]
add ecx, dword [ebp - 0xc]
mov byte [ecx], 0
mov edx, dword [ebp - 0x10]
movsx eax, byte [edx]
test eax, eax
je 0x51c749
mov ecx, dword [ebp - 0x10]
movsx edx, byte [ecx]
cmp edx, 0xd
jne 0x51c72b
mov eax, dword [ebp - 0x18]
mov byte [eax], 0xa
mov ecx, dword [ebp - 0x18]
add ecx, 1
mov dword [ebp - 0x18], ecx
mov edx, dword [ebp - 0x10]
add edx, 1
mov dword [ebp - 0x10], edx
mov eax, dword [ebp - 0x10]
movsx ecx, byte [eax]
cmp ecx, 0xa
jne 0x51c729
mov edx, dword [ebp - 0x10]
add edx, 1
mov dword [ebp - 0x10], edx
jmp 0x51c747
mov eax, dword [ebp - 0x18]
mov ecx, dword [ebp - 0x10]
mov dl, byte [ecx]
mov byte [eax], dl
mov eax, dword [ebp - 0x18]
add eax, 1
mov dword [ebp - 0x18], eax
mov ecx, dword [ebp - 0x10]
add ecx, 1
mov dword [ebp - 0x10], ecx
jmp 0x51c6e8
mov edx, dword [ebp - 0x18]
mov byte [edx], 0
mov eax, dword [ebp + 0xc]
push eax
push 0
mov ecx, dword [ebp - 8]
push ecx
mov edx, dword [ebp - 0x14]
mov eax, dword [edx]
mov ecx, dword [ebp - 0x14]
mov edx, dword [eax + 8]
call edx
mov eax, dword [ebp - 8]
mov dword [ebp - 0x3c], eax
mov ecx, dword [ebp - 0x3c]
push ecx
call fcn.0053d801
add esp, 4
mov ecx, dword [ebp - 0x14]
call fcn.0051de90
movzx edx, al
test edx, edx
jne 0x51c790
mov dword [ebp - 0x20], 1
jmp 0x51c797
mov dword [ebp - 0x20], 0
mov al, byte [ebp - 0x20]
mov esp, ebp
pop ebp
ret 8