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

Disassembly:
sub esp, 0xc
push ebx
push ebp
push esi
push edi
mov esi, ecx
mov byte [esp + 0x12], 0
mov byte [esp + 0x13], 0
call fcn.004051c0
test eax, eax
mov dword [esp + 0x14], eax
jne 0x406162
mov dword [esi + 0x18bc], 7
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xc
ret
lea eax, [esi + 0x49b4]
lea edi, [esi + 0x49b8]
push eax
mov ecx, edi
call sub.MFC42u.DLL_CString::operator_2
push str.evsimulator.exe
mov ecx, edi
call sub.MFC42u.DLL_CString::Find
cmp eax, 0xffffffff
jne 0x40618f
push 1
call dword [sym.imp.MSVCRT.dll_exit]
push str.HMI0.HMI.SIM
push str.evsimulator.exe
mov ecx, edi
call sub.MFC42u.DLL_CString::Replace
mov edi, dword [edi]
push 0x416174
push edi
call dword [sym.imp.MSVCRT.dll__wfopen]
mov ebp, eax
add esp, 8
test ebp, ebp
jne 0x4061c9
mov dword [esi + 0x18bc], 7
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xc
ret
mov ebx, dword [esi + 0x1a48]
push 1
push ebx
call dword [sym.imp.MSVCRT.dll_calloc]
add esp, 8
mov edi, eax
test edi, edi
push 0
jne 0x4061f4
call dword [sym.imp.MSVCRT.dll_free]
add esp, 4
push 1
call dword [sym.imp.MSVCRT.dll_exit]
mov eax, dword [esi + 0x1a4c]
mov ecx, dword [esp + 0x18]
push eax
push ecx
call dword [sym.imp.MSVCRT.dll_fseek]
mov edx, dword [esp + 0x20]
push edx
push ebx
push 1
push edi
call dword [sym.imp.MSVCRT.dll_fread]
add esp, 0x1c
mov dword [esp + 0x18], 0
test ebx, ebx
jle 0x40625a
mov eax, dword [esp + 0x18]
push ebp
push 1
lea edx, [esp + 0x1a]
mov cl, byte [eax + edi]
push 1
push edx
mov byte [esp + 0x22], cl
call dword [sym.imp.MSVCRT.dll_fwrite]
mov al, byte [ebp + 0xc]
add esp, 0x10
test al, 0x20
jne 0x406385
mov eax, dword [esp + 0x18]
inc eax
cmp eax, ebx
mov dword [esp + 0x18], eax
jl 0x406224
push ebp
call dword [sym.imp.MSVCRT.dll_fclose]
push edi
call dword [sym.imp.MSVCRT.dll_free]
add esp, 8
lea edi, [esi + 0x49bc]
lea eax, [esi + 0x49b4]
mov ecx, edi
push eax
call sub.MFC42u.DLL_CString::operator_2
push str.evsimulator.exe
mov ecx, edi
call sub.MFC42u.DLL_CString::Find
cmp eax, 0xffffffff
jne 0x406298
push 1
call dword [sym.imp.MSVCRT.dll_exit]
push str.RECIPE.RCP.SIM
push str.evsimulator.exe
mov ecx, edi
call sub.MFC42u.DLL_CString::Replace
mov edi, dword [edi]
push 0x416174
push edi
call dword [sym.imp.MSVCRT.dll__wfopen]
mov ebp, eax
add esp, 8
test ebp, ebp
jne 0x4062d2
mov dword [esi + 0x18bc], 7
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xc
ret
mov ebx, dword [esi + 0x1a90]
push 1
push ebx
mov dword [esp + 0x20], ebx
call dword [sym.imp.MSVCRT.dll_calloc]
add esp, 8
mov edi, eax
test edi, edi
push 0
jne 0x406301
call dword [sym.imp.MSVCRT.dll_free]
add esp, 4
push 1
call dword [sym.imp.MSVCRT.dll_exit]
mov ecx, dword [esi + 0x1a94]
mov edx, dword [esp + 0x18]
push ecx
push edx
call dword [sym.imp.MSVCRT.dll_fseek]
mov eax, dword [esp + 0x20]
push eax
push ebx
push 1
push edi
call dword [sym.imp.MSVCRT.dll_fread]
mov eax, dword [esp + 0x34]
add esp, 0x1c
xor ebx, ebx
test eax, eax
jle 0x406359
mov cl, byte [ebx + edi]
push ebp
push 1
lea edx, [esp + 0x1a]
push 1
push edx
mov byte [esp + 0x22], cl
call dword [sym.imp.MSVCRT.dll_fwrite]
mov al, byte [ebp + 0xc]
add esp, 0x10
test al, 0x20
jne 0x406385
mov eax, dword [esp + 0x18]
inc ebx
cmp ebx, eax
jl 0x40632f
mov ebx, dword [sym.imp.MSVCRT.dll_fclose]
push ebp
call ebx
push edi
call dword [sym.imp.MSVCRT.dll_free]
mov ecx, dword [esp + 0x1c]
push ecx
call ebx
add esp, 0xc
mov dword [esi + 0x18bc], 0
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xc
ret
mov ebx, dword [sym.imp.MSVCRT.dll_fclose]
push ebp
call ebx
mov eax, dword [esp + 0x18]
push eax
call ebx
push edi
call dword [sym.imp.MSVCRT.dll_free]
add esp, 0xc
mov dword [esi + 0x18bc], 5
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xc
ret