Function at 0x40f2d9
Capabilities:
Create process on windows

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0xc4
mov eax, dword [0x4c3a60]
xor eax, esp
mov dword [esp + 0xc0], eax
mov ecx, dword [ebp + 8]
mov edx, dword [ebp + 0xc]
push ebx
push esi
push edi
xor ebx, ebx
xor eax, eax
mov dword [esp + 0x48], ebx
lea edi, [esp + 0x4c]
stosd dword es:[edi], eax
stosd dword es:[edi], eax
stosd dword es:[edi], eax
mov eax, ecx
mov dword [esp + 0x10], ecx
mov dword [esp + 0x2c], edx
lea esi, [eax + 2]
mov cx, word [eax]
inc eax
inc eax
cmp cx, bx
jne 0x40f318
sub eax, esi
sar eax, 1
mov ecx, eax
mov eax, edx
lea edx, [eax + 2]
mov si, word [eax]
inc eax
inc eax
cmp si, bx
jne 0x40f32d
sub eax, edx
sar eax, 1
lea edi, [eax + ecx + 2]
xor ecx, ecx
push 2
pop edx
mov eax, edi
mul edx
seto cl
neg ecx
or ecx, eax
push ecx
call fcn.00475acf
mov esi, eax
lea eax, [edi + edi]
push eax
push ebx
push esi
mov dword [esp + 0x24], esi
call fcn.00476cc0
mov eax, dword [esp + 0x20]
mov ecx, esi
add esp, 0x10
sub ecx, eax
movzx edx, word [eax]
mov word [ecx + eax], dx
inc eax
inc eax
cmp dx, bx
jne 0x40f371
mov edi, esi
dec edi
dec edi
mov ax, word [edi + 2]
inc edi
inc edi
cmp ax, bx
jne 0x40f383
mov eax, dword [esp + 0x2c]
mov esi, 0x4b2d1c
movsd dword es:[edi], dword [esi]
mov edx, eax
mov cx, word [eax]
inc eax
inc eax
cmp cx, bx
jne 0x40f39a
mov edi, dword [esp + 0x14]
sub eax, edx
dec edi
dec edi
mov cx, word [edi + 2]
inc edi
inc edi
cmp cx, bx
jne 0x40f3ac
mov ecx, eax
shr ecx, 2
mov esi, edx
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
push 0x40
lea eax, [esp + 0x60]
mov esi, vtable.ATL::CAccessToken.0
push ebx
push eax
mov dword [esp + 0x1c], ebx
mov dword [esp + 0x3c], esi
mov dword [esp + 0x40], ebx
mov dword [esp + 0x44], ebx
mov dword [esp + 0x48], ebx
mov dword [esp + 0x28], esi
mov dword [esp + 0x2c], ebx
mov dword [esp + 0x30], ebx
mov dword [esp + 0x34], ebx
mov dword [esp + 0x24], ebx
mov dword [esp + 0x64], 0x44
call fcn.00476cc0
add esp, 0xc
push 0x8b
lea ecx, [esp + 0x34]
call fcn.0040f15a
test al, al
je 0x40f4d1
push ebx
push 0x2000000
lea eax, [esp + 0x24]
push eax
lea ecx, [esp + 0x3c]
call fcn.0040f09d
test al, al
je 0x40f4d1
push 6
pop ecx
xor eax, eax
mov esi, str.S_1_16_8192
lea edi, [esp + 0xa4]
rep movsd dword es:[edi], dword [esi]
lea edi, [esp + 0xbc]
stosd dword es:[edi], eax
stosd dword es:[edi], eax
stosd dword es:[edi], eax
stosd dword es:[edi], eax
lea eax, [esp + 0x18]
push eax
lea eax, [esp + 0xa8]
push eax
call sub.ADVAPI32.dll_ConvertStringSidToSidW
mov eax, dword [esp + 0x18]
mov esi, dword [esp + 0x20]
push 0x20
pop edi
push eax
mov dword [esp + 0x48], edi
mov dword [esp + 0x44], eax
call dword [sym.imp.ADVAPI32.dll_GetLengthSid]
add eax, 8
push eax
lea eax, [esp + 0x44]
push eax
push 0x19
push esi
call dword [sym.imp.ADVAPI32.dll_SetTokenInformation]
test eax, eax
je 0x40f4cc
lea eax, [esp + 0x58]
push eax
call dword [sym.imp.KERNEL32.dll_GetStartupInfoW]
lea eax, [esp + 0x48]
push eax
lea eax, [esp + 0x5c]
push eax
push ebx
push ebx
push edi
push ebx
push ebx
push ebx
push dword [esp + 0x34]
push ebx
push dword [esp + 0x48]
call dword [sym.imp.ADVAPI32.dll_CreateProcessAsUserW]
mov dword [esp + 0x10], eax
mov esi, vtable.ATL::CAccessToken.0
cmp dword [esp + 0x18], ebx
je 0x40f4e1
push dword [esp + 0x18]
call dword [sym.imp.KERNEL32.dll_LocalFree]
cmp dword [esp + 0x10], ebx
jne 0x40f507
lea eax, [esp + 0x48]
push eax
lea eax, [esp + 0x5c]
push eax
push ebx
push ebx
push 0x20
push ebx
push ebx
push ebx
push dword [esp + 0x34]
push ebx
call dword [sym.imp.KERNEL32.dll_CreateProcessW]
mov dword [esp + 0x10], eax
push dword [esp + 0x14]
call fcn.004769e6
pop ecx
lea ecx, [esp + 0x1c]
mov dword [esp + 0x1c], esi
call fcn.0040f183
lea ecx, [esp + 0x30]
mov dword [esp + 0x30], esi
call fcn.0040f183
mov ecx, dword [esp + 0xcc]
mov eax, dword [esp + 0x10]
pop edi
pop esi
pop ebx
xor ecx, esp
call fcn.00476d3a
mov esp, ebp
pop ebp
ret