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

Disassembly:
push 0xffffffffffffffff
push 0x5012d2
mov eax, dword fs:[0]
push eax
sub esp, 0x14
push ebx
push ebp
push edi
mov eax, dword [0x54a020]
xor eax, esp
push eax
lea eax, [esp + 0x24]
mov dword fs:[0], eax
lea eax, [esi + 0x20]
push 0x533e66
push eax
mov dword [esp + 0x24], eax
call dword [sym.imp.MFC80.DLL_Ordinal_2322]
mov eax, dword [esi + 4]
add esp, 8
test al, 0x40
mov ecx, 0x533ea4
je 0x40a9ff
mov ecx, 0x539054
jmp 0x40aa08
test al, 0x20
je 0x40aa08
mov ecx, 0x539058
mov eax, dword [esp + 0x34]
push ecx
push eax
mov dword [esi], 0
call dword [sym.imp.MSVCR80.dll_fopen]
add esp, 8
test eax, eax
mov dword [esi], eax
jne 0x40aa3e
push esi
call fcn.0040a860
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
test cl, 0x10
mov byte [esp + 0x34], 1
mov dword [esi + 0x18], 1
je 0x40ac05
mov ebx, dword [sym.imp.MSVCR80.dll_fseek]
push 2
push edi
push eax
call ebx
mov ecx, dword [esi]
add esp, 0xc
push ecx
call dword [sym.imp.MSVCR80.dll_ftell]
mov edx, dword [esi]
add esp, 4
push edi
push edi
push edx
mov dword [esi + 0x10], eax
call ebx
mov eax, dword [esi + 0x10]
mov ebp, 0x400
add esp, 0xc
cmp eax, ebp
jge 0x40aa96
mov ebp, eax
test ebp, ebp
je 0x40acb0
push ebp
call sub.MFC80.DLL_Ordinal_265
mov ebx, eax
mov eax, dword [esi]
add esp, 4
push eax
push 1
push ebp
push ebx
mov dword [esp + 0x24], ebx
call dword [sym.imp.MSVCR80.dll_fread]
add esp, 0x10
cmp eax, 1
sete al
test al, al
mov byte [esp + 0x34], al
je 0x40abf7
and dword [esi + 4], 0xfffffffa
xor ecx, ecx
cmp dword [0x55bb78], ecx
je 0x40ab50
xor eax, eax
jmp 0x40aae0
mov edx, dword [eax + 0x55bb7c]
test edx, edx
jle 0x40ab0d
cmp edi, ebp
jge 0x40ab0d
mov ebx, dword [esp + 0x14]
mov edx, dword [eax + 0x55bb78]
mov bl, byte [ebx + edi]
cmp bl, byte [edi + edx]
mov edx, dword [eax + 0x55bb7c]
jne 0x40ab0d
add edi, 1
cmp edi, edx
jl 0x40aaea
cmp edi, edx
je 0x40ab25
add ecx, 1
mov eax, ecx
xor edi, edi
shl eax, 4
cmp dword [eax + 0x55bb78], edi
jne 0x40aae0
jmp 0x40ab4c
shl ecx, 4
mov eax, dword [ecx + 0x55bb84]
or eax, dword [esi + 4]
cmp edi, 2
mov dword [esi + 4], eax
jne 0x40ab3c
mov dword [esi + 0x18], edi
mov ecx, dword [ecx + 0x55bb80]
push ecx
lea ecx, [esi + 0x24]
call dword [sym.imp.MFC80.DLL_Ordinal_784]
mov ebx, dword [esp + 0x14]
cmp ebp, edi
jle 0x40ab63
mov edx, dword [esi]
push 0
push edi
push edx
call dword [sym.imp.MSVCR80.dll_fseek]
add esp, 0xc
test edi, edi
jne 0x40abdb
lea ecx, [esp + 0x14]
call dword [sym.imp.MFC80.DLL_Ordinal_310]
push ebp
push ebx
push ebp
lea ecx, [esp + 0x20]
mov dword [esp + 0x38], edi
call dword [sym.imp.MFC80.DLL_Ordinal_2468]
push eax
call sub.MSVCR80.dll_memcpy
add esp, 0xc
push ebp
lea ecx, [esp + 0x18]
call dword [sym.imp.MFC80.DLL_Ordinal_5403]
push ecx
mov ecx, dword [esp + 0x18]
mov dword [esp + 0x1c], esp
mov eax, esp
lea edx, [esp + 0x1c]
push edx
mov dword [eax], ecx
call fcn.0040d1c0
add esp, 8
push eax
lea ecx, [esi + 0x24]
mov byte [esp + 0x30], 1
call dword [sym.imp.MFC80.DLL_Ordinal_781]
lea ecx, [esp + 0x18]
call dword [sym.imp.MFC80.DLL_Ordinal_578]
lea ecx, [esp + 0x14]
mov dword [esp + 0x2c], 0xffffffff
call dword [sym.imp.MFC80.DLL_Ordinal_578]
mov eax, dword [esi + 0x24]
cmp dword [eax - 0xc], 0
lea ecx, [esi + 0x24]
jne 0x40abf7
cmp byte [ebx], 0x3c
jne 0x40abf7
push str.UTF_8
call dword [sym.imp.MFC80.DLL_Ordinal_784]
push ebx
call sub.MFC80.DLL_Ordinal_266
add esp, 4
jmp 0x40aca5
test cl, 0x20
je 0x40acb0
test cl, 0x40
je 0x40ac30
push 2
push 0
push eax
call dword [sym.imp.MSVCR80.dll_fseek]
mov ecx, dword [esi]
add esp, 0xc
push ecx
call dword [sym.imp.MSVCR80.dll_ftell]
add esp, 4
mov dword [esi + 0x10], eax
xor ecx, ecx
cmp dword [0x55bb78], edi
je 0x40acb0
mov edx, dword [esi + 4]
xor eax, eax
nop
test dword [eax + 0x55bb84], edx
jne 0x40ac5a
add ecx, 1
mov eax, ecx
shl eax, 4
cmp dword [eax + 0x55bb78], edi
jne 0x40ac40
jmp 0x40acb0
shl ecx, 4
mov ebx, ecx
mov edi, dword [ebx + 0x55bb7c]
cmp edi, 2
jne 0x40ac6d
mov dword [esi + 0x18], edi
mov edx, dword [ebx + 0x55bb80]
push edx
lea ecx, [esi + 0x24]
call dword [sym.imp.MFC80.DLL_Ordinal_784]
cmp dword [esi + 0x10], 0
je 0x40ac87
xor edi, edi
jmp 0x40acb0
mov eax, dword [esi]
mov ecx, dword [ebx + 0x55bb78]
push eax
push 1
push edi
push ecx
call dword [sym.imp.MSVCR80.dll_fwrite]
add esp, 0x10
cmp eax, 1
sete byte [esp + 0x34]
cmp byte [esp + 0x34], 0
je 0x40aa23
test byte [esi + 4], 0x40
je 0x40acbe
mov edx, dword [esi + 0x10]
mov dword [esi + 0x14], edx
jmp 0x40acc1
mov dword [esi + 0x14], edi
test edi, edi
je 0x40acf2
push 0xffffffffffffffff
push 0xffffffffffffffff
push 0
push ecx
mov eax, esp
mov dword [esp + 0x30], esp
push ecx
mov dword [eax], 0
mov eax, esp
mov dword [eax], 0x53905c
mov eax, dword [esp + 0x30]
mov dword [esp + 0x34], esp
push eax
call fcn.00408f90
add esp, 0x18
mov al, byte [esp + 0x34]
mov ecx, dword [esp + 0x24]
mov dword fs:[0], ecx
pop ecx
pop edi
pop ebp
pop ebx
add esp, 0x20
ret 4