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

Disassembly:
push 0xffffffffffffffff
push 0x447c10
mov eax, dword fs:[0]
push eax
sub esp, 0x14
push ebx
push ebp
push edi
mov eax, dword [0x45d594]
xor eax, esp
push eax
lea eax, [esp + 0x24]
mov dword fs:[0], eax
lea ecx, [esi + 0x20]
mov dword [esp + 0x20], ecx
call fcn.004037c0
mov eax, dword [esi + 4]
mov ecx, 0x452fec
test al, 0x40
je 0x40bf65
mov ecx, 0x452ff0
jmp 0x40bf6e
test al, 0x20
je 0x40bf6e
mov ecx, 0x452ff4
mov eax, dword [esp + 0x34]
push ecx
push eax
mov dword [esi], 0
call fcn.0043148d
add esp, 8
mov dword [esi], eax
test eax, eax
jne 0x40bfa3
push esi
call fcn.0040bd30
mov ecx, dword [esp + 0x24]
mov dword fs:[0], ecx
pop ecx
pop edi
pop ebp
pop ebx
add esp, 0x20
ret 4
mov ecx, dword [esi + 4]
xor edi, edi
mov byte [esp + 0x17], 1
mov dword [esi + 0x18], 1
test cl, 0x10
je 0x40c158
push 2
push edi
push eax
call fcn.0043152e
mov ecx, dword [esi]
add esp, 0xc
push ecx
call fcn.00431750
mov edx, dword [esi]
add esp, 4
push edi
push edi
push edx
mov dword [esi + 0x10], eax
call fcn.0043152e
mov eax, dword [esi + 0x10]
mov ebp, 0x400
add esp, 0xc
cmp eax, ebp
jge 0x40bffa
mov ebp, eax
test ebp, ebp
je 0x40c1fc
push ebp
call fcn.00411b80
mov ebx, eax
mov eax, dword [esi]
add esp, 4
push eax
push 1
push ebp
push ebx
mov dword [esp + 0x28], ebx
call fcn.00431a5e
add esp, 0x10
cmp eax, 1
sete al
mov byte [esp + 0x17], al
test al, al
je 0x40c14a
and dword [esi + 4], 0xfffffffa
xor ecx, ecx
cmp dword [0x45ed88], ecx
je 0x40c0ab
xor eax, eax
lea ebx, [ebx]
mov edx, dword [eax + 0x45ed8c]
test edx, edx
jle 0x40c06b
cmp edi, ebp
jge 0x40c06b
mov ebx, dword [esp + 0x18]
mov edx, dword [eax + 0x45ed88]
mov bl, byte [ebx + edi]
cmp bl, byte [edi + edx]
mov edx, dword [eax + 0x45ed8c]
jne 0x40c06b
inc edi
cmp edi, edx
jl 0x40c04a
cmp edi, edx
je 0x40c081
inc ecx
mov eax, ecx
xor edi, edi
shl eax, 4
cmp dword [eax + 0x45ed88], edi
jne 0x40c040
jmp 0x40c0a7
shl ecx, 4
mov eax, dword [ecx + 0x45ed94]
or eax, dword [esi + 4]
mov dword [esi + 4], eax
cmp edi, 2
jne 0x40c098
mov dword [esi + 0x18], edi
mov ecx, dword [ecx + 0x45ed90]
push ecx
lea ecx, [esi + 0x24]
call fcn.00403ab0
mov ebx, dword [esp + 0x18]
cmp ebp, edi
jle 0x40c0bd
mov edx, dword [esi]
push 0
push edi
push edx
call fcn.0043152e
add esp, 0xc
test edi, edi
jne 0x40c12f
lea ecx, [esp + 0x18]
call fcn.00403480
push ebp
push ebx
push ebp
lea ecx, [esp + 0x24]
mov dword [esp + 0x38], edi
call fcn.00403960
push eax
call fcn.00436010
add esp, 0xc
push ebp
lea ecx, [esp + 0x1c]
call fcn.00403430
push ecx
mov ecx, dword [esp + 0x1c]
mov dword [esp + 0x20], esp
mov eax, esp
lea edx, [esp + 0x20]
push edx
mov dword [eax], ecx
call fcn.0040ec60
add esp, 8
lea ecx, [esi + 0x24]
push eax
mov byte [esp + 0x30], 1
call fcn.00403390
lea ecx, [esp + 0x1c]
call fcn.00403570
lea ecx, [esp + 0x18]
mov dword [esp + 0x2c], 0xffffffff
call fcn.00403570
mov eax, dword [esi + 0x24]
cmp dword [eax - 0xc], 0
lea ecx, [esi + 0x24]
jne 0x40c14a
cmp byte [ebx], 0x3c
jne 0x40c14a
push str.UTF_8
call fcn.00403ab0
push ebx
call fcn.00411b75
add esp, 4
jmp 0x40c1f1
test cl, 0x20
je 0x40c1fc
test cl, 0x40
je 0x40c181
push 2
push 0
push eax
call fcn.0043152e
mov ecx, dword [esi]
add esp, 0xc
push ecx
call fcn.00431750
add esp, 4
mov dword [esi + 0x10], eax
xor ecx, ecx
cmp dword [0x45ed88], edi
je 0x40c1fc
mov edx, dword [esi + 4]
xor eax, eax
test dword [eax + 0x45ed94], edx
jne 0x40c1a8
inc ecx
mov eax, ecx
shl eax, 4
cmp dword [eax + 0x45ed88], edi
jne 0x40c190
jmp 0x40c1fc
shl ecx, 4
mov ebx, ecx
mov edi, dword [ebx + 0x45ed8c]
cmp edi, 2
jne 0x40c1bb
mov dword [esi + 0x18], edi
mov edx, dword [ebx + 0x45ed90]
push edx
lea ecx, [esi + 0x24]
call fcn.00403ab0
cmp dword [esi + 0x10], 0
je 0x40c1d4
xor edi, edi
jmp 0x40c1fc
mov eax, dword [esi]
mov ecx, dword [ebx + 0x45ed88]
push eax
push 1
push edi
push ecx
call fcn.00431bdd
add esp, 0x10
cmp eax, 1
sete byte [esp + 0x17]
cmp byte [esp + 0x17], 0
je 0x40bf88
test byte [esi + 4], 0x40
je 0x40c20a
mov edx, dword [esi + 0x10]
mov dword [esi + 0x14], edx
jmp 0x40c20d
mov dword [esi + 0x14], edi
test edi, edi
je 0x40c23e
push 0xffffffffffffffff
push 0xffffffffffffffff
push 0
push ecx
mov eax, esp
mov dword [esp + 0x28], esp
push ecx
mov dword [eax], 0
mov eax, esp
mov dword [eax], 0x452ff8
mov eax, dword [esp + 0x34]
mov dword [esp + 0x2c], esp
push eax
call fcn.0040a2e0
add esp, 0x18
mov al, byte [esp + 0x17]
mov ecx, dword [esp + 0x24]
mov dword fs:[0], ecx
pop ecx
pop edi
pop ebp
pop ebx
add esp, 0x20
ret 4