Function at 0x402158
Capabilities:
Accept command line arguments
Create a process with modified i/o handles and window
Create pipe
Create process on windows
Create two anonymous pipes
Delete file
Extract resource via kernel32 functions
Get common file path
Write and execute a file
Write file on windows
Write pipe

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x4c0
push ebx
push esi
push edi
call dword [sym.imp.KERNEL32.dll_GetCommandLineA]
mov esi, eax
mov bl, 0x20
cmp byte [esi], 0x22
jne 0x402176
add bl, 2
push esi
call sub.MSVCRT.dll_strlen
pop ecx
push 1
pop edi
cmp eax, edi
mov ecx, edi
jle 0x402190
cmp byte [ecx + esi], bl
je 0x402190
inc ecx
cmp ecx, eax
jl 0x402186
xor ebx, ebx
lea eax, [esi + ecx + 1]
push ebx
mov dword [ebp - 0x10], eax
call dword [sym.imp.KERNEL32.dll_GetModuleHandleA]
mov dword [ebp - 0x20], edi
mov edi, dword [sym.imp.KERNEL32.dll_GetStdHandle]
push 0xfffffffffffffff5
mov dword [ebp - 0x28], 0xc
mov dword [ebp - 0x24], ebx
call edi
mov dword [0x401010], eax
lea eax, [ebp - 0x28]
push ebx
push eax
push section..bss
push 0x401004
call dword [sym.imp.KERNEL32.dll_CreatePipe]
test eax, eax
je 0x402629
push dword [section..bss]
push 0xfffffffffffffff5
call dword [sym.imp.KERNEL32.dll_SetStdHandle]
test eax, eax
je 0x402629
mov esi, dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
push 2
push ebx
push ebx
push 0x40101c
call esi
push eax
push dword [0x401004]
call esi
push eax
call dword [sym.imp.KERNEL32.dll_DuplicateHandle]
test eax, eax
je 0x402629
push dword [0x401004]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push 0xfffffffffffffff6
call edi
push 0xfffffffffffffff4
mov dword [0x40100c], eax
call edi
mov dword [0x401014], eax
lea eax, [ebp - 0x28]
push ebx
push eax
push 0x401018
push 0x401024
call dword [sym.imp.KERNEL32.dll_CreatePipe]
test eax, eax
je 0x402629
push dword [0x401024]
push 0xfffffffffffffff6
call dword [sym.imp.KERNEL32.dll_SetStdHandle]
test eax, eax
je 0x402629
push 2
push ebx
push ebx
push 0x401020
call esi
push eax
push dword [0x401018]
call esi
push eax
call dword [sym.imp.KERNEL32.dll_DuplicateHandle]
test eax, eax
je 0x402629
push dword [0x401018]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x4022bc
lea eax, [ebp - 0x4c0]
mov esi, 0x104
push eax
push esi
call dword [sym.imp.KERNEL32.dll_GetTempPathA]
push 0x79
push 2
push ebx
call dword [sym.imp.KERNEL32.dll_FindResourceA]
cmp eax, ebx
je 0x402629
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_LoadResource]
cmp eax, ebx
je 0x402629
push eax
call dword [sym.imp.KERNEL32.dll_LockResource]
cmp eax, ebx
mov dword [ebp - 0x14], eax
je 0x402629
mov edi, dword [sym.imp.USER32.dll_LoadStringA]
lea eax, [ebp - 0x90]
push 0x14
push eax
push 1
push ebx
call edi
lea eax, [ebp - 0x90]
push eax
call dword [sym.imp.SHLWAPI.dll_StrToIntA]
push eax
mov dword [ebp - 0x18], eax
call sub.MSVCRT.dll_malloc
push dword [ebp - 0x18]
mov dword [ebp - 4], eax
push eax
push dword [ebp - 0x14]
call fcn.00402630
add esp, 0x10
lea eax, [ebp - 0xc]
push 5
push eax
push 0x11
push ebx
call edi
lea eax, [ebp - 0xc]
push eax
call sub.MSVCRT.dll__strlwr
pop ecx
lea eax, [ebp - 0xc]
push eax
call dword [sym.imp.KERNEL32.dll_GetTickCount]
push eax
lea eax, [ebp - 0xb0]
push 0x4020c8
push eax
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0x10
lea eax, [ebp - 0x3bc]
push esi
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
lea eax, [ebp - 0x3bc]
push eax
call sub.MSVCRT.dll_strlen
pop ecx
cmp eax, ebx
jle 0x4023a9
cmp byte [ebp + eax - 0x3bc], 0x5c
je 0x4023a2
dec eax
jmp 0x402391
mov byte [ebp + eax - 0x3bc], bl
lea eax, [ebp - 0x4c0]
push eax
lea eax, [ebp - 0x2b8]
push eax
call sub.MSVCRT.dll_strcpy
lea eax, [ebp - 0x4c0]
push eax
call sub.MSVCRT.dll_strlen
add esp, 0xc
cmp byte [ebp + eax - 0x4c1], 0x5c
je 0x4023e8
lea eax, [ebp - 0x2b8]
push 0x4020c4
push eax
call sub.MSVCRT.dll_strcat
pop ecx
pop ecx
lea eax, [ebp - 0xb0]
push eax
lea eax, [ebp - 0x2b8]
push eax
call sub.MSVCRT.dll_strcat
pop ecx
lea eax, [ebp - 0x2b8]
pop ecx
push ebx
push 0x80
push 2
push ebx
push ebx
push 0x40000000
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
cmp eax, 0xffffffff
mov dword [ebp - 0x14], eax
push ebx
je 0x40242f
lea ecx, [ebp - 4]
push ecx
push dword [ebp - 0x18]
push dword [ebp - 4]
push eax
jmp 0x402447
lea eax, [ebp - 4]
mov esi, 0x4020a8
push eax
push esi
call sub.MSVCRT.dll_strlen
pop ecx
push eax
push esi
push dword [0x401010]
call dword [sym.imp.KERNEL32.dll_WriteFile]
push dword [ebp - 0x14]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
lea eax, [ebp - 0x1c]
push 3
push eax
push 0x21
push ebx
call edi
lea eax, [ebp - 0x1c]
push eax
call sub.MSVCRT.dll__strlwr
push 0x10
xor eax, eax
pop ecx
lea edi, [ebp - 0x78]
mov dword [ebp - 0x7c], 0x44
rep stosd dword es:[edi], eax
mov eax, dword [0x401010]
mov dword [esp], 0x4020a0
mov dword [ebp - 0x40], eax
mov eax, dword [0x40100c]
mov dword [ebp - 0x44], eax
mov eax, dword [0x401014]
mov dword [ebp - 0x3c], eax
lea eax, [ebp - 0xc]
push eax
mov dword [ebp - 0x50], 0x101
mov word [ebp - 0x4c], 5
call sub.MSVCRT.dll_strcmp
mov edi, dword [sym.imp.KERNEL32.dll_CreateProcessA]
pop ecx
test eax, eax
pop ecx
mov esi, 0x40209c
jne 0x402512
lea eax, [ebp - 0x2b8]
push eax
lea eax, [ebp - 0x1b4]
push eax
call sub.MSVCRT.dll_strcpy
lea eax, [ebp - 0x1b4]
push esi
push eax
call sub.MSVCRT.dll_strcat
push dword [ebp - 0x10]
lea eax, [ebp - 0x1b4]
push eax
call sub.MSVCRT.dll_strcat
add esp, 0x18
lea eax, [ebp - 0x38]
push eax
lea eax, [ebp - 0x7c]
push eax
lea eax, [ebp - 0x3bc]
push eax
push ebx
push ebx
push 1
push ebx
lea eax, [ebp - 0x1b4]
push ebx
push eax
push ebx
call edi
lea eax, [ebp - 0xc]
push 0x402094
push eax
call sub.MSVCRT.dll_strcmp
pop ecx
test eax, eax
pop ecx
jne 0x402588
lea eax, [ebp - 0x1b4]
push 0x402088
push eax
call sub.MSVCRT.dll_strcpy
lea eax, [ebp - 0x2b8]
push eax
lea eax, [ebp - 0x1b4]
push eax
call sub.MSVCRT.dll_strcat
lea eax, [ebp - 0x1b4]
push esi
push eax
call sub.MSVCRT.dll_strcat
push dword [ebp - 0x10]
lea eax, [ebp - 0x1b4]
push eax
call sub.MSVCRT.dll_strcat
add esp, 0x20
lea eax, [ebp - 0x38]
push eax
lea eax, [ebp - 0x7c]
push eax
lea eax, [ebp - 0x3bc]
push eax
push ebx
push ebx
push 1
push ebx
lea eax, [ebp - 0x1b4]
push ebx
push eax
push ebx
call edi
lea eax, [ebp - 0xc]
push 0x402084
push eax
call sub.MSVCRT.dll_strcmp
pop ecx
test eax, eax
pop ecx
jne 0x4025fe
lea eax, [ebp - 0x1b4]
push 0x402088
push eax
call sub.MSVCRT.dll_strcpy
lea eax, [ebp - 0x2b8]
push eax
lea eax, [ebp - 0x1b4]
push eax
call sub.MSVCRT.dll_strcat
lea eax, [ebp - 0x1b4]
push esi
push eax
call sub.MSVCRT.dll_strcat
push dword [ebp - 0x10]
lea eax, [ebp - 0x1b4]
push eax
call sub.MSVCRT.dll_strcat
add esp, 0x20
lea eax, [ebp - 0x38]
push eax
lea eax, [ebp - 0x7c]
push eax
lea eax, [ebp - 0x3bc]
push eax
push ebx
push ebx
push 1
push ebx
lea eax, [ebp - 0x1b4]
push ebx
push eax
push ebx
call edi
mov eax, dword [0x40100c]
cmp eax, 0xffffffff
mov dword [0x401008], eax
je 0x402629
push 0xffffffffffffffff
push dword [ebp - 0x38]
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
test eax, eax
jne 0x402629
lea eax, [ebp - 0x2b8]
push eax
call dword [sym.imp.KERNEL32.dll_DeleteFileA]
pop edi
pop esi
xor eax, eax
pop ebx
leave
ret