Function at 0x140001680
Capabilities:
Check os version
Create process on windows
Query environment variable

Disassembly:
mov qword [rsp + 0x10], rdx
mov dword [rsp + 8], ecx
push rdi
sub rsp, 0x3a0
mov rax, qword [0x14001c008]
xor rax, rsp
mov qword [rsp + 0x390], rax
mov qword [rsp + 0x100], 0
mov qword [rsp + 0xe0], 0
mov qword [rsp + 0x110], 0
mov qword [rsp + 0x120], 0
mov dword [rsp + 0x90], 1
lea rax, [rsp + 0x148]
mov rdi, rax
xor eax, eax
mov ecx, 0x10
rep stosb byte [rdi], al
lea rax, [rsp + 0x138]
mov rdi, rax
xor eax, eax
mov ecx, 0x10
rep stosb byte [rdi], al
mov qword [rsp + 0x88], 0
lea rax, [rsp + 0x160]
mov rdi, rax
xor eax, eax
mov ecx, 0x18
rep stosb byte [rdi], al
lea rax, [rsp + 0x180]
mov rdi, rax
xor eax, eax
mov ecx, 0x68
rep stosb byte [rdi], al
mov qword [rsp + 0x78], 0
mov qword [rsp + 0x108], 0
mov qword [rsp + 0x118], 0
mov qword [rsp + 0x128], 0
mov dword [rsp + 0x1f8], 0
lea rax, [rsp + 0x200]
mov rdi, rax
xor eax, eax
mov ecx, 8
rep stosb byte [rdi], al
mov qword [rsp + 0xa8], 0
lea rax, str._systemroot__system32cmd.exe
mov qword [rsp + 0xf8], rax
mov qword [rsp + 0x98], 0
mov qword [rsp + 0xb8], 0
mov eax, dword [0x140019e8c]
mov dword [rsp + 0x1f0], eax
mov qword [rsp + 0x130], 0
call qword [sym.imp.KERNEL32.dll_GetProcessHeap]
mov qword [0x14001dbd0], rax
cmp dword [rsp + 0x3b0], 2
jge 0x14000180c
mov ecx, 2
call fcn.140003e58
lea rdx, str.Usage:_n___s4u.exe_DomainUsername__Extra_SID__n_n
mov rcx, rax
call fcn.140001060
jmp 0x1400020fe
mov eax, 8
imul rax, rax, 1
lea r8, [rsp + 0x130]
lea rdx, [rsp + 0x1f0]
mov rcx, qword [rsp + 0x3b8]
mov rcx, qword [rcx + rax]
call fcn.140003f70
mov qword [rsp + 0x98], rax
cmp qword [rsp + 0x98], 0
jne 0x14000186c
mov ecx, 2
call fcn.140003e58
lea rdx, [0x140019fb8]
mov rcx, rax
call fcn.140001060
jmp 0x1400020fe
lea r8, [rsp + 0x130]
lea rdx, [rsp + 0x1f0]
xor ecx, ecx
call fcn.140003f70
mov qword [rsp + 0xb8], rax
cmp qword [rsp + 0xb8], 0
jne 0x1400018b9
mov ecx, 2
call fcn.140003e58
lea rdx, str.Unable_to_parse_command_line._n
mov rcx, rax
call fcn.140001060
jmp 0x1400020fe
mov rax, qword [rsp + 0x98]
lea rcx, [0x140019ebc]
sub rcx, rax
movzx edx, word [rax]
cmp dx, word [rax + rcx]
jne 0x1400018e1
add rax, 2
test dx, dx
jne 0x1400018cb
xor eax, eax
jmp 0x1400018e6
sbb eax, eax
or eax, 1
test eax, eax
je 0x1400018f5
mov dword [rsp + 0x90], 0
lea rax, [rsp + 0x240]
mov rdi, rax
xor eax, eax
mov ecx, 0x114
rep stosb byte [rdi], al
mov dword [rsp + 0x240], 0x114
lea rcx, [rsp + 0x240]
call qword [sym.imp.KERNEL32.dll_GetVersionExW]
mov dword [rsp + 0x80], eax
cmp dword [rsp + 0x80], 0
jne 0x14000196d
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [rsp + 0xc8], eax
mov ecx, 2
call fcn.140003e58
mov ecx, dword [rsp + 0xc8]
mov r8d, ecx
lea rdx, str.GetVersionEx_failed__error__u_.
mov rcx, rax
call fcn.140001060
jmp 0x1400020fe
call qword [sym.imp.KERNEL32.dll_GetCurrentProcess]
mov qword [rsp + 0xe0], rax
lea r8, [rsp + 0x110]
mov edx, 0x28
mov rcx, qword [rsp + 0xe0]
call qword [sym.imp.ADVAPI32.dll_OpenProcessToken]
mov r8d, 1
lea rdx, str.SeTcbPrivilege
mov rcx, qword [rsp + 0x110]
call fcn.1400013a0
test eax, eax
jne 0x1400019be
jmp 0x1400020fe
lea rdx, [rsp + 0x108]
mov rcx, qword [rsp + 0x110]
call fcn.140001150
test eax, eax
jne 0x1400019fa
mov ecx, 2
call fcn.140003e58
lea rdx, str.Unable_to_find_logon_SID._n
mov rcx, rax
call fcn.140001060
jmp 0x1400020fe
lea rcx, [rsp + 0x100]
call qword [sym.imp.Secur32.dll_LsaConnectUntrusted]
mov dword [rsp + 0x70], eax
cmp dword [rsp + 0x70], 0
je 0x140001a47
mov ecx, 2
call fcn.140003e58
mov r8d, dword [rsp + 0x70]
lea rdx, str.LsaConnectUntrusted_failed__error_0x_x_.
mov rcx, rax
call fcn.140001060
mov qword [rsp + 0x100], 0
jmp 0x1400020fe
lea rdx, str.MICROSOFT_AUTHENTICATION_PACKAGE_V1_0
lea rcx, [rsp + 0x148]
call fcn.140001510
lea r8, [rsp + 0x1f4]
lea rdx, [rsp + 0x148]
mov rcx, qword [rsp + 0x100]
call qword [sym.imp.Secur32.dll_LsaLookupAuthenticationPackage]
mov dword [rsp + 0x70], eax
cmp dword [rsp + 0x70], 0
je 0x140001ab8
mov ecx, 2
call fcn.140003e58
mov r8d, dword [rsp + 0x70]
lea rdx, str.LsaLookupAuthenticationPackage_failed__error_0x_x_.
mov rcx, rax
call fcn.140001060
mov qword [rsp + 0x100], 0
jmp 0x1400020fe
cmp dword [rsp + 0x90], 0
jne 0x140001b9e
cmp dword [rsp + 0x244], 6
ja 0x140001aec
cmp dword [rsp + 0x244], 6
jne 0x140001b9e
cmp dword [rsp + 0x248], 2
jbe 0x140001b9e
mov qword [rsp + 0x158], 0
lea rax, [rsp + 0x208]
mov rdi, rax
xor eax, eax
mov ecx, 0xc
rep stosb byte [rdi], al
mov dword [rsp + 0x208], 0xc
mov dword [rsp + 0x20c], 0x20
mov dword [rsp + 0x84], 0xc
lea rax, [rsp + 0x218]
mov qword [rsp + 0x30], rax
lea rax, [rsp + 0x220]
mov qword [rsp + 0x28], rax
lea rax, [rsp + 0x158]
mov qword [rsp + 0x20], rax
mov r9d, dword [rsp + 0x84]
lea r8, [rsp + 0x208]
mov edx, dword [rsp + 0x1f4]
mov rcx, qword [rsp + 0x100]
call qword [sym.imp.Secur32.dll_LsaCallAuthenticationPackage]
mov dword [rsp + 0x70], eax
cmp dword [rsp + 0x70], 0
je 0x140001b9e
mov edx, dword [rsp + 0x70]
lea rcx, str.LsaCallAuthenticationPackage___failed__error_0x_x_._n
call fcn.1400010d0
jmp 0x1400020fe
mov rax, qword [rsp + 0x98]
mov qword [rsp + 0xe8], rax
mov qword [rsp + 0xa0], 0xffffffffffffffff
inc qword [rsp + 0xa0]
mov rax, qword [rsp + 0xe8]
mov rcx, qword [rsp + 0xa0]
cmp word [rax + rcx*2], 0
jne 0x140001bba
mov rax, qword [rsp + 0xa0]
mov rcx, qword [rsp + 0xb8]
mov qword [rsp + 0xf0], rcx
mov qword [rsp + 0xc0], 0xffffffffffffffff
inc qword [rsp + 0xc0]
mov rcx, qword [rsp + 0xf0]
mov rdx, qword [rsp + 0xc0]
cmp word [rcx + rdx*2], 0
jne 0x140001bfd
mov rcx, qword [rsp + 0xc0]
lea eax, [rax + rcx + 2]
mov eax, eax
lea rax, [rax + rax + 0x28]
mov dword [rsp + 0x84], eax
mov eax, dword [rsp + 0x84]
mov r8d, eax
mov edx, 8
mov rcx, qword [0x14001dbd0]
call qword [sym.imp.KERNEL32.dll_HeapAlloc]
mov qword [rsp + 0x88], rax
cmp qword [rsp + 0x88], 0
jne 0x140001c9f
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [rsp + 0xcc], eax
mov ecx, 2
call fcn.140003e58
mov ecx, dword [rsp + 0xcc]
mov r8d, ecx
lea rdx, [0x14001a128]
mov rcx, rax
call fcn.140001060
jmp 0x1400020fe
mov rax, qword [rsp + 0x88]
mov dword [rax], 0xc
mov rax, qword [rsp + 0x88]
add rax, 0x28
mov qword [rsp + 0xb0], rax
mov rax, qword [rsp + 0x88]
add rax, 8
mov r8, qword [rsp + 0xb0]
mov rdx, qword [rsp + 0xb8]
mov rcx, rax
call fcn.1400015e0
mov qword [rsp + 0xb0], rax
mov rax, qword [rsp + 0x88]
add rax, 0x18
mov r8, qword [rsp + 0xb0]
mov rdx, qword [rsp + 0x98]
mov rcx, rax
call fcn.1400015e0
mov qword [rsp + 0xb0], rax
lea r8, str.S4UWin
mov edx, 8
lea rcx, [rsp + 0x228]
call fcn.1400055c0
lea rdx, str.S4U_for_Windows
lea rcx, [rsp + 0x138]
call fcn.140001510
lea rcx, [rsp + 0x230]
call qword [sym.imp.ADVAPI32.dll_AllocateLocallyUniqueId]
mov r8d, 0x38
mov edx, 8
mov rcx, qword [0x14001dbd0]
call qword [sym.imp.KERNEL32.dll_HeapAlloc]
mov qword [rsp + 0x78], rax
cmp qword [rsp + 0x78], 0
jne 0x140001db3
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [rsp + 0xd0], eax
mov ecx, 2
call fcn.140003e58
mov ecx, dword [rsp + 0xd0]
mov r8d, ecx
lea rdx, [0x14001a158]
mov rcx, rax
call fcn.140001060
jmp 0x1400020fe
cmp qword [rsp + 0x108], 0
je 0x140001e03
mov rax, qword [rsp + 0x78]
mov eax, dword [rax]
imul rax, rax, 0x10
mov rcx, qword [rsp + 0x78]
mov dword [rcx + rax + 0x10], 7
mov rax, qword [rsp + 0x78]
mov eax, dword [rax]
imul rax, rax, 0x10
mov rcx, qword [rsp + 0x78]
mov rdx, qword [rsp + 0x108]
mov qword [rcx + rax + 8], rdx
mov rax, qword [rsp + 0x78]
mov eax, dword [rax]
inc eax
mov rcx, qword [rsp + 0x78]
mov dword [rcx], eax
cmp dword [rsp + 0x3b0], 3
jne 0x140001ebc
mov eax, 8
imul rax, rax, 2
lea rdx, [rsp + 0x118]
mov rcx, qword [rsp + 0x3b8]
mov rcx, qword [rcx + rax]
call qword [sym.imp.ADVAPI32.dll_ConvertStringSidToSidW]
mov dword [rsp + 0x80], eax
cmp dword [rsp + 0x80], 1
jne 0x140001e8c
mov rax, qword [rsp + 0x78]
mov eax, dword [rax]
imul rax, rax, 0x10
mov rcx, qword [rsp + 0x78]
mov dword [rcx + rax + 0x10], 7
mov rax, qword [rsp + 0x78]
mov eax, dword [rax]
imul rax, rax, 0x10
mov rcx, qword [rsp + 0x78]
mov rdx, qword [rsp + 0x118]
mov qword [rcx + rax + 8], rdx
mov rax, qword [rsp + 0x78]
mov eax, dword [rax]
inc eax
mov rcx, qword [rsp + 0x78]
mov dword [rcx], eax
jmp 0x140001ebc
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [rsp + 0xd4], eax
mov ecx, 2
call fcn.140003e58
mov ecx, dword [rsp + 0xd4]
mov r8d, ecx
lea rdx, str.Unable_to_convert_SID__error__u_.
mov rcx, rax
call fcn.140001060
lea rax, [rsp + 0x21c]
mov qword [rsp + 0x68], rax
lea rax, [rsp + 0x360]
mov qword [rsp + 0x60], rax
lea rax, [rsp + 0x120]
mov qword [rsp + 0x58], rax
lea rax, [rsp + 0x200]
mov qword [rsp + 0x50], rax
lea rax, [rsp + 0x1f8]
mov qword [rsp + 0x48], rax
lea rax, [rsp + 0x128]
mov qword [rsp + 0x40], rax
lea rax, [rsp + 0x228]
mov qword [rsp + 0x38], rax
mov rax, qword [rsp + 0x78]
mov qword [rsp + 0x30], rax
mov eax, dword [rsp + 0x84]
mov dword [rsp + 0x28], eax
mov rax, qword [rsp + 0x88]
mov qword [rsp + 0x20], rax
mov r9d, dword [rsp + 0x1f4]
mov r8d, 3
lea rdx, [rsp + 0x138]
mov rcx, qword [rsp + 0x100]
call qword [sym.imp.Secur32.dll_LsaLogonUser]
mov dword [rsp + 0x70], eax
cmp dword [rsp + 0x70], 0
je 0x140001f82
mov edx, dword [rsp + 0x70]
lea rcx, str.LsaLogonUser_failed__error_0x_x_._n
call fcn.1400010d0
jmp 0x1400020fe
mov r8d, dword [rsp + 0x200]
mov edx, dword [rsp + 0x204]
lea rcx, str.LsaLogonUser:_OK__LogonId:_0x_x_0x_x_n
call fcn.1400010d0
mov dword [rsp + 0x180], 0x68
lea rax, str.winsta0default
mov qword [rsp + 0x190], rax
mov r8d, 0x208
mov edx, 8
mov rcx, qword [0x14001dbd0]
call qword [sym.imp.KERNEL32.dll_HeapAlloc]
mov qword [rsp + 0xa8], rax
cmp qword [rsp + 0xa8], 0
jne 0x14000201c
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [rsp + 0xd8], eax
mov ecx, 2
call fcn.140003e58
mov ecx, dword [rsp + 0xd8]
mov r8d, ecx
lea rdx, str.HeapAlloc_failed__error__u_.
mov rcx, rax
call fcn.140001060
jmp 0x1400020fe
mov r8d, 0x104
mov rdx, qword [rsp + 0xa8]
mov rcx, qword [rsp + 0xf8]
call qword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
test eax, eax
jne 0x140002076
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [rsp + 0xdc], eax
mov ecx, 2
call fcn.140003e58
mov ecx, dword [rsp + 0xdc]
mov r8d, ecx
lea rdx, str.ExpandEnvironmentStrings_failed__error__u_.
mov rcx, rax
call fcn.140001060
jmp 0x1400020fe
lea rax, [rsp + 0x160]
mov qword [rsp + 0x50], rax
lea rax, [rsp + 0x180]
mov qword [rsp + 0x48], rax
lea rax, [0x14001a260]
mov qword [rsp + 0x40], rax
mov qword [rsp + 0x38], 0
mov dword [rsp + 0x30], 0x30
mov dword [rsp + 0x28], 0
mov qword [rsp + 0x20], 0
xor r9d, r9d
mov r8, qword [rsp + 0xa8]
xor edx, edx
mov rcx, qword [rsp + 0x120]
call qword [sym.imp.ADVAPI32.dll_CreateProcessAsUserW]
mov dword [rsp + 0x80], eax
cmp dword [rsp + 0x80], 0
jne 0x1400020fe
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, eax
lea rcx, str.CreateProcessAsUser_failed__error__u_._n
call fcn.1400010d0
cmp qword [rsp + 0x150], 0
je 0x140002120
mov r8, qword [rsp + 0x150]
xor edx, edx
mov rcx, qword [0x14001dbd0]
call qword [sym.imp.KERNEL32.dll_HeapFree]
cmp qword [rsp + 0x140], 0
je 0x140002142
mov r8, qword [rsp + 0x140]
xor edx, edx
mov rcx, qword [0x14001dbd0]
call qword [sym.imp.KERNEL32.dll_HeapFree]
cmp qword [rsp + 0x108], 0
je 0x140002164
mov r8, qword [rsp + 0x108]
xor edx, edx
mov rcx, qword [0x14001dbd0]
call qword [sym.imp.KERNEL32.dll_HeapFree]
cmp qword [rsp + 0x118], 0
je 0x14000217d
mov rcx, qword [rsp + 0x118]
call qword [sym.imp.KERNEL32.dll_LocalFree]
cmp qword [rsp + 0x88], 0
je 0x14000219f
mov r8, qword [rsp + 0x88]
xor edx, edx
mov rcx, qword [0x14001dbd0]
call qword [sym.imp.KERNEL32.dll_HeapFree]
cmp qword [rsp + 0x78], 0
je 0x1400021bb
mov r8, qword [rsp + 0x78]
xor edx, edx
mov rcx, qword [0x14001dbd0]
call qword [sym.imp.KERNEL32.dll_HeapFree]
cmp qword [rsp + 0x128], 0
je 0x1400021d4
mov rcx, qword [rsp + 0x128]
call qword [sym.imp.Secur32.dll_LsaFreeReturnBuffer]
cmp qword [rsp + 0x100], 0
je 0x1400021ed
mov rcx, qword [rsp + 0x100]
call qword [sym.imp.ADVAPI32.dll_LsaClose]
cmp qword [rsp + 0x110], 0
je 0x140002206
mov rcx, qword [rsp + 0x110]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
cmp qword [rsp + 0x120], 0
je 0x14000221f
mov rcx, qword [rsp + 0x120]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
cmp qword [rsp + 0x160], 0
je 0x140002238
mov rcx, qword [rsp + 0x160]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
cmp qword [rsp + 0x168], 0
je 0x140002251
mov rcx, qword [rsp + 0x168]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
xor eax, eax
mov rcx, qword [rsp + 0x390]
xor rcx, rsp
call fcn.140002280
add rsp, 0x3a0
pop rdi
ret