Function at 0x40664f
Capabilities:
Create process on windows
Delete file
Extract resource via kernel32 functions
Get common file path
Write and execute a file
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x2cc
push ebx
push esi
push edi
mov esi, ecx
push 0x10
xor ebx, ebx
pop ecx
xor eax, eax
lea edi, [ebp - 0x70]
mov dword [ebp - 0x74], ebx
rep stosd dword es:[edi], eax
lea edi, [ebp - 0x24]
mov dword [ebp - 0x28], ebx
stosd dword es:[edi], eax
stosd dword es:[edi], eax
stosd dword es:[edi], eax
mov edi, dword [ebp + 0xc]
mov dword [ebp - 0x10], 1
push edi
push dword [ebp + 8]
push str.COMMS:_Run_executable_for_module__s._s
push dword [esi + 0x2b0]
call fcn.0041e63d
add esp, 0x10
push edi
push dword [ebp + 8]
push dword [0x454180]
call dword [sym.imp.KERNEL32.dll_FindResourceA]
cmp eax, ebx
mov dword [ebp - 0xc], eax
jne 0x4066d4
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push edi
push dword [ebp + 8]
push str.COMMS:_Cant_find_resource_for_module__s._s__error__u
push dword [esi + 0x2b0]
call fcn.0041e63d
add esp, 0x14
mov ax, 1
jmp 0x406945
push eax
push dword [0x454180]
call dword [sym.imp.KERNEL32.dll_LoadResource]
cmp eax, ebx
mov dword [ebp - 4], eax
je 0x4066f6
push eax
call dword [sym.imp.KERNEL32.dll_LockResource]
cmp eax, ebx
mov dword [ebp - 8], eax
jne 0x406719
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push edi
push dword [ebp + 8]
push str.COMMS:_Failed_to_load_resource_for_module__s._s__error__u
push dword [esi + 0x2b0]
call fcn.0041e63d
add esp, 0x14
jmp 0x406933
lea eax, [ebp - 0x178]
push eax
push 0x104
call dword [sym.imp.KERNEL32.dll_GetTempPathA]
test eax, eax
jne 0x40674e
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.COMMS:_Failed_to_read_temporary_directory__error__u
push dword [esi + 0x2b0]
call fcn.0041e63d
add esp, 0xc
jmp 0x406933
lea eax, [ebp - 0x178]
push eax
push ebx
lea eax, [ebp - 0x178]
push 0x43a76c
push eax
call dword [sym.imp.KERNEL32.dll_GetTempFileNameA]
test eax, eax
jne 0x40677a
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.COMMS:_Failed_to_get_temporary_filename__error__u
jmp 0x40673b
push ebx
push 0x8000000
push 2
push ebx
push ebx
lea eax, [ebp - 0x178]
push 0x40000000
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov edi, eax
cmp edi, 0xffffffff
jne 0x4067b4
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push dword [ebp + 0xc]
push dword [ebp + 8]
push str.COMMS:_Failed_to_create_temporary_file_for_module__s._s__error__u
jmp 0x406706
push dword [ebp - 0xc]
push dword [0x454180]
call dword [sym.imp.KERNEL32.dll_SizeofResource]
lea ecx, [ebp - 0x18]
push ebx
push ecx
push eax
push dword [ebp - 8]
mov dword [ebp - 0xc], eax
push edi
call dword [sym.imp.KERNEL32.dll_WriteFile]
push edi
mov edi, dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [ebp - 8], eax
call edi
cmp dword [ebp - 8], ebx
je 0x40691a
mov eax, dword [ebp - 0xc]
cmp dword [ebp - 0x18], eax
jne 0x40691a
lea eax, [ebp - 0x178]
mov dword [ebp - 0x74], 0x44
push eax
lea eax, [ebp - 0x2cc]
push eax
call fcn.0042b1f0
lea eax, [ebp - 0x2cc]
push 0x43a6f0
push eax
call fcn.0042b200
push dword [ebp + 0x10]
lea eax, [ebp - 0x2cc]
push eax
call fcn.0042b200
add esp, 0x18
lea eax, [ebp - 0x2cc]
push eax
push str.COMMS:_Create_process___s_
push dword [esi + 0x2b0]
call fcn.0041e63d
add esp, 0xc
lea eax, [ebp - 0x28]
push eax
lea eax, [ebp - 0x74]
push eax
push ebx
push ebx
push ebx
push ebx
push ebx
lea eax, [ebp - 0x2cc]
push ebx
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_CreateProcessA]
test eax, eax
je 0x4068eb
mov eax, dword [ebp - 0x28]
push 0x2710
mov dword [ebp - 0x30], eax
mov eax, dword [esi + 0x19c]
mov dword [ebp - 0x2c], eax
lea eax, [ebp - 0x30]
push ebx
push eax
push 2
call dword [sym.imp.KERNEL32.dll_WaitForMultipleObjects]
test eax, eax
jne 0x4068cd
lea eax, [ebp - 0x14]
push eax
push dword [ebp - 4]
call dword [sym.imp.KERNEL32.dll_GetExitCodeProcess]
test eax, eax
je 0x4068ae
push dword [ebp - 0x14]
push str.COMMS:_Process_has_finished__exit_code_0x_02X
jmp 0x4068ba
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.COMMS:_Process_has_finished_but_failed_to_get_exit_code__error__u
push dword [esi + 0x2b0]
call fcn.0041e63d
add esp, 0xc
mov dword [ebp - 0x10], ebx
jmp 0x4068df
push str.COMMS:_Abandoned_waiting_for_process
push dword [esi + 0x2b0]
call fcn.0041e63d
pop ecx
pop ecx
push dword [ebp - 0x28]
call edi
push dword [ebp - 0x24]
call edi
jmp 0x40690b
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push dword [ebp + 0xc]
push dword [ebp + 8]
push str.COMMS:_Failed_to_create_process_for_module__s._s__error__u
push dword [esi + 0x2b0]
call fcn.0041e63d
add esp, 0x14
lea eax, [ebp - 0x178]
push eax
call dword [sym.imp.KERNEL32.dll_DeleteFileA]
jmp 0x406933
push dword [ebp + 0xc]
push dword [ebp + 8]
push str.COMMS:_Failed_to_write_to_temporary_file_for_module__s._s
push dword [esi + 0x2b0]
call fcn.0041e63d
add esp, 0x10
cmp dword [ebp - 4], ebx
je 0x406941
push dword [ebp - 4]
call dword [sym.imp.KERNEL32.dll_FreeResource]
mov ax, word [ebp - 0x10]
pop edi
pop esi
pop ebx
leave
ret 0xc