Function at 0x412780
Capabilities:
Create process on windows
Query environment variable

Disassembly:
push ebp
mov ebp, esp
push ebx
push edi
push esi
and esp, 0xfffffff0
sub esp, 0x2a0
mov edi, dword [ebp + 0xc]
mov eax, dword [0x4b5040]
xor eax, ebp
mov dword [esp + 0x298], eax
lea esi, [esp + 0x108]
push 0x190
push 0
push esi
call fcn.004628e0
add esp, 0xc
cmp byte [edi + 0xb], 0
mov eax, edi
jns 0x4127c3
mov ecx, edi
mov eax, dword [edi]
mov ebx, dword [ebp + 0x10]
xor ecx, ecx
movzx edx, word [eax + ecx*2]
mov word [esp + ecx*2 + 0x108], dx
test dx, dx
je 0x412879
inc ecx
cmp ecx, 0xc8
jne 0x4127c8
jmp 0x41286f
movzx esi, byte [ebx]
movzx ebx, byte [ebx + 0x10]
mov ecx, dword [ebp + 0xc]
movzx eax, byte [ecx + 0xb]
test al, al
jns 0x412802
mov eax, dword [ecx + 4]
mov ecx, dword [ecx]
lea edi, [esp + 0x90]
push eax
push ecx
push edi
call fcn.00498240
add esp, 0xc
mov ecx, dword [ebp + 8]
mov edx, edi
push esi
push ebx
call fcn.00496cc0
add esp, 8
lea edi, [esp + 0xa8]
mov ecx, edi
push dword [edi + 4]
call fcn.0040e410
mov esi, dword [edi - 0xc]
test esi, esi
je 0x412f3b
mov edi, dword [esp + 0xa0]
mov eax, esi
cmp edi, esi
jne 0x412867
jmp 0x412f7b
push dword [edi - 0xc]
call fcn.0045e41e
add esp, 4
add edi, 0xfffffff4
cmp edi, esi
je 0x412f74
cmp byte [edi - 1], 0
jns 0x41285c
jmp 0x412851
mov word [esp + 0x296], 0
push esi
call fcn.00444920
add esp, 4
cmp byte [ebx + 0x11], 0
jne 0x4127eb
mov dword [esp + 0x20], 0xa
mov al, byte [0x4b9a1e]
test al, al
jne 0x413057
xor eax, eax
dec eax
lea edi, [esp + 0xe4]
mov dword [edi + 8], eax
mov dword [edi + 4], eax
mov dword [edi], eax
lea esi, [esp + 0x90]
push 0x100
push str....._baseprocesslaunch_win.cc
push str.LaunchProcess
push esi
call fcn.00440e50
add esp, 0x10
mov ecx, edi
push 0x4b9b90
push esi
call fcn.00416d60
pxor xmm0, xmm0
movdqa xmmword [esp + 0xf0], xmm0
movdqa xmmword [esi], xmm0
movdqu xmmword [esi + 0x3c], xmm0
movdqa xmmword [esi + 0x30], xmm0
movdqa xmmword [esi + 0x20], xmm0
movdqa xmmword [esi + 0x10], xmm0
mov dword [esi + 4], 0x48
xor edi, edi
cmp byte [ebx + 0x3e], 0
mov ecx, 0
je 0x41292a
call fcn.00409e80
mov eax, dword [0x4c440c]
xor ecx, ecx
cmp dword [eax], 0x10
setge cl
mov esi, ecx
mov eax, dword [ebx + 0x18]
mov ecx, ebx
xor ebx, ebx
cmp eax, dword [ecx + 0x1c]
setne byte [esp + 8]
call fcn.00409e80
mov eax, dword [0x4c440c]
cmp dword [eax], 3
jl 0x41296e
mov al, byte [esp + 8]
mov bl, al
add esi, ebx
je 0x41296e
lea ecx, [esp + 0x90]
push esi
call fcn.0041b670
mov edi, 0x80000
test al, al
je 0x412ece
mov ebx, dword [ebp + 0x10]
cmp byte [ebx + 0x3e], 0
je 0x4129c0
call fcn.00409e80
mov eax, dword [0x4c440c]
cmp dword [eax], 0x10
jl 0x4129c0
or byte [esp + 0xfb], 0x20
mov eax, dword [esp + 0xd8]
test eax, eax
je 0x412eb2
xor ecx, ecx
lea edx, [esp + 0xf0]
push ecx
push ecx
push 0x10
push edx
push 0x20007
push ecx
push eax
call dword [sym.imp.KERNEL32.dll_UpdateProcThreadAttribute]
test eax, eax
je 0x412eb2
mov eax, dword [ebx + 0x14]
mov ecx, dword [ebx + 0x18]
cmp eax, 1
sete dl
cmp ecx, dword [ebx + 0x1c]
je 0x412a8b
cmp eax, 1
sete bl
call fcn.00409e80
mov eax, dword [0x4c440c]
cmp dword [eax], 3
setl dl
or dl, bl
mov ebx, dword [ebp + 0x10]
mov eax, dword [ebx + 0x18]
cmp eax, dword [ebx + 0x1c]
je 0x412a8b
mov byte [esp + 8], dl
call fcn.00409e80
mov dl, byte [esp + 8]
mov eax, dword [0x4c440c]
cmp dword [eax], 3
jl 0x412a8b
mov dword [esp + 0xc], edi
mov edi, dword [ebx + 0x18]
mov ebx, dword [ebx + 0x1c]
cmp ebx, edi
js 0x412f54
je 0x4130ab
xor esi, esi
inc esi
push esi
push esi
push dword [edi]
call dword [sym.imp.KERNEL32.dll_SetHandleInformation]
test eax, eax
je 0x413010
add edi, 4
cmp edi, ebx
jne 0x412a2e
mov ecx, dword [ebp + 0x10]
mov eax, dword [ecx + 0x18]
mov ecx, dword [ecx + 0x1c]
sub ecx, eax
je 0x4130ab
mov edx, dword [esp + 0xd8]
test edx, edx
mov ebx, dword [ebp + 0x10]
mov edi, dword [esp + 0xc]
je 0x412f8d
xor esi, esi
push esi
push esi
push ecx
push eax
push 0x20002
push esi
push edx
call dword [sym.imp.KERNEL32.dll_UpdateProcThreadAttribute]
mov dl, 1
test eax, eax
je 0x412f8d
cmp byte [ebx + 0x12], 0
je 0x412a99
or byte [esp + 0xc0], 0x80
mov byte [esp + 8], dl
cmp byte [ebx + 0x28], 0
je 0x412aae
mov dword [esp + 0x9c], 0x4ad44a
mov eax, dword [esp + 0xc0]
mov ecx, eax
or ecx, 1
mov dword [esp + 0xc0], ecx
movzx ecx, byte [ebx + 0x10]
xor ecx, 1
mov word [esp + 0xc4], cx
mov ecx, dword [ebx + 0x30]
mov edx, dword [ebx + 0x34]
mov esi, dword [ebx + 0x38]
test ecx, ecx
jne 0x412ae5
test edx, edx
jne 0x412ae5
test esi, esi
je 0x412b2e
mov dword [esp + 0xc], edi
mov edi, dword [ebx + 0x18]
cmp edi, dword [ebx + 0x1c]
jne 0x412b09
test ecx, ecx
je 0x4130b1
test edx, edx
je 0x4130b4
test esi, esi
je 0x4130b7
or eax, 0x101
mov dword [esp + 0xc0], eax
mov dword [esp + 0xcc], ecx
mov dword [esp + 0xd0], edx
mov dword [esp + 0xd4], esi
mov edi, dword [esp + 0xc]
mov eax, edi
add edi, 0x1000000
cmp byte [ebx + 0x3c], 0
cmove edi, eax
pxor xmm0, xmm0
movdqa xmmword [esp + 0x70], xmm0
movzx eax, byte [ebx + 0xf]
test al, al
js 0x412b64
lea esi, [ebx + 4]
jmp 0x412b6a
lea ecx, [esp + 0x60]
push dword [edx + 4]
push dword [edx]
call fcn.00409e10
jmp 0x412b98
mov eax, dword [ebx + 8]
mov esi, dword [ebx + 4]
mov edx, dword [ebp + 0xc]
test eax, eax
cmove esi, eax
xor eax, eax
dec eax
mov dword [esp + 0x60], eax
mov dword [esp + 0x64], eax
mov dword [esp + 0x68], eax
cmp byte [edx + 0xb], 0
js 0x412b54
mov eax, dword [edx + 8]
mov dword [esp + 0x68], eax
movq xmm0, qword [edx]
movq qword [esp + 0x60], xmm0
mov eax, dword [ebx + 0x24]
test eax, eax
je 0x412bda
xor ecx, ecx
lea edx, [esp + 0x20]
mov dword [edx], ecx
push ecx
push eax
push edx
call sub.USERENV.dll_CreateEnvironmentBlock
test eax, eax
je 0x412d48
or edi, 0x400
mov edx, dword [esp + 0x20]
movzx ecx, byte [esp + 8]
cmp byte [esp + 0x6b], 0
js 0x412d68
lea eax, [esp + 0x60]
jmp 0x412d6c
pxor xmm0, xmm0
movq qword [esp + 0x20], xmm0
mov dword [esp + 0x28], 0
mov cl, byte [ebx + 0x4c]
test cl, cl
jne 0x412c18
xor eax, eax
cmp dword [ebx + 0x48], 0
jne 0x412c18
mov cl, byte [esp + 8]
movzx edx, cl
cmp byte [esp + 0x6b], 0
js 0x412ca8
mov ecx, eax
lea eax, [esp + 0x60]
jmp 0x412cae
test cl, cl
je 0x412c68
mov dword [esp + 0xc], esi
lea eax, [ebx + 0x40]
lea esi, [esp + 0x50]
push eax
push 0x4a73cc
push esi
call fcn.004999f0
add esp, 0xc
mov eax, dword [esi + 8]
mov dword [esp + 0x28], eax
movq xmm0, qword [esi]
movq qword [esp + 0x20], xmm0
cmp byte [esp + 0x2b], 0
mov cl, byte [esp + 8]
js 0x412c58
lea eax, [esp + 0x20]
jmp 0x412c5c
mov eax, dword [esp + 0x20]
mov esi, dword [esp + 0xc]
or edi, 0x400
jmp 0x412bff
call dword [sym.imp.KERNEL32.dll_GetEnvironmentStringsW]
test eax, eax
je 0x412d28
mov dword [esp + 0xc], esi
lea ecx, [ebx + 0x40]
lea esi, [esp + 0x50]
push ecx
push eax
push esi
mov ebx, eax
call fcn.004999f0
add esp, 0xc
mov eax, dword [esi + 8]
mov dword [esp + 0x28], eax
movq xmm0, qword [esi]
movq qword [esp + 0x20], xmm0
push ebx
call dword [sym.imp.KERNEL32.dll_FreeEnvironmentStringsW]
jmp 0x412c47
mov ecx, eax
mov eax, dword [esp + 0x60]
mov dword [esp + 8], eax
lea eax, [esp + 0x70]
xor ebx, ebx
push eax
lea eax, [esp + 0x98]
push eax
push esi
push ecx
push edi
push edx
push ebx
push ebx
push dword [esp + 0x28]
push ebx
call dword [sym.imp.KERNEL32.dll_CreateProcessW]
test eax, eax
je 0x412cf1
cmp byte [esp + 0x2b], 0
jns 0x412ce9
push dword [esp + 0x20]
call fcn.0045e41e
add esp, 4
mov ebx, dword [ebp + 0x10]
jmp 0x412da9
mov eax, dword [ebp + 8]
mov dword [eax], 0
mov byte [eax + 4], 0
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
test eax, eax
je 0x4130c0
cmp byte [esp + 0x2b], 0
jns 0x412e81
push dword [esp + 0x20]
call fcn.0045e41e
add esp, 4
jmp 0x412e81
mov eax, dword [ebp + 8]
mov dword [eax], 0
mov byte [eax + 4], 0
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
test eax, eax
jne 0x412e81
jmp 0x4130e5
mov eax, dword [ebp + 8]
mov dword [eax], 0
mov byte [eax + 4], 0
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
test eax, eax
jne 0x412e81
jmp 0x4130ae
mov eax, dword [esp + 0x60]
mov dword [esp + 8], eax
lea eax, [esp + 0x70]
xor ebx, ebx
push eax
lea eax, [esp + 0x98]
push eax
push esi
push edx
push edi
push ecx
push ebx
push ebx
push dword [esp + 0x28]
push ebx
mov ebx, dword [ebp + 0x10]
push dword [ebx + 0x24]
call dword [sym.imp.ADVAPI32.dll_CreateProcessAsUserW]
mov edi, eax
push dword [esp + 0x20]
call sub.USERENV.dll_DestroyEnvironmentBlock
test edi, edi
je 0x412e96
pxor xmm0, xmm0
lea ecx, [esp + 0x50]
movdqa xmmword [ecx], xmm0
lea eax, [esp + 0x70]
push eax
call fcn.004131a0
mov eax, dword [ebx + 0x2c]
test eax, eax
je 0x412dda
mov esi, dword [esp + 0x50]
push esi
push eax
call dword [sym.imp.KERNEL32.dll_AssignProcessToJobObject]
test eax, eax
je 0x412fad
cmp byte [ebx + 0x3d], 0
je 0x412e00
mov ecx, dword [esp + 0x50]
xor eax, eax
test ecx, ecx
je 0x412df9
push ecx
call dword [sym.imp.KERNEL32.dll_GetProcessId]
test eax, eax
je 0x4130c9
push eax
call dword [sym.imp.USER32.dll_AllowSetForegroundWindow]
cmp byte [ebx], 0
je 0x412e54
pcmpeqd xmm0, xmm0
lea edi, [esp + 0x20]
movdqa xmmword [edi + 0x20], xmm0
movdqa xmmword [edi + 0x10], xmm0
movdqa xmmword [edi], xmm0
lea esi, [esp + 0x10]
push 0x1ba
push str....._baseprocesslaunch_win.cc
push str.LaunchProcess
push esi
call fcn.00440e50
add esp, 0x10
mov ecx, edi
push 0
push esi
call fcn.00447150
push 0xffffffffffffffff
push dword [esp + 0x54]
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov ecx, edi
call fcn.00449c10
xor eax, eax
mov dword [esp + 0x58], eax
mov esi, dword [esp + 0x50]
mov dword [esp + 0x50], eax
lea eax, [esi + 1]
cmp eax, 2
jb 0x412e6f
call fcn.00444d70
mov ecx, dword [ebp + 8]
push esi
call fcn.0041a960
lea ecx, [esp + 0x50]
call fcn.0041b720
cmp byte [esp + 0x6b], 0
jns 0x412ee9
push dword [esp + 0x60]
call fcn.0045e41e
add esp, 4
jmp 0x412ee9
mov eax, dword [ebp + 8]
mov dword [eax], 0
mov byte [eax + 4], 0
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
test eax, eax
jne 0x412e81
jmp 0x4130bd
mov eax, dword [ebp + 8]
mov dword [eax], 0
mov byte [eax + 4], 0
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
test eax, eax
jne 0x412ee9
jmp 0x4130ba
mov eax, dword [ebp + 8]
mov dword [eax], 0
mov byte [eax + 4], 0
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
test eax, eax
je 0x4130a8
mov eax, dword [esp + 0xd8]
test eax, eax
je 0x412efb
push eax
call dword [sym.imp.KERNEL32.dll_DeleteProcThreadAttributeList]
mov eax, dword [esp + 0x90]
mov dword [esp + 0x90], 0
test eax, eax
je 0x412f1a
push eax
call fcn.0045fb6f
add esp, 4
lea ecx, [esp + 0xe4]
call fcn.0041b4b0
mov dword [esp + 0x20], 0xa
mov al, byte [0x4b9a1e]
test al, al
jne 0x41307d
mov ecx, dword [esp + 0x298]
xor ecx, ebp
call fcn.00461246
mov eax, dword [ebp + 8]
lea esp, [ebp - 0xc]
pop esi
pop edi
pop ebx
pop ebp
ret
mov eax, dword [ebp + 8]
mov dword [eax], 0
mov byte [eax + 4], 0
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
test eax, eax
jne 0x412ee9
jmp 0x4130c6
mov eax, dword [esp + 0x9c]
mov dword [esp + 0xa0], esi
push eax
call fcn.0045e41e
add esp, 4
jmp 0x412f3b
mov eax, dword [ebp + 8]
mov dword [eax], 0
mov byte [eax + 4], 0
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
test eax, eax
jne 0x412ee9
jmp 0x4130e2
xor eax, eax
dec eax
mov dword [esp + 0x24], eax
mov dword [esp + 0x20], eax
xor eax, eax
mov dword [esp + 0x58], eax
mov dword [esp + 0x50], eax
lea eax, [esi + 1]
cmp eax, 2
jb 0x412fcf
call fcn.00444d70
lea edi, [esp + 0x20]
mov ecx, edi
push esi
call fcn.0041a960
xor eax, eax
inc eax
mov ecx, edi
push eax
push eax
call fcn.00496c00
mov eax, dword [ebp + 8]
mov dword [eax], 0
mov byte [eax + 4], 0
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
test eax, eax
je 0x4130c3
lea ecx, [esp + 0x20]
call fcn.0041aa40
jmp 0x412e78
push 0x142
push str....._baseprocesslaunch_win.cc
push str.LaunchProcess
lea eax, [esp + 0x2c]
push eax
call fcn.00440e50
add esp, 0x10
lea eax, [esp + 0x20]
push eax
push 0x4ac037
lea eax, [esp + 0x94]
push eax
call fcn.004394c0
add esp, 0xc
lea ecx, [esp + 0x8c]
call fcn.0040db40
jmp 0x412a40
movzx eax, al
lea ecx, [esp + 0x90]
mov dword [ecx], str.LaunchProcess
lea edx, [esp + 0x20]
push 1
push ecx
push edx
push eax
call fcn.00440e00
add esp, 0x10
jmp 0x4128a1
movzx eax, al
mov dword [esp + 0x90], 0
lea ecx, [esp + 0x20]
push 2
lea edx, [esp + 0x94]
push edx
push ecx
push eax
call fcn.00440db0
add esp, 0x10
jmp 0x412f3b
int3
int3
int3
int3
int3
int3
int3
int3
int3
int3
int3
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, eax
mov eax, 0
cmp ecx, 6
jne 0x412df9
int3
int3
int3