Function at 0x409230
Capabilities:
Read file on windows
Terminate process
Write file on windows

Disassembly:
push 0xffffffffffffffff
push 0x411c08
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x48
push ebx
push ebp
mov ebp, ecx
push esi
push edi
lea ecx, [esp + 0x14]
call sub.MFC42u.DLL_CString::CString_3
xor edi, edi
push str.macro_.dll
lea ecx, [esp + 0x1c]
mov dword [esp + 0x64], edi
mov byte [esp + 0x16], 0
mov byte [esp + 0x17], 0
call fcn.0041063c
mov esi, dword [sym.imp.MSVCRT.dll_calloc]
push 2
push 0x104
mov byte [esp + 0x68], 1
call esi
push 1
push 0x104
call esi
mov esi, eax
add esp, 0x10
cmp esi, edi
mov dword [esp + 0x2c], esi
jne 0x4092b1
push edi
call dword [sym.imp.MSVCRT.dll_free]
add esp, 4
push 1
call dword [sym.imp.MSVCRT.dll_exit]
mov eax, dword [ebp + 0x1c88]
mov dword [esp + 0x28], edi
cmp eax, edi
jbe 0x40949d
mov ebx, dword [esp + 0x68]
mov dword [esp + 0x24], edi
jmp 0x4092d1
mov esi, dword [esp + 0x2c]
mov eax, dword [esp + 0x24]
mov edx, dword [ebp + 0x1c8c]
add eax, edx
push 0
push eax
push ebx
call dword [sym.imp.MSVCRT.dll_fseek]
push ebx
push 0x14
push 1
push esi
call dword [sym.imp.MSVCRT.dll_fread]
mov ecx, 5
lea edi, [ebp + 0x1db0]
rep movsd dword es:[edi], dword [esi]
mov ecx, 9
xor eax, eax
lea edi, [esp + 0x4e]
mov word [esp + 0x4c], 0
rep stosd dword es:[edi], eax
xor edx, edx
lea ecx, [esp + 0x4c]
mov dx, word [ebp + 0x1db0]
push 0xa
push ecx
push edx
stosw word es:[edi], ax
call dword [sym.imp.MSVCRT.dll__itow]
add esp, 0x28
lea ecx, [esp + 0x18]
push eax
push 6
call sub.MFC42u.DLL_CString::Insert
lea eax, [esp + 0x18]
lea ecx, [esp + 0x68]
push eax
call sub.MFC42u.DLL_CString::CString_2
push 0x14
lea ecx, [esp + 0x6c]
mov byte [esp + 0x64], 2
call sub.MFC42u.DLL_CString::GetBuffer
push 0xffffffffffffffff
lea ecx, [esp + 0x6c]
mov esi, eax
call sub.MFC42u.DLL_CString::ReleaseBuffer
lea eax, [ebp + 0x4bb8]
lea ecx, [esp + 0x14]
push eax
call sub.MFC42u.DLL_CString::operator
push str.khsimulator.exe
lea ecx, [esp + 0x18]
call sub.MFC42u.DLL_CString::Find
cmp eax, 0xffffffff
je 0x4094db
push esi
push str.khsimulator.exe
lea ecx, [esp + 0x1c]
call sub.MFC42u.DLL_CString::Replace
mov ecx, dword [esp + 0x14]
push 0x41a0f8
push ecx
call dword [sym.imp.MSVCRT.dll__wfopen]
mov edi, eax
add esp, 8
test edi, edi
je 0x4094e3
mov eax, dword [ebp + 0x1dbc]
test eax, eax
mov dword [esp + 0x20], eax
je 0x4094fd
push 1
push eax
call dword [sym.imp.MSVCRT.dll_calloc]
add esp, 8
mov esi, eax
test esi, esi
push 0
je 0x40951e
mov edx, dword [ebp + 0x1dc0]
push edx
push ebx
call dword [sym.imp.MSVCRT.dll_fseek]
mov eax, dword [esp + 0x2c]
push ebx
push eax
push 1
push esi
call dword [sym.imp.MSVCRT.dll_fread]
mov eax, dword [esp + 0x3c]
add esp, 0x1c
test eax, eax
mov dword [esp + 0x1c], 0
jle 0x40944e
mov ecx, dword [esp + 0x1c]
push edi
push 1
lea eax, [esp + 0x1a]
mov dl, byte [ecx + esi]
push 1
push eax
mov byte [esp + 0x22], dl
call dword [sym.imp.MSVCRT.dll_fwrite]
mov al, byte [edi + 0xc]
add esp, 0x10
test al, 0x20
jne 0x40952f
mov eax, dword [esp + 0x1c]
mov ecx, dword [esp + 0x20]
inc eax
cmp eax, ecx
mov dword [esp + 0x1c], eax
jl 0x409414
push edi
call dword [sym.imp.MSVCRT.dll_fclose]
push esi
call dword [sym.imp.MSVCRT.dll_free]
add esp, 8
lea ecx, [esp + 0x18]
push str.macro_.dll
call sub.MFC42u.DLL_CString::operator_2
lea ecx, [esp + 0x68]
mov byte [esp + 0x60], 1
call sub.MFC42u.DLL_CString::CString
mov eax, dword [esp + 0x28]
mov edx, dword [esp + 0x24]
mov ecx, dword [ebp + 0x1c88]
inc eax
add edx, 0x14
cmp eax, ecx
mov dword [esp + 0x28], eax
mov dword [esp + 0x24], edx
jb 0x4092cd
mov dword [ebp + 0x1a9c], 0
lea ecx, [esp + 0x18]
mov byte [esp + 0x60], 0
call sub.MFC42u.DLL_CString::CString
lea ecx, [esp + 0x14]
mov dword [esp + 0x60], 0xffffffff
call sub.MFC42u.DLL_CString::CString
mov ecx, dword [esp + 0x58]
pop edi
pop esi
pop ebp
pop ebx
mov dword fs:[0], ecx
add esp, 0x54
ret 4
push 1
call dword [sym.imp.MSVCRT.dll_exit]
mov ecx, dword [esp + 0x2c]
push ecx
call dword [sym.imp.MSVCRT.dll_free]
add esp, 4
mov dword [ebp + 0x1a9c], 7
jmp 0x40954a
push edi
mov dword [ebp + 0x1a9c], 5
call dword [sym.imp.MSVCRT.dll_fclose]
mov edx, dword [esp + 0x18]
push edx
call dword [sym.imp.MSVCRT.dll__wunlink]
add esp, 8
jmp 0x40954a
call dword [sym.imp.MSVCRT.dll_free]
add esp, 4
push 1
call dword [sym.imp.MSVCRT.dll_exit]
push edi
call dword [sym.imp.MSVCRT.dll_fclose]
push esi
call dword [sym.imp.MSVCRT.dll_free]
add esp, 8
mov dword [ebp + 0x1a9c], 5
lea ecx, [esp + 0x68]
mov byte [esp + 0x60], 1
call sub.MFC42u.DLL_CString::CString
jmp 0x4094a7