Function at 0x401650
Capabilities:
Write file on windows

Disassembly:
push 0xffffffffffffffff
push 0x4112ec
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x224
push ebx
push ebp
push esi
xor eax, eax
mov esi, ecx
push edi
mov word [esp + 0x21], ax
xor ebx, ebx
mov ecx, 0x81
lea edi, [esp + 0x2e]
mov byte [esp + 0x23], al
mov word [esp + 0x2c], bx
rep stosd dword es:[edi], eax
lea ecx, [esp + 0x10]
stosw word es:[edi], ax
call sub.MFC42u.DLL_CString::CString_3
lea ebp, [esi + 0xa54]
lea ecx, [esi + 0xfc]
push ebp
mov dword [esp + 0x240], ebx
call sub.MFC42u.DLL_CWnd::GetWindowTextW
lea ebx, [esi + 0xa50]
lea ecx, [esi + 0x1b8]
push ebx
call sub.MFC42u.DLL_CWnd::GetWindowTextW
lea edi, [esi + 0xa58]
lea ecx, [esi + 0x274]
push edi
call sub.MFC42u.DLL_CWnd::GetWindowTextW
push 3
push 0
mov ecx, edi
call sub.MFC42u.DLL_CString::Delete
push ebp
lea ecx, [esp + 0x18]
call sub.MFC42u.DLL_CString::CString_2
push ebx
lea ecx, [esp + 0x20]
mov byte [esp + 0x240], 1
call sub.MFC42u.DLL_CString::CString_2
push edi
lea ecx, [esp + 0x1c]
mov byte [esp + 0x240], 2
call sub.MFC42u.DLL_CString::CString_2
push 0x14
lea ecx, [esp + 0x18]
mov byte [esp + 0x240], 3
call sub.MFC42u.DLL_CString::GetBuffer
push 0x14
lea ecx, [esp + 0x20]
mov ebp, eax
call sub.MFC42u.DLL_CString::GetBuffer
push 0x14
lea ecx, [esp + 0x1c]
mov ebx, eax
call sub.MFC42u.DLL_CString::GetBuffer
push 0xffffffffffffffff
lea ecx, [esp + 0x18]
mov dword [esp + 0x2c], eax
call sub.MFC42u.DLL_CString::ReleaseBuffer
push 0xffffffffffffffff
lea ecx, [esp + 0x20]
call sub.MFC42u.DLL_CString::ReleaseBuffer
push 0xffffffffffffffff
lea ecx, [esp + 0x1c]
call sub.MFC42u.DLL_CString::ReleaseBuffer
push 1
push 0x104
call dword [sym.imp.MSVCRT.dll_calloc]
add esp, 8
mov edi, eax
push 0
push 0
push 0x104
push edi
push 0xffffffffffffffff
push ebp
push 0x200
push 0
call dword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
test eax, eax
jne 0x4017d4
lea ecx, [esp + 0x18]
mov byte [esp + 0x23c], 2
call sub.MFC42u.DLL_CString::CString
lea ecx, [esp + 0x1c]
mov byte [esp + 0x23c], 1
call sub.MFC42u.DLL_CString::CString
lea ecx, [esp + 0x14]
mov byte [esp + 0x23c], 0
call sub.MFC42u.DLL_CString::CString
mov dword [esp + 0x23c], 0xffffffff
jmp 0x40193c
push edi
call dword [sym.imp.MSVCRT.dll_atoi]
add esp, 4
mov byte [esp + 0x20], al
xor ebp, ebp
mov al, byte [edi]
cmp al, 0x2e
je 0x4017f6
test al, al
je 0x4017f6
mov al, byte [edi + 1]
inc edi
cmp al, 0x2e
jne 0x4017ea
inc edi
push edi
call dword [sym.imp.MSVCRT.dll_atoi]
add esp, 4
mov byte [esp + ebp + 0x21], al
inc ebp
cmp ebp, 3
jl 0x4017e4
mov ecx, dword [esp + 0x23]
mov edx, dword [esp + 0x22]
mov eax, dword [esp + 0x21]
and ecx, 0xff
shl ecx, 8
and edx, 0xff
mov edi, dword [sym.imp.MSVCRT.dll__wtoi]
add ecx, edx
mov edx, dword [esp + 0x20]
shl ecx, 8
and eax, 0xff
and edx, 0xff
add ecx, eax
push ebx
shl ecx, 8
add ecx, edx
mov dword [esi + 0xa88], ecx
call edi
mov word [esi + 0xa8c], ax
mov eax, dword [esp + 0x2c]
push eax
call edi
push 0x41a134
mov word [esi + 0xa8e], ax
call edi
add esp, 0xc
lea ecx, [esp + 0x2c]
mov dword [esi + 0xa90], eax
push 0x104
push ecx
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleHandleW]
push eax
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
lea edx, [esp + 0x2c]
lea ecx, [esp + 0x10]
push edx
call sub.MFC42u.DLL_CString::operator_2
lea ecx, [esp + 0x10]
call sub.MFC42u.DLL_CString::MakeLower
push str.khsimulator.exe
lea ecx, [esp + 0x14]
call sub.MFC42u.DLL_CString::Find
or ebx, 0xffffffff
cmp eax, ebx
je 0x401902
push str.HPara.dat
push str.khsimulator.exe
lea ecx, [esp + 0x18]
call sub.MFC42u.DLL_CString::Replace
mov eax, dword [esp + 0x10]
push 0x41a0f8
push eax
call dword [sym.imp.MSVCRT.dll__wfopen]
mov edi, eax
add esp, 8
test edi, edi
je 0x401902
push edi
push 0x10
add esi, 0xa84
push 1
push esi
call dword [sym.imp.MSVCRT.dll_fwrite]
push edi
call dword [sym.imp.MSVCRT.dll_fclose]
add esp, 0x14
lea ecx, [esp + 0x18]
mov byte [esp + 0x23c], 2
call sub.MFC42u.DLL_CString::CString
lea ecx, [esp + 0x1c]
mov byte [esp + 0x23c], 1
call sub.MFC42u.DLL_CString::CString
lea ecx, [esp + 0x14]
mov byte [esp + 0x23c], 0
call sub.MFC42u.DLL_CString::CString
mov dword [esp + 0x23c], ebx
lea ecx, [esp + 0x10]
call sub.MFC42u.DLL_CString::CString
mov ecx, dword [esp + 0x234]
pop edi
pop esi
pop ebp
pop ebx
mov dword fs:[0], ecx
add esp, 0x230
ret