Function at 0x51c7a0
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 0x51c7fe
mov edx, dword [ebp - 0xc]
movzx eax, byte [edx + 0x6d]
test eax, eax
jne 0x51c7fe
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.005443ab
add esp, 8
mov edx, dword [ebp + 8]
push edx
push 0xbb
call fcn.005443ab
add esp, 8
mov eax, dword [ebp + 8]
push eax
push 0xbf
call fcn.005443ab
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 0x51c9b4
mov dword [ebp - 0x10], 0
push 2
push 0
mov edx, dword [ebp + 8]
push edx
call fcn.005448c8
add esp, 0xc
mov eax, dword [ebp + 8]
push eax
call fcn.00544cdb
add esp, 4
mov dword [ebp - 0x10], eax
push 0
push 0
mov ecx, dword [ebp + 8]
push ecx
call fcn.005448c8
add esp, 0xc
cmp dword [ebp - 0x10], 0
jg 0x51c863
xor al, al
jmp 0x51c9d7
mov edx, dword [ebp - 0x10]
add edx, 1
push edx
call fcn.00521d36
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.0054478d
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 0x51c8cb
mov edx, dword [ebp - 8]
mov dword [ebp - 0x28], edx
mov eax, dword [ebp - 0x28]
push eax
call fcn.0053d801
add esp, 4
xor al, al
jmp 0x51c9d7
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.00521d36
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.0053e230
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.0053d801
add esp, 4
push 0
push 0
mov edx, dword [ebp + 8]
push edx
call fcn.005448c8
add esp, 0xc
mov eax, dword [ebp + 8]
push eax
push 0xff
call fcn.005443ab
add esp, 8
mov ecx, dword [ebp + 8]
push ecx
push 0xfe
call fcn.005443ab
add esp, 8
mov edx, dword [ebp - 0x14]
push edx
call fcn.0053ea71
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.00544ea0
add esp, 0x10
mov eax, dword [ebp - 0x14]
mov dword [ebp - 0x38], eax
mov ecx, dword [ebp - 0x38]
push ecx
call fcn.0053d801
add esp, 4
mov edx, dword [ebp + 8]
push edx
call fcn.005440d5
add esp, 4
test eax, eax
jne 0x51c9cd
mov dword [ebp - 0x1c], 1
jmp 0x51c9d4
mov dword [ebp - 0x1c], 0
mov al, byte [ebp - 0x1c]
mov esp, ebp
pop ebp
ret 4