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

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x425c58
mov eax, dword fs:[0]
push eax
sub esp, 0x30
push ebx
push esi
push edi
mov eax, dword [0x43a504]
xor eax, ebp
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov edi, ecx
mov dword [ebp - 0x20], edi
lea eax, [edi + 0x20]
mov ecx, eax
mov dword [ebp - 0x24], eax
call fcn.004022d0
mov eax, dword [edi + 4]
mov ecx, 0x430b28
test al, 0x40
je 0x40eccd
mov eax, 0x430b30
jmp 0x40ecd7
test al, 0x20
mov eax, 0x430b38
cmove eax, ecx
push eax
push dword [ebp + 8]
mov dword [edi], 0
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll__wfopen]
add esp, 8
mov dword [edi], eax
test eax, eax
je 0x40ef7e
mov ecx, dword [edi + 4]
mov bl, 1
xor esi, esi
mov byte [ebp - 0xd], bl
mov dword [edi + 0x18], 1
test cl, 0x10
je 0x40eedb
mov ebx, dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fseek]
push 2
push esi
push eax
call ebx
push dword [edi]
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_ftell]
push esi
push esi
push dword [edi]
mov dword [edi + 0x10], eax
call ebx
mov eax, dword [edi + 0x10]
mov ebx, 0x400
add esp, 0x1c
mov dword [ebp - 0x18], ebx
cmp eax, ebx
jge 0x40ed4a
mov ebx, eax
mov dword [ebp - 0x18], ebx
test ebx, ebx
je 0x40ef26
push ebx
call fcn.004221c5
push dword [edi]
mov dword [ebp - 0x14], eax
push 1
push ebx
push eax
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fread]
add esp, 0x14
cmp eax, 1
sete al
mov byte [ebp - 0xd], al
test al, al
je 0x40eec7
and dword [edi + 4], 0xfffffffa
xor ecx, ecx
mov dword [ebp - 0x1c], ecx
cmp dword [0x43a028], ecx
je 0x40edf3
xor edx, edx
mov ebx, dword [edx + 0x43a02c]
xor esi, esi
test ebx, ebx
jle 0x40edb5
mov edi, dword [ebp - 0x18]
cmp esi, edi
jge 0x40edaf
mov eax, dword [ebp - 0x14]
mov ecx, dword [edx + 0x43a028]
mov al, byte [eax + esi]
cmp al, byte [esi + ecx]
jne 0x40edaf
inc esi
cmp esi, ebx
jl 0x40ed95
mov edi, dword [ebp - 0x20]
mov ecx, dword [ebp - 0x1c]
cmp esi, ebx
je 0x40edce
inc ecx
xor esi, esi
mov edx, ecx
mov dword [ebp - 0x1c], ecx
shl edx, 4
cmp dword [edx + 0x43a028], esi
jne 0x40ed86
jmp 0x40edf0
shl ecx, 4
mov eax, dword [ecx + 0x43a034]
or dword [edi + 4], eax
cmp esi, 2
jne 0x40ede2
mov dword [edi + 0x18], esi
push dword [ecx + 0x43a030]
lea ecx, [edi + 0x24]
call fcn.0040d410
mov ebx, dword [ebp - 0x18]
cmp ebx, esi
jle 0x40ee05
push 0
push esi
push dword [edi]
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fseek]
add esp, 0xc
test esi, esi
jne 0x40ee98
lea ecx, [ebp - 0x18]
call fcn.004089b0
push ebx
push dword [ebp - 0x14]
mov dword [ebp - 4], esi
push ecx
mov eax, esp
lea ecx, [ebp - 0x3c]
mov dword [eax], str.UTF_8
call fcn.0040cf60
push ebx
lea ecx, [ebp - 0x18]
mov byte [ebp - 4], 1
call fcn.004106d0
push ecx
mov ecx, esp
mov dword [ebp - 0x2c], ebx
push eax
mov dword [ecx], str.UTF_16
lea ecx, [ebp - 0x3c]
call fcn.00412df0
push eax
lea ecx, [ebp - 0x18]
call fcn.00413680
mov eax, dword [ebp - 0x18]
push ecx
mov ecx, esp
mov dword [ecx], eax
lea eax, [ebp - 0x20]
push eax
call fcn.00410710
add esp, 8
lea ecx, [edi + 0x24]
mov byte [ebp - 4], 2
push eax
call fcn.00401d60
lea ecx, [ebp - 0x20]
call fcn.00406dc0
lea ecx, [ebp - 0x3c]
call fcn.0040d3a0
lea ecx, [ebp - 0x18]
mov dword [ebp - 4], 0xffffffff
call fcn.00406dc0
mov eax, dword [edi + 0x24]
lea ecx, [edi + 0x24]
mov ebx, dword [ebp - 0x14]
cmp dword [eax - 0xc], 0
jne 0x40eeca
cmp byte [ebx], 0x3c
jne 0x40eeca
push str.UTF_8
call fcn.0040d410
push ebx
call fcn.00421a52
mov bl, byte [ebp - 0xd]
add esp, 4
jmp 0x40ef7a
mov ebx, dword [ebp - 0x14]
push ebx
call fcn.00421a52
mov bl, byte [ebp - 0xd]
add esp, 4
jmp 0x40ef7a
test cl, 0x20
je 0x40ef29
test cl, 0x40
je 0x40eefe
push 2
push 0
push eax
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fseek]
push dword [edi]
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_ftell]
add esp, 0x10
mov dword [edi + 0x10], eax
xor ebx, ebx
cmp dword [0x43a028], ebx
je 0x40ef26
mov ecx, dword [edi + 4]
xor eax, eax
nop dword [eax]
test dword [eax + 0x43a034], ecx
jne 0x40ef37
inc ebx
mov eax, ebx
shl eax, 4
cmp dword [eax + 0x43a028], esi
jne 0x40ef10
mov bl, byte [ebp - 0xd]
test byte [edi + 4], 0x40
je 0x40ef99
mov eax, dword [edi + 0x10]
mov dword [edi + 0x14], eax
jmp 0x40ef9c
shl ebx, 4
mov esi, dword [ebx + 0x43a02c]
cmp esi, 2
jne 0x40ef48
mov dword [edi + 0x18], esi
push dword [ebx + 0x43a030]
lea ecx, [edi + 0x24]
call fcn.0040d410
cmp dword [edi + 0x10], 0
je 0x40ef60
xor esi, esi
jmp 0x40ef26
push dword [edi]
push 1
push esi
push dword [ebx + 0x43a028]
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fwrite]
add esp, 0x10
cmp eax, 1
sete bl
test bl, bl
jne 0x40ef29
mov ecx, edi
call fcn.0040e900
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 4
mov dword [edi + 0x14], esi
test esi, esi
je 0x40efc3
push 0xffffffffffffffff
push 0xffffffffffffffff
push 0
push ecx
mov eax, esp
push ecx
mov ecx, esp
push dword [ebp - 0x24]
mov dword [eax], 0
mov dword [ecx], 0x430b40
call fcn.00414dc0
add esp, 0x18
mov al, bl
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 4