Function at 0x408231
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.00409b90
test eax, eax
je 0x408252
xor eax, eax
jmp 0x408494
and dword [ebp - 0x1c], 0
lea eax, [ebp - 0x1c]
push eax
mov edx, 0x7fffffff
mov ecx, str._SystemRoot_System32ATBroker.exe
call fcn.00409823
test eax, eax
js 0x40848f
mov eax, dword [ebp - 0x1c]
lea edi, [eax + 0x104]
cmp edi, eax
jb 0x40848f
and dword [ebp - 0x10], 0
and dword [ebp - 4], 0
lea ecx, [ebp - 0x10]
push edi
call fcn.00408d17
test al, al
jne 0x4082a1
mov ebx, 0x8007000e
jmp 0x40847d
push edi
push dword [ebp - 0x10]
push str._SystemRoot_System32ATBroker.exe
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
test eax, eax
jne 0x4082d2
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ebx, eax
test ebx, ebx
jle 0x40847d
movzx ebx, bx
or ebx, 0x80070000
jmp 0x40847d
cmp eax, edi
jbe 0x4082e0
mov ebx, 0x8007007a
jmp 0x40847d
lea eax, [ebp - 0x20]
mov ecx, edi
push eax
push 0x16
pop edx
call fcn.0040951a
test eax, eax
js 0x408478
mov eax, dword [ebp - 0x20]
lea edi, [eax + 0x104]
cmp edi, eax
jb 0x408478
and dword [ebp - 0x14], 0
push edi
lea ecx, [ebp - 0x14]
mov byte [ebp - 4], 1
call fcn.00408d17
test al, al
jne 0x408326
mov ebx, 0x8007000e
jmp 0x408468
cmp byte [ebx + 0x32], 0
mov eax, 0x40151c
mov edx, 0x401c18
jne 0x408338
mov edx, eax
cmp byte [ebx + 0x31], 0
mov ecx, 0x401bf4
jne 0x408345
mov ecx, eax
cmp byte [ebx + 0x30], 0
je 0x408350
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 0x408377
mov ebx, 0x80004005
jmp 0x408468
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 0x40840a
lea edx, [ebp - 0x24]
call fcn.004081e4
test eax, eax
js 0x40840a
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 0x4083e1
lea eax, [ebp - 0x18]
push eax
push ebx
push 1
push edi
call dword [sym.imp.KERNEL32.dll_InitializeProcThreadAttributeList]
test eax, eax
je 0x40840a
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 0x40840a
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 0x408442
push dword [ebp - 0x34]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push dword [ebp - 0x30]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x408447
mov ebx, 0x80004005
cmp dword [ebp - 0x20], 0
je 0x408454
push edi
call dword [sym.imp.KERNEL32.dll_DeleteProcThreadAttributeList]
test edi, edi
je 0x408468
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 0x40847d
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 0x408494
mov eax, 0x80004005
call fcn.0040f798
ret 8