Function at 0x40ca50
Capabilities:
Read file on windows
Terminate process

Disassembly:
push 0xffffffffffffffff
push 0x411d6c
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x258
push ebp
push esi
mov esi, ecx
push edi
lea ecx, [esp + 0x24]
call sub.MFC42u.DLL_CString::CString_3
lea ecx, [esp + 0x10]
mov dword [esp + 0x26c], 0
call sub.MFC42u.DLL_CString::CString_3
xor eax, eax
lea edi, [esi + 0x46dc]
mov dword [esp + 0x49], eax
mov ecx, 0xc8
mov dword [esp + 0x4d], eax
push 0x41a144
mov dword [esp + 0x55], eax
mov byte [esp + 0x270], 1
mov dword [esp + 0x59], eax
mov byte [esp + 0x4c], 0
mov word [esp + 0x5d], ax
mov byte [esp + 0x5f], al
rep stosd dword es:[edi], eax
mov eax, dword [esi + 0x4ba4]
push eax
call dword [sym.imp.MSVCRT.dll__wfopen]
mov edi, eax
add esp, 8
test edi, edi
mov dword [esp + 0x38], edi
jne 0x40cafc
push 0x10
push str.KHSimulator_Message
push 0x41a268
mov ecx, esi
call sub.MFC42u.DLL_CWnd::MessageBoxW
push 1
call dword [sym.imp.MSVCRT.dll_exit]
mov ebp, dword [sym.imp.MSVCRT.dll_calloc]
push ebx
push 1
push 0x104
call ebp
push 1
push 0x104
call ebp
mov ebx, eax
push 2
push 0x104
mov dword [esp + 0x38], ebx
call ebp
push 1
push 0x104
call ebp
mov ecx, dword [0x41a8f0]
add esp, 0x20
lea ebp, [esi + 0xfa0]
mov dword [esp + 0x30], eax
push 0xffffffffffffffff
push 0x96
push 0
push ecx
push 0
mov ecx, ebp
call sub.MFC42u.DLL_CListCtrl::InsertColumn
mov edx, dword [0x41a8f4]
push 0xffffffffffffffff
push 0x12c
push 0
push edx
push 1
mov ecx, ebp
call sub.MFC42u.DLL_CListCtrl::InsertColumn
mov eax, dword [esi + 0xfc0]
mov ebp, dword [sym.imp.USER32.dll_SendMessageW]
push 0xa3
push 0
push 0x1036
push eax
call ebp
push 0
push 0
push edi
call dword [sym.imp.MSVCRT.dll_fseek]
push edi
push 4
push 1
push ebx
call dword [sym.imp.MSVCRT.dll_fread]
add esp, 0x1c
mov ecx, esi
push ebx
call fcn.00406120
push edi
mov dword [esi + 0x1a64], eax
call dword [sym.imp.MSVCRT.dll_ftell]
mov ebx, dword [sym.imp.MSVCRT.dll_fseek]
push 0
push 0
push edi
mov dword [esp + 0x34], eax
call ebx
mov eax, dword [esi + 0x1a64]
push 0
lea ecx, [eax + eax*2]
lea edx, [ecx*4 + 4]
push edx
push edi
call ebx
xor eax, eax
push edi
push 6
lea ecx, [esp + 0x68]
mov dword [esp + 0x69], eax
push 1
push ecx
mov byte [esp + 0x70], 0
mov word [esp + 0x75], ax
call dword [sym.imp.MSVCRT.dll_fread]
add esp, 0x2c
mov ecx, str.PKGEXT
lea eax, [esp + 0x44]
mov bl, byte [eax]
mov dl, bl
cmp bl, byte [ecx]
jne 0x40cc2d
test dl, dl
je 0x40cc29
mov bl, byte [eax + 1]
mov dl, bl
cmp bl, byte [ecx + 1]
jne 0x40cc2d
add eax, 2
add ecx, 2
test dl, dl
jne 0x40cc09
xor eax, eax
jmp 0x40cc32
sbb eax, eax
sbb eax, 0xffffffff
xor ecx, ecx
cmp eax, ecx
jne 0x40cc44
mov dword [esi + 0x1880], 1
jmp 0x40cc4a
mov dword [esi + 0x1880], ecx
mov eax, dword [esi + 0x1880]
mov dword [esp + 0x10], ecx
cmp eax, ecx
je 0x40cccb
mov ebx, dword [sym.imp.MSVCRT.dll_fread]
push edi
push 4
lea edx, [esi + 0x1ae4]
push 1
push edx
call ebx
push edi
push 4
lea eax, [esp + 0x58]
push 1
push eax
call ebx
mov ecx, dword [esp + 0x60]
shl ecx, 4
push ecx
call sub.MFC42u.DLL_operatornew
mov edx, dword [esp + 0x64]
push edi
push 0x10
push edx
push eax
mov dword [esp + 0x50], eax
call ebx
mov eax, dword [esp + 0x50]
add esp, 0x34
test eax, eax
je 0x40cca8
push eax
call sub.MFC42u.DLL_operatordelete
add esp, 4
mov eax, dword [esi + 0x1a64]
shl eax, 3
push eax
call sub.MFC42u.DLL_operatornew
mov ecx, dword [esi + 0x1a64]
push edi
push 8
push ecx
push eax
mov dword [esp + 0x24], eax
call ebx
add esp, 0x14
mov edx, dword [esp + 0x24]
push 0
push edx
push edi
call dword [sym.imp.MSVCRT.dll_fseek]
add esp, 0xc
lea ecx, [esp + 0x14]
push 0x41a538
call sub.MFC42u.DLL_CString::operator_2
mov eax, dword [esi + 0x1a64]
xor ebx, ebx
test eax, eax
jbe 0x40cf40
mov eax, dword [esp + 0x10]
mov dword [esp + 0x10], 4
mov dword [esp + 0x18], eax
lea eax, [esi + 0x46dc]
mov dword [esp + 0x2c], eax
mov ecx, dword [esp + 0x10]
push 0
push ecx
push edi
call dword [sym.imp.MSVCRT.dll_fseek]
mov edx, dword [esp + 0x2c]
push edi
push 0xc
push 1
push edx
call dword [sym.imp.MSVCRT.dll_fread]
mov ecx, dword [esp + 0x3c]
lea eax, [esi + 0x1d00]
add esp, 0x1c
mov edx, dword [ecx]
mov dword [eax], edx
mov edx, dword [ecx + 4]
mov dword [eax + 4], edx
mov ecx, dword [ecx + 8]
mov dword [eax + 8], ecx
xor eax, eax
mov edx, dword [esp + 0x20]
inc eax
cmp eax, 4
mov cl, byte [edx + eax + 7]
mov edx, dword [esp + 0x2c]
mov byte [edx + eax - 1], cl
jb 0x40cd51
mov eax, dword [esi + 0x1d04]
push 0
push eax
push edi
call dword [sym.imp.MSVCRT.dll_fseek]
mov eax, dword [esi + 0x1d08]
mov ecx, dword [esi + 0x1d04]
sub eax, ecx
push edi
mov edi, dword [esp + 0x30]
push eax
push 1
push edi
mov dword [esp + 0x38], eax
call dword [sym.imp.MSVCRT.dll_fread]
mov ecx, dword [esp + 0x38]
add esp, 0x1c
test ecx, ecx
jbe 0x40cdb2
mov eax, dword [esp + 0x30]
sub edi, eax
mov dl, byte [edi + eax]
mov byte [eax], dl
inc eax
dec ecx
jne 0x40cda9
push ebx
lea eax, [esp + 0x2c]
push 0x41a530
push eax
call sub.MFC42u.DLL_CString::Format
mov ecx, dword [esp + 0x34]
add esp, 0xc
push 0
push 0
push 0x23
push 0x23
push ecx
push ebx
push 9
lea ecx, [esi + 0xfa0]
call sub.MFC42u.DLL_CListCtrl::InsertItem
mov eax, dword [esi + 0x1880]
lea edx, [esp + 0x4c]
test eax, eax
push 0xa
push edx
je 0x40cdfa
mov eax, dword [esp + 0x20]
mov ecx, dword [eax]
push ecx
jmp 0x40cdfb
push ebx
call dword [sym.imp.MSVCRT.dll__itoa]
add esp, 0xc
lea ecx, [esp + 0x24]
push eax
call sub.MFC42u.DLL_CString::CString_1
lea eax, [esp + 0x24]
lea ecx, [esp + 0x14]
push eax
mov byte [esp + 0x274], 2
call sub.MFC42u.DLL_CString::operator_1
lea ecx, [esp + 0x24]
mov byte [esp + 0x270], 1
call sub.MFC42u.DLL_CString::CString
lea ecx, [esp + 0x14]
push ecx
lea ecx, [esp + 0x3c]
call sub.MFC42u.DLL_CString::CString_2
push 0x40
lea ecx, [esp + 0x3c]
mov byte [esp + 0x274], 3
call sub.MFC42u.DLL_CString::GetBuffer
push 0xffffffffffffffff
lea ecx, [esp + 0x3c]
mov dword [esp + 0x38], eax
call sub.MFC42u.DLL_CString::ReleaseBuffer
mov ecx, 0x81
xor eax, eax
lea edi, [esp + 0x62]
mov word [esp + 0x60], 0
rep stosd dword es:[edi], eax
lea edx, [esp + 0x60]
push 0x208
stosw word es:[edi], ax
mov eax, dword [esp + 0x34]
push edx
push 0xffffffffffffffff
push eax
push 0
push 0
call dword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
mov ecx, dword [esp + 0x34]
lea edi, [esi + 0xfa0]
push ecx
push 0
push ebx
mov ecx, edi
call sub.MFC42u.DLL_CListCtrl::SetItemText
lea edx, [esp + 0x60]
mov ecx, edi
push edx
push 1
push ebx
call sub.MFC42u.DLL_CListCtrl::SetItemText
mov eax, dword [esp + 0x18]
mov ecx, edi
mov eax, dword [eax]
push eax
push 0
push 0
push 0
push 0
push 4
push 0
push ebx
call sub.MFC42u.DLL_CListCtrl::SetItem
push 0x41a538
lea ecx, [esp + 0x18]
call sub.MFC42u.DLL_CString::operator_2
mov ecx, dword [esp + 0x1c]
mov edi, dword [esp + 0x30]
mov edx, ecx
xor eax, eax
shr ecx, 2
rep stosd dword es:[edi], eax
mov ecx, edx
mov byte [esp + 0x270], 1
and ecx, 3
rep stosb byte es:[edi], al
lea ecx, [esp + 0x38]
call sub.MFC42u.DLL_CString::CString
mov edi, dword [esp + 0x2c]
mov edx, dword [esp + 0x10]
mov ecx, dword [esp + 0x18]
mov eax, dword [esi + 0x1a64]
inc ebx
add edi, 4
add edx, 0xc
add ecx, 8
mov dword [esp + 0x2c], edi
mov edi, dword [esp + 0x3c]
cmp ebx, eax
mov dword [esp + 0x10], edx
mov dword [esp + 0x18], ecx
jb 0x40cd14
mov ebx, dword [sym.imp.MSVCRT.dll_free]
push 0
call ebx
push 0
call ebx
push 0
call ebx
push 0
call ebx
push edi
call dword [sym.imp.MSVCRT.dll_fclose]
mov eax, dword [esi + 0x1a64]
add esp, 0x14
cmp eax, 1
pop ebx
jne 0x40d03c
mov eax, dword [esi + 0xfc0]
push 0
push 0
push 0x103c
push eax
call ebp
push 0
lea ecx, [esi + 0xfa0]
call sub.MFC42u.DLL_CListCtrl::GetItemData
mov dword [esi + 0x1dc4], eax
lea eax, [esi + 0x46dc]
push eax
mov ecx, esi
call fcn.00406120
push eax
mov ecx, esi
call fcn.00407640
cmp dword [esi + 0x1a9c], 7
jne 0x40cfbc
push 1
call dword [sym.imp.MSVCRT.dll_exit]
mov ecx, esi
call fcn.00409560
mov eax, dword [esi + 0x1a9c]
test eax, eax
je 0x40cfd5
push 1
call dword [sym.imp.MSVCRT.dll_exit]
mov eax, dword [esi + 0x4ba4]
lea ecx, [esi + 0xe28]
push eax
call sub.MFC42u.DLL_CWnd::SetWindowTextW
mov eax, dword [esi + 0x4ba8]
cmp eax, 1
jne 0x40cffb
mov ecx, dword [0x41a904]
push ecx
jmp 0x40d01b
cmp eax, 2
jne 0x40d009
mov edx, dword [0x41a908]
push edx
jmp 0x40d01b
cmp eax, 3
jne 0x40d016
mov eax, dword [0x41a90c]
push eax
jmp 0x40d01b
push str.NULL
lea ecx, [esi + 0xee4]
call sub.MFC42u.DLL_CWnd::SetWindowTextW
mov ecx, esi
call fcn.0040d2e0
push 1
lea ecx, [esi + 0xfe0]
call sub.MFC42u.DLL_CWnd::EnableWindow
jmp 0x40d064
mov eax, dword [esi + 0x4ba4]
lea ecx, [esi + 0xe28]
push eax
call sub.MFC42u.DLL_CWnd::SetWindowTextW
lea ecx, [esp + 0x30]
mov dword [esp + 0x30], 0
push ecx
push 0
mov ecx, esi
call fcn.00404b90
mov edx, dword [esi + 0xbb4]
push str.COM1
push 0
push 0x143
push edx
call ebp
mov eax, dword [esi + 0xbb4]
push str.COM2
push 0
push 0x143
push eax
call ebp
mov ecx, dword [esi + 0xbb4]
push str.COM3
push 0
push 0x143
push ecx
call ebp
mov edx, dword [esi + 0xbb4]
push str.COM4
push 0
push 0x143
push edx
call ebp
mov eax, dword [esi + 0xbb4]
push str.COM5
push 0
push 0x143
push eax
call ebp
mov ecx, dword [esi + 0xbb4]
push str.COM6
push 0
push 0x143
push ecx
call ebp
mov edx, dword [esi + 0xbb4]
push str.COM7
push 0
push 0x143
push edx
call ebp
mov eax, dword [esi + 0xbb4]
push str.COM8
push 0
push 0x143
push eax
call ebp
mov ecx, dword [esi + 0xbb4]
push str.COM9
push 0
push 0x143
push ecx
call ebp
mov edx, dword [esi + 0x920]
push str.COM1
push 0
push 0x143
push edx
call ebp
mov eax, dword [esi + 0x920]
push str.COM2
push 0
push 0x143
push eax
call ebp
mov ecx, dword [esi + 0x920]
push str.COM3
push 0
push 0x143
push ecx
call ebp
mov edx, dword [esi + 0x920]
push str.COM4
push 0
push 0x143
push edx
call ebp
push str.COM5
push 0
push 0x143
mov eax, dword [esi + 0x920]
push eax
call ebp
mov ecx, dword [esi + 0x920]
push str.COM6
push 0
push 0x143
push ecx
call ebp
mov edx, dword [esi + 0x920]
push str.COM7
push 0
push 0x143
push edx
call ebp
mov eax, dword [esi + 0x920]
push str.COM8
push 0
push 0x143
push eax
call ebp
mov ecx, dword [esi + 0x920]
push str.COM9
push 0
push 0x143
push ecx
call ebp
mov edx, dword [esi + 0x68c]
push str.COM1
push 0
push 0x143
push edx
call ebp
mov eax, dword [esi + 0x68c]
push str.COM2
push 0
push 0x143
push eax
call ebp
mov ecx, dword [esi + 0x68c]
push str.COM3
push 0
push 0x143
push ecx
call ebp
mov edx, dword [esi + 0x68c]
push str.COM4
push 0
push 0x143
push edx
call ebp
mov eax, dword [esi + 0x68c]
push str.COM5
push 0
push 0x143
push eax
call ebp
mov ecx, dword [esi + 0x68c]
push str.COM6
push 0
push 0x143
push ecx
call ebp
mov edx, dword [esi + 0x68c]
push str.COM7
push 0
push 0x143
push edx
call ebp
mov eax, dword [esi + 0x68c]
push str.COM8
push 0
push 0x143
push eax
call ebp
mov ecx, dword [esi + 0x68c]
push str.COM9
push 0
push 0x143
push ecx
call ebp
lea ecx, [esp + 0x10]
mov byte [esp + 0x26c], 0
call sub.MFC42u.DLL_CString::CString
lea ecx, [esp + 0x24]
mov dword [esp + 0x26c], 0xffffffff
call sub.MFC42u.DLL_CString::CString
mov ecx, dword [esp + 0x264]
pop edi
pop esi
pop ebp
mov dword fs:[0], ecx
add esp, 0x264
ret