Function at 0x40aff0
Capabilities:
Delete file
Extract resource via kernel32 functions
Get common file path
Link many functions at runtime
Write file on windows

Disassembly:
push 0xffffffffffffffff
push 0x418348
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x130
push ebx
push ebp
push esi
push edi
mov ebp, ecx
call fcn.0040b590
push 0x41ef68
lea ecx, [esp + 0x14]
call sub.MFC42.DLL_CString::CString_2
push 0x41e244
lea ecx, [esp + 0x20]
mov dword [esp + 0x14c], 0
call sub.MFC42.DLL_CString::CString_2
lea ecx, [esp + 0x24]
mov byte [esp + 0x148], 1
call fcn.004171f2
lea eax, [esp + 0x10]
mov byte [esp + 0x148], 2
push eax
call fcn.004029c0
add esp, 4
lea ecx, [esp + 0x1c]
lea edx, [esp + 0x10]
lea eax, [esp + 0x14]
push ecx
push edx
push eax
call sub.MFC42.DLL_operator_1
mov eax, dword [eax]
push 0
push eax
lea ecx, [esp + 0x2c]
mov byte [esp + 0x150], 3
call sub.MFC42.DLL_CFileFind::FindFile
test eax, eax
lea ecx, [esp + 0x14]
mov byte [esp + 0x148], 2
sete bl
call sub.MFC42.DLL_CString::CString
test bl, bl
je 0x40b2d4
lea ecx, [esp + 0x40]
push ecx
push 0x100
call dword [sym.imp.KERNEL32.dll_GetTempPathA]
test eax, eax
je 0x40b2a9
lea edi, [esp + 0x40]
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
dec ecx
cmp byte [esp + ecx + 0x3f], 0x5c
jne 0x40b0e9
lea edx, [esp + 0x40]
lea eax, [esp + 0x10]
push edx
push str._sUForm_
push eax
jmp 0x40b0f8
lea ecx, [esp + 0x40]
lea edx, [esp + 0x10]
push ecx
push 0x41e940
push edx
call sub.MFC42.DLL_CString::Format_1
mov eax, dword [esp + 0x1c]
add esp, 0xc
push eax
call fcn.00401730
add esp, 4
lea ecx, [esp + 0x10]
lea edx, [esp + 0x14]
mov byte [esp + 0x1b], 0
push str.replace.opt
push ecx
push edx
call sub.MFC42.DLL_operator_3
mov eax, dword [eax]
push 0
push eax
lea ecx, [esp + 0x2c]
mov byte [esp + 0x150], 4
call sub.MFC42.DLL_CFileFind::FindFile
test eax, eax
lea ecx, [esp + 0x14]
mov byte [esp + 0x148], 2
setne bl
call sub.MFC42.DLL_CString::CString
test bl, bl
je 0x40b15d
mov byte [esp + 0x1b], 1
jmp 0x40b1b6
mov ecx, dword [esp + 0x150]
lea eax, [esp + 0x10]
push eax
call sub.MFC42.DLL_CString::operator_1
lea ecx, [esp + 0x1c]
lea edx, [esp + 0x10]
push ecx
lea eax, [esp + 0x18]
push edx
push eax
call sub.MFC42.DLL_operator_1
mov eax, dword [eax]
push 0
push eax
lea ecx, [esp + 0x2c]
mov byte [esp + 0x150], 5
call sub.MFC42.DLL_CFileFind::FindFile
test eax, eax
lea ecx, [esp + 0x14]
mov byte [esp + 0x148], 2
sete bl
call sub.MFC42.DLL_CString::CString
test bl, bl
je 0x40b2d4
call sub.MFC42.DLL_AfxGetModuleState
mov esi, dword [eax + 8]
push 0x41e938
push 0x85
push esi
call dword [sym.imp.KERNEL32.dll_FindResourceA]
mov edi, eax
test edi, edi
je 0x40b293
push edi
push esi
call dword [sym.imp.KERNEL32.dll_SizeofResource]
push edi
push esi
mov ebx, eax
call dword [sym.imp.KERNEL32.dll_LoadResource]
mov edi, eax
test edi, edi
je 0x40b225
lea ecx, [esp + 0x1c]
lea edx, [esp + 0x10]
push ecx
lea eax, [esp + 0x18]
push edx
push eax
call sub.MFC42.DLL_operator_1
mov eax, dword [eax]
push 0x41e108
push eax
call dword [sym.imp.MSVCRT.dll_fopen]
add esp, 8
lea ecx, [esp + 0x14]
mov esi, eax
call sub.MFC42.DLL_CString::CString
test esi, esi
jne 0x40b24e
lea ecx, [esp + 0x40]
push 0x100
push ecx
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryA]
test eax, eax
je 0x40b2d4
lea edx, [esp + 0x40]
lea eax, [esp + 0x10]
push edx
push 0x41e934
push eax
jmp 0x40b2cc
push esi
push ebx
push 1
push edi
call dword [sym.imp.MSVCRT.dll_fwrite]
push esi
call dword [sym.imp.MSVCRT.dll_fclose]
mov al, byte [esp + 0x2f]
add esp, 0x14
test al, al
je 0x40b2d4
lea ecx, [esp + 0x10]
push str.replace.opt
lea edx, [esp + 0x18]
push ecx
push edx
call sub.MFC42.DLL_operator_3
mov eax, dword [eax]
push eax
call dword [sym.imp.KERNEL32.dll_DeleteFileA]
lea ecx, [esp + 0x14]
call sub.MFC42.DLL_CString::CString
jmp 0x40b2d4
lea eax, [esp + 0x40]
push 0x100
push eax
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryA]
test eax, eax
je 0x40b2d4
jmp 0x40b2bd
lea eax, [esp + 0x40]
push 0x100
push eax
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryA]
test eax, eax
je 0x40b2d4
lea ecx, [esp + 0x40]
lea edx, [esp + 0x10]
push ecx
push 0x41e934
push edx
call sub.MFC42.DLL_CString::Format_1
add esp, 0xc
lea ecx, [esp + 0x24]
call sub.MFC42.DLL_CFileFind::Close
lea eax, [esp + 0x1c]
lea ecx, [esp + 0x10]
push eax
lea edx, [esp + 0x18]
push ecx
push edx
call sub.MFC42.DLL_operator_1
mov eax, dword [eax]
push eax
call dword [sym.imp.KERNEL32.dll_LoadLibraryA]
lea ecx, [esp + 0x14]
mov dword [0x41f04c], eax
call sub.MFC42.DLL_CString::CString
mov eax, dword [0x41f04c]
test eax, eax
jne 0x40b38d
lea ecx, [esp + 0x14]
call sub.MFC42.DLL_CString::CString_1
lea eax, [esp + 0x1c]
lea ecx, [esp + 0x10]
push eax
lea edx, [esp + 0x24]
mov bl, 6
push ecx
push edx
mov byte [esp + 0x154], bl
call sub.MFC42.DLL_operator_1
mov eax, dword [eax]
lea ecx, [esp + 0x14]
push eax
push 0x41e8d8
push ecx
mov byte [esp + 0x154], 7
call sub.MFC42.DLL_CString::Format_1
add esp, 0xc
lea ecx, [esp + 0x20]
mov byte [esp + 0x148], bl
call sub.MFC42.DLL_CString::CString
mov edx, dword [esp + 0x14]
push 0x40
push 0x41e10c
push edx
mov ecx, ebp
call sub.MFC42.DLL_CWnd::MessageBoxA
lea ecx, [esp + 0x14]
mov byte [esp + 0x148], 2
call sub.MFC42.DLL_CString::CString
jmp 0x40b53a
mov esi, dword [sym.imp.KERNEL32.dll_GetProcAddress]
push 0x41e8c8
push eax
call esi
mov dword [0x41f048], eax
mov eax, dword [0x41f04c]
push 0x41e8bc
push eax
call esi
mov ecx, dword [0x41f04c]
push 0x41e8ac
push ecx
mov dword [0x41f044], eax
call esi
mov edx, dword [0x41f04c]
push 0x41e89c
push edx
mov dword [0x41f040], eax
call esi
mov dword [0x41f03c], eax
mov eax, dword [0x41f04c]
push 0x41e88c
push eax
call esi
mov ecx, dword [0x41f04c]
push 0x41e880
push ecx
mov dword [0x41f038], eax
call esi
mov edx, dword [0x41f04c]
push 0x41e86c
push edx
mov dword [0x41f034], eax
call esi
mov dword [0x41f030], eax
mov eax, dword [0x41f04c]
push 0x41e85c
push eax
call esi
mov ecx, dword [0x41f04c]
push 0x41e850
push ecx
mov dword [0x41f02c], eax
call esi
mov edx, dword [0x41f04c]
push 0x41e844
push edx
mov dword [0x41f028], eax
call esi
mov dword [0x41f024], eax
mov eax, dword [0x41f04c]
push 0x41e83c
push eax
call esi
mov ecx, dword [0x41f04c]
push 0x41e834
push ecx
mov dword [0x41f020], eax
call esi
mov edx, dword [0x41f04c]
push 0x41e82c
push edx
mov dword [0x41f01c], eax
call esi
mov dword [0x41f018], eax
mov eax, dword [0x41f04c]
push 0x41e824
push eax
call esi
mov ecx, dword [0x41f04c]
push 0x41e814
push ecx
mov dword [0x41f014], eax
call esi
mov edx, dword [0x41f04c]
push 0x41e804
push edx
mov dword [0x41f010], eax
call esi
mov dword [0x41f00c], eax
push 0x41e7fc
mov eax, dword [0x41f04c]
push eax
call esi
mov ecx, dword [0x41f04c]
push 0x41e7f0
push ecx
mov dword [0x41f008], eax
call esi
mov edx, dword [0x41f04c]
push 0x41e7e4
push edx
mov dword [0x41f004], eax
call esi
mov dword [0x41f000], eax
mov eax, dword [0x41f04c]
push 0x41e7d4
push eax
call esi
mov ecx, dword [0x41f04c]
push 0x41e7c8
push ecx
mov dword [0x41effc], eax
call esi
mov edx, dword [0x41f04c]
push 0x41e7b8
push edx
mov dword [0x41eff8], eax
call esi
mov dword [0x41eff4], eax
mov eax, dword [0x41f04c]
push 0x41e7a8
push eax
call esi
mov dword [0x41eff0], eax
lea ecx, [esp + 0x24]
mov byte [esp + 0x148], 1
call sub.MFC42.DLL_CFileFind::CFileFind
lea ecx, [esp + 0x1c]
mov byte [esp + 0x148], 0
call sub.MFC42.DLL_CString::CString
lea ecx, [esp + 0x10]
mov dword [esp + 0x148], 0xffffffff
call sub.MFC42.DLL_CString::CString
mov ecx, dword [esp + 0x140]
pop edi
pop esi
pop ebp
pop ebx
mov dword fs:[0], ecx
add esp, 0x13c
ret 4