Function at 0x40823a
Capabilities:
Create process on windows
Query environment variable
Spoof parent pid

Disassembly:
push 0x74
mov eax, 0x40fcb6
call fcn.0040f7dc
mov ebx, dword [ebp + 8]
mov ecx, ebx
call fcn.00409b99
test eax, eax
je 0x40825b
xor eax, eax
jmp 0x40849d
and dword [ebp - 0x1c], 0
lea eax, [ebp - 0x1c]
push eax
mov edx, 0x7fffffff
mov ecx, str._SystemRoot_System32ATBroker.exe
call fcn.0040982c
test eax, eax
js 0x408498
mov eax, dword [ebp - 0x1c]
lea edi, [eax + 0x104]
cmp edi, eax
jb 0x408498
and dword [ebp - 0x10], 0
and dword [ebp - 4], 0
lea ecx, [ebp - 0x10]
push edi
call fcn.00408d20
test al, al
jne 0x4082aa
mov ebx, 0x8007000e
jmp 0x408486
push edi
push dword [ebp - 0x10]
push str._SystemRoot_System32ATBroker.exe
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
test eax, eax
jne 0x4082db
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ebx, eax
test ebx, ebx
jle 0x408486
movzx ebx, bx
or ebx, 0x80070000
jmp 0x408486
cmp eax, edi
jbe 0x4082e9
mov ebx, 0x8007007a
jmp 0x408486
lea eax, [ebp - 0x20]
mov ecx, edi
push eax
push 0x16
pop edx
call fcn.00409523
test eax, eax
js 0x408481
mov eax, dword [ebp - 0x20]
lea edi, [eax + 0x104]
cmp edi, eax
jb 0x408481
and dword [ebp - 0x14], 0
push edi
lea ecx, [ebp - 0x14]
mov byte [ebp - 4], 1
call fcn.00408d20
test al, al
jne 0x40832f
mov ebx, 0x8007000e
jmp 0x408471
cmp byte [ebx + 0x32], 0
mov eax, 0x40151c
mov edx, 0x401c18
jne 0x408341
mov edx, eax
cmp byte [ebx + 0x31], 0
mov ecx, 0x401bf4
jne 0x40834e
mov ecx, eax
cmp byte [ebx + 0x30], 0
je 0x408359
mov eax, 0x401bc8
push edx
push ecx
push eax
push dword [ebx]
push dword [ebp - 0x10]
push 0x402098
push edi
push dword [ebp - 0x14]
call fcn.00405844
add esp, 0x20
test eax, eax
jns 0x408380
mov ebx, 0x80004005
jmp 0x408471
push 0x48
pop edi
push edi
xor ebx, ebx
lea eax, [ebp - 0x80]
push ebx
push eax
call sub.msvcrt.dll_memset
add esp, 0xc
mov dword [ebp - 0x80], edi
mov edi, ebx
mov dword [ebp - 0x20], ebx
mov dword [ebp - 0x18], ebx
cmp dword [ebp + 0xc], ebx
je 0x408413
lea edx, [ebp - 0x24]
call fcn.004081ed
test eax, eax
js 0x408413
lea eax, [ebp - 0x18]
push eax
push ebx
push 1
push ebx
call dword [sym.imp.KERNEL32.dll_InitializeProcThreadAttributeList]
mov edi, dword [ebp - 0x18]
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push edi
push ebx
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov edi, eax
xor eax, eax
test edi, edi
setne al
test edi, edi
je 0x4083ea
lea eax, [ebp - 0x18]
push eax
push ebx
push 1
push edi
call dword [sym.imp.KERNEL32.dll_InitializeProcThreadAttributeList]
test eax, eax
je 0x408413
xor ecx, ecx
mov dword [ebp - 0x20], 1
push ecx
push ecx
push 4
lea eax, [ebp - 0x24]
push eax
push 0x20000
push ecx
push edi
call dword [sym.imp.KERNEL32.dll_UpdateProcThreadAttribute]
test eax, eax
je 0x408413
mov dword [ebp - 0x3c], edi
lea eax, [ebp - 0x34]
push eax
lea eax, [ebp - 0x80]
push eax
xor eax, eax
push eax
push eax
push 0x1080000
push eax
push eax
push eax
push dword [ebp - 0x14]
push dword [ebp - 0x10]
call dword [sym.imp.KERNEL32.dll_CreateProcessW]
test eax, eax
je 0x40844b
push dword [ebp - 0x34]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push dword [ebp - 0x30]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x408450
mov ebx, 0x80004005
cmp dword [ebp - 0x20], 0
je 0x40845d
push edi
call dword [sym.imp.KERNEL32.dll_DeleteProcThreadAttributeList]
test edi, edi
je 0x408471
push edi
push 0
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapFree]
mov byte [ebp - 4], 0
push dword [ebp - 0x14]
call dword [sym.imp.msvcrt.dll_free]
pop ecx
jmp 0x408486
mov ebx, 0x80004005
or dword [ebp - 4], 0xffffffff
push dword [ebp - 0x10]
call dword [sym.imp.msvcrt.dll_free]
pop ecx
mov eax, ebx
jmp 0x40849d
mov eax, 0x80004005
call fcn.0040f798
ret 8