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

Disassembly:
push 0xffffffffffffffff
push 0x479670
mov eax, dword fs:[0]
push eax
sub esp, 0xc
push ebx
push ebp
push edi
mov eax, dword [0x498550]
xor eax, esp
push eax
lea eax, [esp + 0x1c]
mov dword fs:[0], eax
lea ecx, [esi + 0x20]
mov dword [esp + 0x18], ecx
call fcn.00402800
mov eax, dword [esi + 4]
test al, 0x40
mov ecx, 0x4844e4
je 0x40d9a5
mov ecx, 0x4844e8
jmp 0x40d9ae
test al, 0x20
je 0x40d9ae
mov ecx, 0x4844ec
mov eax, dword [esp + 0x2c]
push ecx
push eax
mov dword [esi], 0
call fcn.0045e17b
add esp, 8
test eax, eax
mov dword [esi], eax
jne 0x40d9e3
push esi
call fcn.0040d7d0
mov ecx, dword [esp + 0x1c]
mov dword fs:[0], ecx
pop ecx
pop edi
pop ebp
pop ebx
add esp, 0x18
ret 4
mov ecx, dword [esi + 4]
xor edi, edi
test cl, 0x10
mov byte [esp + 0x2c], 1
mov dword [esi + 0x18], 1
je 0x40db9c
push 2
push edi
push eax
call fcn.0045e215
mov ecx, dword [esi]
add esp, 0xc
push ecx
call fcn.0045e432
mov edx, dword [esi]
add esp, 4
push edi
push edi
push edx
mov dword [esi + 0x10], eax
call fcn.0045e215
mov eax, dword [esi + 0x10]
mov ebp, 0x400
add esp, 0xc
cmp eax, ebp
jge 0x40da3a
mov ebp, eax
test ebp, ebp
je 0x40dc42
push ebp
call fcn.0043f845
mov ebx, eax
mov eax, dword [esi]
add esp, 4
push eax
push 1
push ebp
push ebx
mov dword [esp + 0x20], ebx
call fcn.0045e6fd
add esp, 0x10
cmp eax, 1
sete al
test al, al
mov byte [esp + 0x2c], al
je 0x40db8e
and dword [esi + 4], 0xfffffffa
xor ecx, ecx
cmp dword [0x499cf8], ecx
je 0x40daef
xor eax, eax
lea ebx, [ebx]
mov edx, dword [eax + 0x499cfc]
test edx, edx
jle 0x40daad
cmp edi, ebp
jge 0x40daad
mov ebx, dword [esp + 0x10]
mov edx, dword [eax + 0x499cf8]
mov bl, byte [ebx + edi]
cmp bl, byte [edi + edx]
mov edx, dword [eax + 0x499cfc]
jne 0x40daad
add edi, 1
cmp edi, edx
jl 0x40da8a
cmp edi, edx
je 0x40dac5
add ecx, 1
mov eax, ecx
xor edi, edi
shl eax, 4
cmp dword [eax + 0x499cf8], edi
jne 0x40da80
jmp 0x40daeb
shl ecx, 4
mov eax, dword [ecx + 0x499d04]
or eax, dword [esi + 4]
cmp edi, 2
mov dword [esi + 4], eax
jne 0x40dadc
mov dword [esi + 0x18], edi
mov ecx, dword [ecx + 0x499d00]
push ecx
lea ecx, [esi + 0x24]
call fcn.004026f0
mov ebx, dword [esp + 0x10]
cmp ebp, edi
jle 0x40db01
mov edx, dword [esi]
push 0
push edi
push edx
call fcn.0045e215
add esp, 0xc
test edi, edi
jne 0x40db73
lea ecx, [esp + 0x10]
call fcn.00401320
push ebp
push ebx
push ebp
lea ecx, [esp + 0x1c]
mov dword [esp + 0x30], edi
call fcn.00401f50
push eax
call fcn.004630c0
add esp, 0xc
push ebp
lea ecx, [esp + 0x14]
call fcn.004035f0
push ecx
mov ecx, dword [esp + 0x14]
mov dword [esp + 0x18], esp
mov eax, esp
lea edx, [esp + 0x18]
push edx
mov dword [eax], ecx
call fcn.004104e0
add esp, 8
lea ecx, [esi + 0x24]
push eax
mov byte [esp + 0x28], 1
call fcn.00403570
lea ecx, [esp + 0x14]
call fcn.00401300
lea ecx, [esp + 0x10]
mov dword [esp + 0x24], 0xffffffff
call fcn.00401300
mov eax, dword [esi + 0x24]
cmp dword [eax - 0xc], 0
lea ecx, [esi + 0x24]
jne 0x40db8e
cmp byte [ebx], 0x3c
jne 0x40db8e
push str.UTF_8
call fcn.004026f0
push ebx
call fcn.0043f84a
add esp, 4
jmp 0x40dc37
test cl, 0x20
je 0x40dc42
test cl, 0x40
je 0x40dbc5
push 2
push 0
push eax
call fcn.0045e215
mov ecx, dword [esi]
add esp, 0xc
push ecx
call fcn.0045e432
add esp, 4
mov dword [esi + 0x10], eax
xor ecx, ecx
cmp dword [0x499cf8], edi
je 0x40dc42
mov edx, dword [esi + 4]
xor eax, eax
test dword [eax + 0x499d04], edx
jne 0x40dbee
add ecx, 1
mov eax, ecx
shl eax, 4
cmp dword [eax + 0x499cf8], edi
jne 0x40dbd4
jmp 0x40dc42
shl ecx, 4
mov ebx, ecx
mov edi, dword [ebx + 0x499cfc]
cmp edi, 2
jne 0x40dc01
mov dword [esi + 0x18], edi
mov edx, dword [ebx + 0x499d00]
push edx
lea ecx, [esi + 0x24]
call fcn.004026f0
cmp dword [esi + 0x10], 0
je 0x40dc1a
xor edi, edi
jmp 0x40dc42
mov eax, dword [esi]
mov ecx, dword [ebx + 0x499cf8]
push eax
push 1
push edi
push ecx
call fcn.0045e832
add esp, 0x10
cmp eax, 1
sete byte [esp + 0x2c]
cmp byte [esp + 0x2c], 0
je 0x40d9c8
test byte [esi + 4], 0x40
je 0x40dc50
mov edx, dword [esi + 0x10]
mov dword [esi + 0x14], edx
jmp 0x40dc53
mov dword [esi + 0x14], edi
test edi, edi
je 0x40dc84
push 0xffffffffffffffff
push 0xffffffffffffffff
push 0
push ecx
mov eax, esp
mov dword [esp + 0x20], esp
push ecx
mov dword [eax], 0
mov eax, esp
mov dword [eax], 0x4844f0
mov eax, dword [esp + 0x2c]
mov dword [esp + 0x24], esp
push eax
call fcn.0040bdf0
add esp, 0x18
mov al, byte [esp + 0x2c]
mov ecx, dword [esp + 0x1c]
mov dword fs:[0], ecx
pop ecx
pop edi
pop ebp
pop ebx
add esp, 0x18
ret 4