Function at 0x40a620
Capabilities:
Create process on windows
Get session information
Get session user name
Impersonate user

Disassembly:
push ebx
mov ebx, esp
sub esp, 8
and esp, 0xfffffff8
add esp, 4
push ebp
mov ebp, dword [ebx + 4]
mov dword [esp + 4], ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x41d603
mov eax, dword fs:[0]
push eax
push ebx
sub esp, 0x98
mov eax, dword [0x42f040]
xor eax, ebp
mov dword [ebp - 0x14], eax
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov dword [ebp - 0xa0], ecx
mov dword [ebp - 4], 1
lea eax, [ebp - 0x18]
xor edi, edi
mov dword [ebp - 0x88], 0
push eax
mov dword [ebp - 0x34], 0
mov dword [ebp - 0x18], edi
call dword [sym.imp.KERNEL32.dll_GetCurrentProcessId]
push eax
call dword [sym.imp.KERNEL32.dll_ProcessIdToSessionId]
test eax, eax
jne 0x40a6b7
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.fail_to_get_ssid_:__d
push str.fxstd::fxwshelper
call fcn.00401ea0
add esp, 0xc
jmp 0x40a9d0
xorps xmm0, xmm0
mov dword [ebp - 0x20], edi
xor eax, eax
mov dword [ebp - 0x1c], 7
movups xmmword [ebp - 0x30], xmm0
mov word [ebp - 0x30], ax
lea eax, [ebp - 0x34]
mov byte [ebp - 4], 2
push eax
lea eax, [ebp - 0x88]
push eax
push 5
push dword [ebp - 0x18]
push 0
call dword [sym.imp.WTSAPI32.dll_WTSQuerySessionInformationW]
test eax, eax
jne 0x40a6f8
mov esi, str.fail_to_query_session_info_:__d
jmp 0x40a7a6
mov edx, dword [ebp - 0x88]
mov ecx, edx
lea esi, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x40a703
mov eax, dword [ebp - 0x1c]
sub ecx, esi
sar ecx, 1
cmp ecx, eax
ja 0x40a73e
lea esi, [ecx + ecx]
mov dword [ebp - 0x20], ecx
cmp eax, 7
lea edi, [ebp - 0x30]
push esi
cmova edi, dword [ebp - 0x30]
push edx
push edi
call sub.VCRUNTIME140.dll_memmove
xor eax, eax
add esp, 0xc
mov word [edi + esi], ax
xor edi, edi
jmp 0x40a74e
push edx
push dword [ebp - 0xa4]
push ecx
lea ecx, [ebp - 0x30]
call fcn.00405f50
push dword [ebp - 0x88]
call dword [sym.imp.WTSAPI32.dll_WTSFreeMemory]
cmp dword [ebp - 0x20], 0
jne 0x40a767
mov esi, str.fail_to_get_ss_user_:__d
jmp 0x40a7a6
mov esi, dword [ebp - 0x18]
lea eax, [ebp - 0x30]
sub esp, 0x18
mov ecx, esp
push eax
call fcn.00405910
mov ecx, esi
call fcn.0040a360
add esp, 0x18
test eax, eax
jne 0x40a78d
mov esi, str.fail_to_get_pid_:__d
jmp 0x40a7a6
push eax
push 0
push 0x400
call dword [sym.imp.KERNEL32.dll_OpenProcess]
mov esi, eax
test esi, esi
jne 0x40a7c2
mov esi, str.fail_to_open_:__d
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push esi
push str.fxstd::fxwshelper
call fcn.00401ea0
add esp, 0xc
xor edi, edi
jmp 0x40a982
lea eax, [ebp - 0x84]
mov dword [ebp - 0x84], 0
push eax
push 0x2000000
push esi
mov dword [ebp - 0x8c], 0
call dword [sym.imp.ADVAPI32.dll_OpenProcessToken]
test eax, eax
jne 0x40a814
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.fail_to_open_token_:__d
push str.fxstd::fxwshelper
call fcn.00401ea0
add esp, 0xc
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
xor edi, edi
jmp 0x40a982
push esi
mov esi, dword [sym.imp.KERNEL32.dll_CloseHandle]
call esi
lea eax, [ebp - 0x8c]
push eax
push 1
push 2
push 0
push 0x2000000
push dword [ebp - 0x84]
call dword [sym.imp.ADVAPI32.dll_DuplicateTokenEx]
test eax, eax
jne 0x40a867
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.fail_to_open_dup_:__d
push str.fxstd::fxwshelper
call fcn.00401ea0
add esp, 0xc
push dword [ebp - 0x84]
call esi
xor edi, edi
jmp 0x40a982
push dword [ebp - 0x84]
call esi
xor eax, eax
mov dword [ebp - 0x80], 0x44
mov word [ebp - 0x3e], ax
mov ecx, 2
mov eax, dword [ebp - 0xa0]
xorps xmm0, xmm0
mov word [ebp - 0x50], ax
mov eax, dword [ebx + 0x30]
inc eax
movlpd qword [ebp - 0x7c], xmm0
mul ecx
movlpd qword [ebp - 0x74], xmm0
movlpd qword [ebp - 0x6c], xmm0
movlpd qword [ebp - 0x64], xmm0
movlpd qword [ebp - 0x5c], xmm0
mov ecx, 0xffffffff
movlpd qword [ebp - 0x4e], xmm0
movups xmmword [ebp - 0x9c], xmm0
cmovb eax, ecx
mov dword [ebp - 0x54], 1
movlpd qword [ebp - 0x46], xmm0
push eax
call fcn.0041c17b
mov edx, dword [ebx + 0x30]
lea esi, [ebx + 0x20]
add esp, 4
mov ecx, eax
cmp dword [ebx + 0x34], 7
mov dword [ebp - 0xa0], ecx
cmova esi, dword [ebx + 0x20]
lea eax, [edx + 1]
mov dword [ebp - 0xa4], esi
mov esi, dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp edx, eax
ja 0x40aa70
lea eax, [edx + edx]
push eax
push dword [ebp - 0xa4]
push ecx
call sub.VCRUNTIME140.dll_memcpy
mov eax, dword [ebx + 0x30]
add esp, 0xc
mov ecx, dword [ebp - 0xa0]
xor edx, edx
mov word [ecx + eax*2], dx
lea edx, [ebp - 0x9c]
cmp dword [ebx + 0x1c], 7
lea eax, [ebx + 8]
push edx
cmova eax, dword [ebx + 8]
lea edx, [ebp - 0x80]
push edx
push 0
push 0
push 0
push ecx
push eax
push 0
push dword [ebp - 0x8c]
call dword [sym.imp.ADVAPI32.dll_CreateProcessWithTokenW]
test eax, eax
je 0x40a96c
cmp dword [ebp - 0x94], 0
je 0x40a96c
push dword [ebp - 0x98]
call esi
mov edi, dword [ebp - 0x9c]
push dword [ebp - 0xa0]
call fcn.0041bee0
add esp, 4
push dword [ebp - 0x8c]
call esi
mov ecx, dword [ebp - 0x1c]
cmp ecx, 7
jbe 0x40a9bc
mov edx, dword [ebp - 0x30]
lea ecx, [ecx*2 + 2]
mov eax, edx
cmp ecx, 0x1000
jb 0x40a9b2
mov edx, dword [eax - 4]
add ecx, 0x23
sub eax, edx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x40aa70
push ecx
push edx
call fcn.0041c16d
add esp, 8
xor eax, eax
mov dword [ebp - 0x20], 0
mov dword [ebp - 0x1c], 7
mov word [ebp - 0x30], ax
mov ecx, dword [ebx + 0x1c]
cmp ecx, 7
jbe 0x40aa06
mov edx, dword [ebx + 8]
lea ecx, [ecx*2 + 2]
mov eax, edx
cmp ecx, 0x1000
jb 0x40a9fc
mov edx, dword [eax - 4]
add ecx, 0x23
sub eax, edx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x40aa70
push ecx
push edx
call fcn.0041c16d
add esp, 8
mov ecx, dword [ebx + 0x34]
xor eax, eax
mov dword [ebx + 0x18], 0
mov dword [ebx + 0x1c], 7
mov word [ebx + 8], ax
cmp ecx, 7
jbe 0x40aa50
mov edx, dword [ebx + 0x20]
lea ecx, [ecx*2 + 2]
mov eax, edx
cmp ecx, 0x1000
jb 0x40aa46
mov edx, dword [eax - 4]
add ecx, 0x23
sub eax, edx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x40aa70
push ecx
push edx
call fcn.0041c16d
add esp, 8
mov eax, edi
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
mov ecx, dword [ebp - 0x14]
xor ecx, ebp
call fcn.0041bed2
mov esp, ebp
pop ebp
mov esp, ebx
pop ebx
ret
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo_noreturn]
int3