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

Disassembly:
push 0x78
mov eax, 0x40d79f
call fcn.0040d394
mov ebx, ecx
and dword [ebp - 0x20], 0
lea eax, [ebp - 0x20]
push eax
mov edx, 0x7fffffff
mov ecx, str._SystemRoot_System32ATBroker.exe
call fcn.004080b1
test eax, eax
js 0x4070ef
mov eax, dword [ebp - 0x20]
lea ecx, [eax + 0x104]
cmp ecx, eax
jb 0x406ec8
mov edi, ecx
jmp 0x406ecb
or edi, 0xffffffff
cmp ecx, eax
jb 0x4070ef
and dword [ebp - 0x14], 0
and dword [ebp - 4], 0
lea ecx, [ebp - 0x14]
push edi
call fcn.004079a4
test al, al
jne 0x406ef2
mov edi, 0x8007000e
jmp 0x4070d2
push edi
push dword [ebp - 0x14]
push str._SystemRoot_System32ATBroker.exe
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
test eax, eax
jne 0x406f23
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edi, eax
test edi, edi
jle 0x4070d2
movzx edi, di
or edi, 0x80070000
jmp 0x4070d2
cmp eax, edi
jbe 0x406f31
mov edi, 0x8007007a
jmp 0x4070d2
lea eax, [ebp - 0x24]
mov ecx, edi
push eax
push 0x16
pop edx
call fcn.0040808c
test eax, eax
js 0x4070cd
mov eax, dword [ebp - 0x24]
lea edi, [eax + 0x104]
cmp edi, eax
jb 0x4070cd
and dword [ebp - 0x18], 0
push edi
lea ecx, [ebp - 0x18]
mov byte [ebp - 4], 6
call fcn.004079a4
test al, al
jne 0x406f77
mov edi, 0x8007000e
jmp 0x4070b5
cmp byte [ebx + 0x2d], 0
mov ecx, 0x4014e0
mov edx, 0x401ba4
jne 0x406f89
mov edx, ecx
cmp byte [ebx + 0x2c], 0
je 0x406f94
mov ecx, 0x401b78
push edx
push ecx
push dword [ebx]
push dword [ebp - 0x14]
push 0x401d1c
push edi
push dword [ebp - 0x18]
call fcn.00404d2b
add esp, 0x1c
test eax, eax
jns 0x406fba
mov edi, 0x80004005
jmp 0x4070b5
push 0x48
pop edi
push edi
lea eax, [ebp - 0x84]
push 0
push eax
call sub.msvcrt.dll_memset
and dword [ebp - 0x24], 0
xor ebx, ebx
and dword [ebp - 0x1c], ebx
add esp, 0xc
mov dword [ebp - 0x84], edi
xor edi, edi
cmp dword [ebp + 8], ebx
je 0x407054
lea edx, [ebp - 0x28]
call fcn.00406e41
test eax, eax
js 0x407054
lea eax, [ebp - 0x1c]
push eax
push ebx
push 1
push ebx
call dword [sym.imp.KERNEL32.dll_InitializeProcThreadAttributeList]
push dword [ebp - 0x1c]
push ebx
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov ebx, eax
xor eax, eax
test ebx, ebx
setne al
test ebx, ebx
je 0x40702b
lea eax, [ebp - 0x1c]
push eax
push edi
push 1
push ebx
call dword [sym.imp.KERNEL32.dll_InitializeProcThreadAttributeList]
test eax, eax
je 0x407054
xor ecx, ecx
mov dword [ebp - 0x24], 1
push ecx
push ecx
push 4
lea eax, [ebp - 0x28]
push eax
push 0x20000
push ecx
push ebx
call dword [sym.imp.KERNEL32.dll_UpdateProcThreadAttribute]
test eax, eax
je 0x407054
mov dword [ebp - 0x40], ebx
lea eax, [ebp - 0x38]
push eax
lea eax, [ebp - 0x84]
push eax
xor eax, eax
push eax
push eax
push 0x1080000
push eax
push eax
push eax
push dword [ebp - 0x18]
push dword [ebp - 0x14]
call dword [sym.imp.KERNEL32.dll_CreateProcessW]
test eax, eax
je 0x40708f
push dword [ebp - 0x38]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push dword [ebp - 0x34]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x407094
mov edi, 0x80004005
cmp dword [ebp - 0x24], 0
je 0x4070a1
push ebx
call dword [sym.imp.KERNEL32.dll_DeleteProcThreadAttributeList]
test ebx, ebx
je 0x4070b5
push ebx
push 0
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapFree]
mov byte [ebp - 4], 0xb
push dword [ebp - 0x18]
call dword [sym.imp.msvcrt.dll_free]
and dword [ebp - 0x18], 0
pop ecx
mov byte [ebp - 4], 0
jmp 0x4070d2
mov edi, 0x80004005
mov dword [ebp - 4], 0xc
push dword [ebp - 0x14]
call dword [sym.imp.msvcrt.dll_free]
and dword [ebp - 0x14], 0
mov eax, edi
or dword [ebp - 4], 0xffffffff
pop ecx
jmp 0x4070f4
mov eax, 0x80004005
call fcn.0040d362
ret 4