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

Disassembly:
push 0x30
mov eax, 0x42b65e
call fcn.0042864a
mov ebx, ecx
lea esi, [ebx + 0x18]
mov dword [ebp - 0x14], esi
call fcn.0040180c
mov eax, dword [ebx + 4]
test al, 0x40
mov ecx, 0x431874
je 0x40511b
mov ecx, 0x43178c
jmp 0x405124
test al, 0x20
je 0x405124
mov ecx, 0x431794
push ecx
push dword [ebp + 8]
xor edi, edi
mov dword [ebx], edi
call dword [0x42d3b0]
cmp eax, edi
pop ecx
pop ecx
mov dword [ebx], eax
jne 0x40515f
lea esi, [ebp + 8]
call fcn.00402619
mov dword [ebp - 4], edi
mov edi, dword [ebp - 0x14]
call fcn.00405a78
mov eax, dword [ebp + 8]
add eax, 0xfffffff0
call fcn.00401518
xor al, al
jmp 0x405459
mov ecx, dword [ebx + 4]
test cl, 0x10
mov byte [ebp + 0xb], 1
mov dword [ebp - 0x10], edi
je 0x40536a
mov esi, dword [0x42d3b4]
push 2
push edi
push eax
call esi
push dword [ebx]
call dword [0x42d3b8]
push edi
push edi
push dword [ebx]
mov dword [ebx + 8], eax
call esi
mov eax, dword [ebx + 8]
mov edi, 0x400
add esp, 0x1c
cmp eax, edi
jge 0x4051a8
mov edi, eax
test edi, edi
je 0x405424
push edi
call fcn.0042790e
push dword [ebx]
xor esi, esi
inc esi
push esi
push edi
push eax
mov dword [ebp - 0x1c], eax
call dword [0x42d3bc]
add esp, 0x14
dec eax
neg eax
sbb al, al
inc al
mov byte [ebp + 0xb], al
je 0x405359
and dword [ebp - 0x18], 0
and dword [ebx + 4], 0xfffffffa
mov dword [ebx + 0x10], esi
cmp dword [0x443698], 0
je 0x405273
xor ecx, ecx
mov dword [ebp - 0x24], ecx
mov eax, dword [ecx + 0x44369c]
test eax, eax
mov dword [ebp - 0x20], eax
jg 0x405222
mov eax, dword [ebp - 0x10]
cmp eax, dword [ebp - 0x20]
je 0x405245
inc dword [ebp - 0x18]
mov ecx, dword [ebp - 0x18]
and dword [ebp - 0x10], 0
shl ecx, 4
cmp dword [ecx + 0x443698], 0
mov dword [ebp - 0x24], ecx
jne 0x4051ef
jmp 0x405273
mov ecx, dword [ebp - 0x24]
mov eax, dword [ebp - 0x10]
cmp eax, edi
jge 0x4051ff
mov edx, dword [ebp - 0x1c]
mov ecx, dword [ecx + 0x443698]
mov dl, byte [edx + eax]
cmp dl, byte [eax + ecx]
jne 0x4051ff
inc eax
cmp eax, dword [ebp - 0x20]
mov dword [ebp - 0x10], eax
jl 0x40521f
jmp 0x4051ff
mov ecx, dword [ebp - 0x18]
shl ecx, 4
mov edx, dword [ecx + 0x4436a4]
or edx, dword [ebx + 4]
sub dword [ebx + 8], eax
push 2
mov dword [ebx + 4], edx
pop edx
cmp eax, edx
jne 0x405264
mov dword [ebx + 0x10], edx
push dword [ecx + 0x4436a0]
lea eax, [ebx + 0x1c]
push eax
call fcn.00401774
cmp edi, dword [ebp - 0x10]
jle 0x405288
push 0
push dword [ebp - 0x10]
push dword [ebx]
call dword [0x42d3b4]
add esp, 0xc
cmp dword [ebp - 0x10], 0
jne 0x40533b
mov eax, dword [0x445268]
mov ecx, 0x445268
call dword [eax + 0xc]
add eax, 0x10
mov dword [ebp - 0x18], eax
push edi
push dword [ebp - 0x1c]
mov dword [ebp - 4], esi
push ecx
mov eax, esp
mov dword [ebp - 0x24], esp
push ecx
mov dword [eax], 0x431360
mov eax, esp
mov dword [eax], str.UTF_16
lea eax, [ebp - 0x3c]
mov dword [ebp - 0x24], esp
push eax
call fcn.00401b19
push edi
lea esi, [ebp - 0x18]
mov byte [ebp - 4], 2
call fcn.0040141c
mov dword [ebp - 0x2c], edi
push eax
lea edi, [ebp - 0x3c]
call fcn.00404eec
pop ecx
call fcn.004059d6
mov esi, dword [ebp - 0x18]
push ecx
mov eax, esp
mov dword [ebp - 0x24], esp
mov dword [eax], esi
lea eax, [ebp - 0x24]
push eax
call fcn.00402364
pop ecx
pop ecx
lea edi, [ebx + 0x1c]
mov byte [ebp - 4], 3
call fcn.00405a78
mov eax, dword [ebp - 0x24]
add eax, 0xfffffff0
call fcn.00401518
mov eax, dword [ebp - 0x38]
add eax, 0xfffffff0
call fcn.00401518
mov eax, dword [ebp - 0x3c]
add eax, 0xfffffff0
call fcn.00401518
or dword [ebp - 4], 0xffffffff
lea eax, [esi - 0x10]
call fcn.00401518
lea eax, [ebx + 0x1c]
mov ecx, dword [eax]
cmp dword [ecx - 0xc], 0
jne 0x405359
mov ecx, dword [ebp - 0x1c]
cmp byte [ecx], 0x3c
jne 0x405359
push 0x431360
push eax
call fcn.00401774
push dword [ebp - 0x1c]
call fcn.00427bd2
mov al, byte [ebp + 0xb]
pop ecx
jmp 0x405401
test cl, 0x20
je 0x405426
test cl, 0x40
mov dword [ebx + 0x10], 1
je 0x40538a
push eax
call dword [0x42d3b8]
pop ecx
mov dword [ebx + 8], eax
cmp dword [ebx + 8], edi
jne 0x405426
xor esi, esi
cmp dword [0x443698], edi
je 0x405426
mov ecx, dword [ebx + 4]
xor eax, eax
test dword [eax + 0x4436a4], ecx
jne 0x4053be
inc esi
mov eax, esi
shl eax, 4
cmp dword [eax + 0x443698], edi
jne 0x4053a6
jmp 0x405426
shl esi, 4
mov edi, dword [esi + 0x44369c]
push 2
pop eax
cmp edi, eax
mov dword [ebp - 0x10], edi
jne 0x4053e3
mov dword [ebx + 0x10], eax
push dword [esi + 0x4436a0]
lea eax, [ebx + 0x1c]
push eax
call fcn.00401774
push dword [ebx]
push 1
push edi
push dword [esi + 0x443698]
call dword [0x42d3c4]
add esp, 0x10
dec eax
neg eax
sbb al, al
inc al
mov byte [ebp + 0xb], al
test al, al
jne 0x405424
lea esi, [ebp - 0x24]
call fcn.00402619
mov edi, dword [ebp - 0x14]
mov dword [ebp - 4], 4
call fcn.00405a78
mov eax, dword [ebp - 0x24]
jmp 0x405150
xor edi, edi
add ebx, 0x1c
mov eax, dword [ebx]
cmp dword [eax - 0xc], edi
je 0x405456
mov edi, dword [ebp - 0x14]
mov eax, ebx
call fcn.00405a78
cmp dword [ebp - 0x10], 0
je 0x40544b
push str._BOM_
push edi
call fcn.00405749
push 0x43135c
push edi
call fcn.00405749
mov al, byte [ebp + 0xb]
call fcn.00428722
ret