Function at 0x51b0c0
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 0x51b0e6
push 0
push 0
push 0
push 2
mov ecx, dword [ebp - 0x14]
call fcn.0051f960
xor al, al
jmp 0x51b3ea
mov ecx, dword [ebp - 0x14]
call fcn.00518660
mov ecx, dword [ebp - 0x14]
add ecx, 4
call fcn.0051ca20
mov dword [ebp - 0xc], 0
push 2
push 0
mov eax, dword [ebp + 8]
push eax
call fcn.00543369
add esp, 0xc
mov ecx, dword [ebp + 8]
push ecx
call fcn.0054377c
add esp, 4
mov dword [ebp - 0xc], eax
push 0
push 0
mov edx, dword [ebp + 8]
push edx
call fcn.00543369
add esp, 0xc
cmp dword [ebp - 0xc], 0
jg 0x51b14c
push 0
push 0
push 0
push 0xc
mov ecx, dword [ebp - 0x14]
call fcn.0051f960
xor al, al
jmp 0x51b3ea
mov eax, dword [ebp - 0xc]
add eax, 1
push eax
call fcn.00520986
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.0054322e
add esp, 0x10
cmp eax, 1
je 0x51b1b7
mov edx, dword [ebp - 8]
mov dword [ebp - 0x28], edx
mov eax, dword [ebp - 0x28]
push eax
call fcn.0053c06b
add esp, 4
push 0
push 0
push 0
push 2
mov ecx, dword [ebp - 0x14]
call fcn.0051f960
xor al, al
jmp 0x51b3ea
cmp dword [ebp + 0xc], 3
je 0x51b1e2
mov ecx, dword [ebp - 8]
movzx edx, byte [ecx]
cmp edx, 0xff
jne 0x51b314
mov eax, dword [ebp - 8]
movzx ecx, byte [eax + 1]
cmp ecx, 0xfe
jne 0x51b314
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.00520986
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.0053ca90
add esp, 0xc
mov eax, dword [ebp - 8]
movzx ecx, byte [eax]
cmp ecx, 0xff
jne 0x51b270
mov edx, dword [ebp - 8]
movzx eax, byte [edx + 1]
cmp eax, 0xfe
jne 0x51b270
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.0053c3c0
add esp, 0xc
jmp 0x51b284
mov ecx, dword [ebp - 0xc]
push ecx
mov edx, dword [ebp - 8]
push edx
mov eax, dword [ebp - 0x1c]
push eax
call fcn.0053c3c0
add esp, 0xc
mov ecx, dword [ebp - 8]
mov dword [ebp - 0x30], ecx
mov edx, dword [ebp - 0x30]
push edx
call fcn.0053c06b
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.00520986
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.0053ca90
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.0053c06b
add esp, 4
jmp 0x51b31b
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 0x51b399
mov ecx, dword [ebp - 0x10]
movsx edx, byte [ecx]
cmp edx, 0xd
jne 0x51b37b
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 0x51b379
mov edx, dword [ebp - 0x10]
add edx, 1
mov dword [ebp - 0x10], edx
jmp 0x51b397
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 0x51b338
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.0053c06b
add esp, 4
mov ecx, dword [ebp - 0x14]
call fcn.0051cae0
movzx edx, al
test edx, edx
jne 0x51b3e0
mov dword [ebp - 0x20], 1
jmp 0x51b3e7
mov dword [ebp - 0x20], 0
mov al, byte [ebp - 0x20]
mov esp, ebp
pop ebp
ret 8