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

Disassembly:
push 0xffffffffffffffff
push 0x411b77
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0xa8
push ebx
push ebp
push esi
mov ebx, ecx
push edi
mov ecx, 0x1f
xor eax, eax
lea edi, [esp + 0x39]
mov byte [esp + 0x38], 0
mov esi, dword [esp + 0xc8]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
mov eax, dword [ebx + 0x1c2c]
mov edi, dword [sym.imp.MSVCRT.dll_fseek]
push 0
push eax
push esi
call edi
mov ecx, dword [ebx + 0x1d08]
push 0
push ecx
push esi
call edi
mov ebp, dword [sym.imp.MSVCRT.dll_fread]
push esi
push 4
lea edx, [esp + 0x58]
push 1
push edx
call ebp
add esp, 0x28
lea eax, [esp + 0x38]
mov ecx, ebx
push eax
call fcn.00406120
add eax, 0xc
push 0
push eax
push esi
call edi
mov ecx, 0x20
xor eax, eax
lea edi, [esp + 0x44]
push esi
rep stosd dword es:[edi], eax
push 4
lea ecx, [esp + 0x4c]
push 1
push ecx
call ebp
add esp, 0x1c
lea edx, [esp + 0x38]
mov ecx, ebx
push edx
call fcn.00406120
mov dword [esp + 0x10], eax
add eax, 0x14
push 0
push eax
push esi
call dword [sym.imp.MSVCRT.dll_fseek]
mov ecx, 0x20
xor eax, eax
lea edi, [esp + 0x44]
push esi
rep stosd dword es:[edi], eax
push 4
lea eax, [esp + 0x4c]
push 1
push eax
call ebp
add esp, 0x1c
lea ecx, [esp + 0x38]
push ecx
mov ecx, ebx
call fcn.00406120
mov edx, dword [esp + 0x10]
push 0
add eax, edx
push eax
push esi
call dword [sym.imp.MSVCRT.dll_fseek]
mov ecx, 0x20
xor eax, eax
lea edi, [esp + 0x44]
push esi
rep stosd dword es:[edi], eax
push 4
lea eax, [esp + 0x4c]
push 1
push eax
call ebp
add esp, 0x1c
lea ecx, [esp + 0x38]
push ecx
mov ecx, ebx
call fcn.00406120
mov edx, dword [esp + 0x10]
push 0
lea eax, [eax + edx + 0x10]
push eax
push esi
call dword [sym.imp.MSVCRT.dll_fseek]
mov ecx, 0x20
xor eax, eax
lea edi, [esp + 0x44]
push esi
rep stosd dword es:[edi], eax
push 4
lea ecx, [esp + 0x4c]
push 1
push ecx
call ebp
add esp, 0x1c
lea edx, [esp + 0x38]
mov ecx, ebx
push edx
call fcn.00406120
mov ecx, dword [esp + 0x10]
push 0
mov dword [esp + 0x18], eax
lea edx, [eax + ecx + 0x2a0]
push edx
push esi
call dword [sym.imp.MSVCRT.dll_fseek]
mov ecx, 0x20
xor eax, eax
lea edi, [esp + 0x44]
push esi
rep stosd dword es:[edi], eax
push 4
lea eax, [esp + 0x4c]
push 1
push eax
call ebp
add esp, 0x1c
lea ecx, [esp + 0x38]
push ecx
lea ecx, [esp + 0x38]
call sub.MFC42u.DLL_CString::CString_1
mov dword [esp + 0xc0], 0
mov eax, str.pcsv
lea edi, [esp + 0x38]
mov dl, byte [edi]
mov cl, dl
cmp dl, byte [eax]
jne 0x408ae3
test cl, cl
je 0x408adf
mov dl, byte [edi + 1]
mov cl, dl
cmp dl, byte [eax + 1]
jne 0x408ae3
add edi, 2
add eax, 2
test cl, cl
jne 0x408abf
xor eax, eax
jmp 0x408ae8
sbb eax, eax
sbb eax, 0xffffffff
test eax, eax
jne 0x408e1a
mov ecx, dword [esp + 0x10]
push eax
mov eax, dword [esp + 0x18]
lea edx, [eax + ecx + 0x2a4]
push edx
push esi
call dword [sym.imp.MSVCRT.dll_fseek]
mov ecx, 0x20
xor eax, eax
lea edi, [esp + 0x44]
push esi
rep stosd dword es:[edi], eax
push 4
lea eax, [esp + 0x4c]
push 1
push eax
call ebp
add esp, 0x1c
lea ecx, [esp + 0x38]
push ecx
mov ecx, ebx
call fcn.00406120
mov edx, eax
mov ecx, 0x20
xor eax, eax
lea edi, [esp + 0x38]
rep stosd dword es:[edi], eax
push eax
mov eax, dword [esp + 0x14]
lea ecx, [edx + eax + 4]
push ecx
push esi
call dword [sym.imp.MSVCRT.dll_fseek]
push esi
push 4
lea edx, [esp + 0x4c]
push 1
push edx
call ebp
add esp, 0x1c
lea eax, [esp + 0x38]
mov ecx, ebx
push eax
call fcn.00406120
mov dword [esp + 0x18], eax
mov ecx, 0x20
xor eax, eax
lea edi, [esp + 0x38]
rep stosd dword es:[edi], eax
push esi
push 4
lea ecx, [esp + 0x40]
push 1
push ecx
call ebp
add esp, 0x10
lea edx, [esp + 0x38]
mov ecx, ebx
push edx
call fcn.00406120
mov dword [esp + 0x14], eax
mov eax, dword [esp + 0x18]
lea edi, [eax*4]
push edi
call sub.MFC42u.DLL_operatornew
mov edx, eax
mov ecx, edi
mov dword [esp + 0x2c], edx
mov edi, edx
mov edx, ecx
xor eax, eax
shr ecx, 2
rep stosd dword es:[edi], eax
mov ecx, edx
push 0
and ecx, 3
rep stosb byte es:[edi], al
mov eax, dword [esp + 0x1c]
mov ecx, dword [esp + 0x18]
add eax, ecx
push eax
push esi
call dword [sym.imp.MSVCRT.dll_fseek]
mov edi, dword [esp + 0x28]
add esp, 0x10
test edi, edi
jle 0x408c35
mov edx, dword [esp + 0x28]
mov dword [esp + 0x1c], edi
mov dword [esp + 0x20], edx
mov ecx, 0x20
xor eax, eax
lea edi, [esp + 0x38]
push esi
rep stosd dword es:[edi], eax
push 4
lea eax, [esp + 0x40]
push 1
push eax
call ebp
add esp, 0x10
lea ecx, [esp + 0x38]
push ecx
mov ecx, ebx
call fcn.00406120
mov ecx, dword [esp + 0x20]
mov dword [ecx], eax
mov eax, dword [esp + 0x1c]
add ecx, 4
dec eax
mov dword [esp + 0x20], ecx
mov dword [esp + 0x1c], eax
jne 0x408bf1
mov edi, dword [esp + 0x18]
lea edx, [ebx + 0x4bb8]
lea ecx, [esp + 0x24]
push edx
call sub.MFC42u.DLL_CString::CString_2
push str.khsimulator.exe
lea ecx, [esp + 0x28]
mov byte [esp + 0xc4], 1
call sub.MFC42u.DLL_CString::Find
cmp eax, 0xffffffff
je 0x408dfc
push eax
lea eax, [esp + 0x18]
push eax
lea ecx, [esp + 0x2c]
call sub.MFC42u.DLL_CString::Left
push eax
lea ecx, [esp + 0x28]
mov byte [esp + 0xc4], 2
call sub.MFC42u.DLL_CString::operator
lea ecx, [esp + 0x14]
mov byte [esp + 0xc0], 1
call sub.MFC42u.DLL_CString::CString
test edi, edi
jle 0x408dfc
mov ecx, dword [esp + 0x28]
mov dword [esp + 0x14], edi
mov dword [esp + 0x18], ecx
mov edx, dword [esp + 0x18]
mov ecx, dword [esp + 0x10]
push 0
mov eax, dword [edx]
lea edx, [eax + ecx + 4]
push edx
push esi
call dword [sym.imp.MSVCRT.dll_fseek]
mov ecx, 0x20
xor eax, eax
lea edi, [esp + 0x44]
push esi
rep stosd dword es:[edi], eax
push 0x20
lea eax, [esp + 0x4c]
push 1
push eax
call ebp
add esp, 0x1c
lea ecx, [esp + 0x38]
push ecx
lea ecx, [esp + 0x34]
call sub.MFC42u.DLL_CString::CString_1
push eax
lea edx, [esp + 0x28]
lea eax, [esp + 0x30]
push edx
push eax
mov byte [esp + 0xcc], 3
call sub.MFC42u.DLL_operator_1
lea ecx, [esp + 0x30]
mov byte [esp + 0xc0], 5
call sub.MFC42u.DLL_CString::CString
mov ecx, 0x20
xor eax, eax
lea edi, [esp + 0x38]
push esi
rep stosd dword es:[edi], eax
push 4
lea ecx, [esp + 0x40]
push 1
push ecx
call ebp
add esp, 0x10
lea edx, [esp + 0x38]
mov ecx, ebx
push edx
call fcn.00406120
mov dword [esp + 0x1c], eax
mov ecx, 0x20
xor eax, eax
lea edi, [esp + 0x38]
rep stosd dword es:[edi], eax
push esi
push 4
lea eax, [esp + 0x40]
push 1
push eax
call ebp
add esp, 0x10
lea ecx, [esp + 0x38]
push ecx
mov ecx, ebx
call fcn.00406120
mov edx, dword [esp + 0x10]
push 0
add eax, edx
push eax
push esi
call dword [sym.imp.MSVCRT.dll_fseek]
mov edi, dword [esp + 0x28]
push edi
call sub.MFC42u.DLL_operatornew
push esi
push edi
push 1
mov dword [esp + 0x3c], eax
push eax
call ebp
mov eax, dword [esp + 0x4c]
push 0x41a0f8
push eax
call dword [sym.imp.MSVCRT.dll__wfopen]
mov edi, eax
add esp, 0x28
test edi, edi
je 0x408dc4
mov ecx, dword [esp + 0x1c]
mov edx, dword [esp + 0x20]
push edi
push ecx
push 1
push edx
call dword [sym.imp.MSVCRT.dll_fwrite]
push edi
call dword [sym.imp.MSVCRT.dll_fclose]
add esp, 0x14
mov eax, dword [esp + 0x20]
push eax
call sub.MFC42u.DLL_operatordelete
add esp, 4
lea ecx, [esp + 0x2c]
mov byte [esp + 0xc0], 1
call sub.MFC42u.DLL_CString::CString
mov ecx, dword [esp + 0x18]
mov eax, dword [esp + 0x14]
add ecx, 4
dec eax
mov dword [esp + 0x18], ecx
mov dword [esp + 0x14], eax
jne 0x408caa
mov ecx, dword [esp + 0x28]
push ecx
call sub.MFC42u.DLL_operatordelete
add esp, 4
lea ecx, [esp + 0x24]
mov byte [esp + 0xc0], 0
call sub.MFC42u.DLL_CString::CString
lea ecx, [esp + 0x34]
mov dword [esp + 0xc0], 0xffffffff
call sub.MFC42u.DLL_CString::CString
mov ecx, dword [esp + 0xb8]
pop edi
pop esi
pop ebp
pop ebx
mov dword fs:[0], ecx
add esp, 0xb4
ret 4