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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x34
mov dword [ebp - 0x34], ecx
mov eax, dword [ebp - 0x34]
movzx ecx, byte [eax + 0x74]
test ecx, ecx
je 0x41275e
mov edx, dword [ebp - 0x34]
movzx eax, byte [edx + 0x75]
test eax, eax
jne 0x41275e
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.00513329
add esp, 8
mov edx, dword [ebp + 8]
push edx
push 0xbb
call fcn.00513329
add esp, 8
mov eax, dword [ebp + 8]
push eax
push 0xbf
call fcn.00513329
add esp, 8
push 0
mov ecx, dword [ebp + 8]
push ecx
mov edx, dword [ebp - 0x34]
mov eax, dword [edx]
mov ecx, dword [ebp - 0x34]
mov edx, dword [eax + 4]
call edx
mov eax, dword [ebp - 0x34]
movzx ecx, byte [eax + 0x75]
test ecx, ecx
je 0x41290b
mov dword [ebp - 0x14], 0
push 2
push 0
mov edx, dword [ebp + 8]
push edx
call fcn.00513071
add esp, 0xc
mov eax, dword [ebp + 8]
push eax
call fcn.00512f82
add esp, 4
mov dword [ebp - 0x14], eax
push 0
push 0
mov ecx, dword [ebp + 8]
push ecx
call fcn.00513071
add esp, 0xc
cmp dword [ebp - 0x14], 0
jg 0x4127c3
xor al, al
jmp 0x41291e
mov edx, dword [ebp - 0x14]
add edx, 1
push edx
call fcn.004c8580
add esp, 4
mov dword [ebp - 0x20], eax
mov eax, dword [ebp - 0x20]
mov dword [ebp - 0x18], eax
mov ecx, dword [ebp - 0x18]
mov byte [ecx], 0
mov edx, dword [ebp + 8]
push edx
push 1
mov eax, dword [ebp - 0x14]
push eax
mov ecx, dword [ebp - 0x18]
push ecx
call fcn.00512dd1
add esp, 0x10
mov dword [ebp - 0x10], eax
mov edx, dword [ebp - 0x18]
add edx, dword [ebp - 0x14]
mov byte [edx], 0
cmp dword [ebp - 0x10], 1
je 0x412822
mov eax, dword [ebp - 0x18]
mov dword [ebp - 0x24], eax
mov ecx, dword [ebp - 0x24]
push ecx
call fcn.005124eb
add esp, 4
xor al, al
jmp 0x41291e
push 0
push 0
push 0xffffffffffffffff
mov edx, dword [ebp - 0x18]
push edx
push 0
push 0xfde9
call dword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
mov dword [ebp - 0xc], eax
xor ecx, ecx
mov eax, dword [ebp - 0xc]
mov edx, 2
mul edx
seto cl
neg ecx
or ecx, eax
push ecx
call fcn.004c8580
add esp, 4
mov dword [ebp - 0x28], eax
mov eax, dword [ebp - 0x28]
mov dword [ebp - 8], eax
mov ecx, dword [ebp - 0xc]
shl ecx, 1
push ecx
push 0
mov edx, dword [ebp - 8]
push edx
call fcn.00512af0
add esp, 0xc
mov eax, dword [ebp - 0xc]
push eax
mov ecx, dword [ebp - 8]
push ecx
push 0xffffffffffffffff
mov edx, dword [ebp - 0x18]
push edx
push 0
push 0xfde9
call dword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
mov eax, dword [ebp - 0x18]
mov dword [ebp - 0x2c], eax
mov ecx, dword [ebp - 0x2c]
push ecx
call fcn.005124eb
add esp, 4
push 0
push 0
mov edx, dword [ebp + 8]
push edx
call fcn.00513071
add esp, 0xc
mov eax, dword [ebp + 8]
push eax
push 0xff
call fcn.00513329
add esp, 8
mov ecx, dword [ebp + 8]
push ecx
push 0xfe
call fcn.00513329
add esp, 8
mov edx, dword [ebp - 8]
push edx
call fcn.0051330e
add esp, 4
mov dword [ebp - 0x1c], eax
mov eax, dword [ebp + 8]
push eax
mov ecx, dword [ebp - 0x1c]
push ecx
push 2
mov edx, dword [ebp - 8]
push edx
call fcn.00513294
add esp, 0x10
mov eax, dword [ebp - 8]
mov dword [ebp - 0x30], eax
mov ecx, dword [ebp - 0x30]
push ecx
call fcn.005124eb
add esp, 4
mov edx, dword [ebp + 8]
push edx
call fcn.00513115
add esp, 4
neg eax
sbb eax, eax
add eax, 1
mov esp, ebp
pop ebp
ret 4