Function at 0x51b3f0
Capabilities:
Read file on windows
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x38
mov dword [ebp - 0xc], ecx
mov eax, dword [ebp - 0xc]
movzx ecx, byte [eax + 0x6c]
test ecx, ecx
je 0x51b44e
mov edx, dword [ebp - 0xc]
movzx eax, byte [edx + 0x6d]
test eax, eax
jne 0x51b44e
mov byte [ebp - 1], 0xef
mov byte [ebp - 2], 0xbb
mov byte [ebp - 3], 0xbf
mov ecx, dword [ebp + 8]
push ecx
push 0xef
call fcn.00542e4c
add esp, 8
mov edx, dword [ebp + 8]
push edx
push 0xbb
call fcn.00542e4c
add esp, 8
mov eax, dword [ebp + 8]
push eax
push 0xbf
call fcn.00542e4c
add esp, 8
push 0
mov ecx, dword [ebp + 8]
push ecx
mov edx, dword [ebp - 0xc]
mov eax, dword [edx]
mov ecx, dword [ebp - 0xc]
mov edx, dword [eax + 4]
call edx
mov eax, dword [ebp - 0xc]
movzx ecx, byte [eax + 0x6d]
test ecx, ecx
je 0x51b604
mov dword [ebp - 0x10], 0
push 2
push 0
mov edx, dword [ebp + 8]
push edx
call fcn.00543369
add esp, 0xc
mov eax, dword [ebp + 8]
push eax
call fcn.0054377c
add esp, 4
mov dword [ebp - 0x10], eax
push 0
push 0
mov ecx, dword [ebp + 8]
push ecx
call fcn.00543369
add esp, 0xc
cmp dword [ebp - 0x10], 0
jg 0x51b4b3
xor al, al
jmp 0x51b627
mov edx, dword [ebp - 0x10]
add edx, 1
push edx
call fcn.00520986
add esp, 4
mov dword [ebp - 0x20], eax
mov eax, dword [ebp - 0x20]
mov dword [ebp - 8], eax
mov ecx, 1
imul edx, ecx, 0
mov eax, dword [ebp - 8]
mov byte [eax + edx], 0
mov ecx, dword [ebp + 8]
push ecx
push 1
mov edx, dword [ebp - 0x10]
push edx
mov eax, dword [ebp - 8]
push eax
call fcn.0054322e
add esp, 0x10
mov dword [ebp - 0x24], eax
mov ecx, dword [ebp - 8]
add ecx, dword [ebp - 0x10]
mov byte [ecx], 0
cmp dword [ebp - 0x24], 1
je 0x51b51b
mov edx, dword [ebp - 8]
mov dword [ebp - 0x28], edx
mov eax, dword [ebp - 0x28]
push eax
call fcn.0053c06b
add esp, 4
xor al, al
jmp 0x51b627
push 0
push 0
push 0xffffffffffffffff
mov ecx, dword [ebp - 8]
push ecx
push 0
push 0xfde9
call dword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
mov dword [ebp - 0x18], eax
xor ecx, ecx
mov eax, dword [ebp - 0x18]
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 - 0x14], eax
mov ecx, dword [ebp - 0x18]
shl ecx, 1
push ecx
push 0
mov edx, dword [ebp - 0x14]
push edx
call fcn.0053ca90
add esp, 0xc
mov eax, dword [ebp - 0x18]
push eax
mov ecx, dword [ebp - 0x14]
push ecx
push 0xffffffffffffffff
mov edx, dword [ebp - 8]
push edx
push 0
push 0xfde9
call dword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
mov eax, dword [ebp - 8]
mov dword [ebp - 0x30], eax
mov ecx, dword [ebp - 0x30]
push ecx
call fcn.0053c06b
add esp, 4
push 0
push 0
mov edx, dword [ebp + 8]
push edx
call fcn.00543369
add esp, 0xc
mov eax, dword [ebp + 8]
push eax
push 0xff
call fcn.00542e4c
add esp, 8
mov ecx, dword [ebp + 8]
push ecx
push 0xfe
call fcn.00542e4c
add esp, 8
mov edx, dword [ebp - 0x14]
push edx
call fcn.0053d2d1
add esp, 4
mov dword [ebp - 0x34], eax
mov eax, dword [ebp + 8]
push eax
mov ecx, dword [ebp - 0x34]
push ecx
push 2
mov edx, dword [ebp - 0x14]
push edx
call fcn.00543941
add esp, 0x10
mov eax, dword [ebp - 0x14]
mov dword [ebp - 0x38], eax
mov ecx, dword [ebp - 0x38]
push ecx
call fcn.0053c06b
add esp, 4
mov edx, dword [ebp + 8]
push edx
call fcn.00542b76
add esp, 4
test eax, eax
jne 0x51b61d
mov dword [ebp - 0x1c], 1
jmp 0x51b624
mov dword [ebp - 0x1c], 0
mov al, byte [ebp - 0x1c]
mov esp, ebp
pop ebp
ret 4