Function at 0x104a560
Capabilities:
Impersonate user

Disassembly:
mov qword [rsp + 0x10], rdx
mov qword [rsp + 8], rcx
push rdi
sub rsp, 0xfa0
mov rax, qword [0x010657f0]
xor rax, rsp
mov qword [rsp + 0xf90], rax
movzx eax, word [0x01001c38]
mov word [rsp + 0x50], ax
lea rax, [rsp + 0x52]
mov rdi, rax
xor eax, eax
mov ecx, 0x3fe
rep stosb byte [rdi], al
movzx eax, word [0x01001c38]
mov word [rsp + 0xb80], ax
lea rax, [rsp + 0xb82]
mov rdi, rax
xor eax, eax
mov ecx, 0x3fe
rep stosb byte [rdi], al
movzx eax, word [0x01001c38]
mov word [rsp + 0x780], ax
lea rax, [rsp + 0x782]
mov rdi, rax
xor eax, eax
mov ecx, 0x3fe
rep stosb byte [rdi], al
mov dword [rsp + 0x450], 0
mov rdx, qword [rsp + 0xfb8]
mov rcx, qword [rsp + 0xfb0]
call fcn.01028bf0
mov dword [rsp + 0x450], eax
cmp dword [rsp + 0x450], 0
je 0x104a748
cmp dword [rsp + 0x450], 2
jne 0x104a66b
mov r9d, 0x200
lea r8, [rsp + 0x50]
mov edx, 0x1b5
mov rcx, qword [0x01068158]
call qword [sym.imp.USER32.dll_LoadStringW]
mov rax, qword [rsp + 0xfb8]
mov r9d, dword [rax + 0x4f0]
lea r8, [rsp + 0x50]
mov edx, 0x200
lea rcx, [rsp + 0x780]
call fcn.01015ef0
jmp 0x104a6d6
mov r9d, 0x200
lea r8, [rsp + 0x50]
mov edx, 0x1b3
mov rcx, qword [0x01068158]
call qword [sym.imp.USER32.dll_LoadStringW]
mov rax, qword [rsp + 0xfb8]
add rax, 0x10c
mov rcx, qword [rsp + 0xfb8]
add rcx, 0x656
mov qword [rsp + 0x28], rax
mov rax, qword [rsp + 0xfb8]
mov eax, dword [rax + 0x4f0]
mov dword [rsp + 0x20], eax
mov r9, rcx
lea r8, [rsp + 0x50]
mov edx, 0x200
lea rcx, [rsp + 0x780]
call fcn.01015ef0
mov r9d, 0x200
lea r8, [rsp + 0x50]
mov edx, 0xdb
mov rcx, qword [0x01068158]
call qword [sym.imp.USER32.dll_LoadStringW]
lea rax, [rsp + 0x780]
mov qword [rsp + 0x20], rax
mov rax, qword [rsp + 0xfb8]
mov r9d, dword [rax]
lea r8, [rsp + 0x50]
mov edx, 0xfa0
mov rax, qword [rsp + 0xfb8]
mov rcx, qword [rax + 0x990]
call fcn.01015ef0
mov rax, qword [rsp + 0xfb8]
mov rax, qword [rax + 0x990]
mov word [rax + 0x1f3e], 0
xor eax, eax
jmp 0x104abb3
lea r8, [rsp + 0x460]
mov rax, qword [rsp + 0xfb8]
mov edx, dword [rax + 0x4f0]
mov rcx, qword [rsp + 0xfb0]
call fcn.010289e0
test eax, eax
je 0x104aaf1
lea rdx, [rsp + 0x460]
mov rcx, qword [rsp + 0xfb0]
call fcn.010298e0
test eax, eax
je 0x104aa26
mov qword [rsp + 0xf80], 0
lea rax, [rsp + 0xf80]
mov qword [rsp + 0x28], rax
mov dword [rsp + 0x20], 0
mov r9d, 8
lea r8, [rsp + 0x670]
lea rdx, [rsp + 0x568]
lea rcx, [rsp + 0x460]
call qword [sym.imp.ADVAPI32.dll_LogonUserW]
test eax, eax
je 0x104a887
mov rax, qword [rsp + 0xfb8]
add rax, 0x778
mov qword [rsp + 0x28], rax
mov dword [rsp + 0x20], 1
xor r9d, r9d
xor r8d, r8d
xor edx, edx
mov rcx, qword [rsp + 0xf80]
call qword [sym.imp.ADVAPI32.dll_DuplicateTokenEx]
test eax, eax
je 0x104a887
mov rax, qword [rsp + 0xfb8]
add rax, 0x780
lea r8, [rsp + 0x460]
mov edx, 0x84
mov rcx, rax
call fcn.01013c30
mov rax, qword [rsp + 0xfb8]
add rax, 0x888
lea r8, [rsp + 0x568]
mov edx, 0x84
mov rcx, rax
call fcn.01013c30
mov edx, 0x31c
lea rcx, [rsp + 0x460]
call fcn.01029df0
mov rcx, qword [rsp + 0xf80]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, 1
jmp 0x104abb3
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [rsp + 0xf88], eax
mov qword [rsp + 0x30], 0
mov dword [rsp + 0x28], 0x1ff
lea rax, [rsp + 0x50]
mov qword [rsp + 0x20], rax
mov r9d, 0x400
mov r8d, dword [rsp + 0xf88]
xor edx, edx
mov ecx, 0x3000
call qword [sym.imp.KERNEL32.dll_FormatMessageW]
cmp dword [rsp + 0xf88], 0x569
jne 0x104a932
mov r9d, 0x200
lea r8, [rsp + 0xb80]
mov edx, 0x1b6
mov rcx, qword [0x01068158]
call qword [sym.imp.USER32.dll_LoadStringW]
lea rax, [rsp + 0x50]
mov qword [rsp + 0x28], rax
lea rax, [rsp + 0x460]
mov qword [rsp + 0x20], rax
lea r9, [rsp + 0x568]
lea r8, [rsp + 0xb80]
mov edx, 0x200
lea rcx, [rsp + 0x780]
call fcn.01015ef0
jmp 0x104a98b
mov r9d, 0x200
lea r8, [rsp + 0xb80]
mov edx, 0x1b1
mov rcx, qword [0x01068158]
call qword [sym.imp.USER32.dll_LoadStringW]
lea rax, [rsp + 0x50]
mov qword [rsp + 0x28], rax
lea rax, [rsp + 0x460]
mov qword [rsp + 0x20], rax
lea r9, [rsp + 0x568]
lea r8, [rsp + 0xb80]
mov edx, 0x200
lea rcx, [rsp + 0x780]
call fcn.01015ef0
mov r9d, 0x200
lea r8, [rsp + 0x50]
mov edx, 0xdb
mov rcx, qword [0x01068158]
call qword [sym.imp.USER32.dll_LoadStringW]
lea rax, [rsp + 0x780]
mov qword [rsp + 0x20], rax
mov rax, qword [rsp + 0xfb8]
mov r9d, dword [rax]
lea r8, [rsp + 0x50]
mov edx, 0xfa0
mov rax, qword [rsp + 0xfb8]
mov rcx, qword [rax + 0x990]
call fcn.01015ef0
mov rax, qword [rsp + 0xfb8]
mov rax, qword [rax + 0x990]
mov word [rax + 0x1f3e], 0
mov edx, 0x31c
lea rcx, [rsp + 0x460]
call fcn.01029df0
cmp qword [rsp + 0xf80], 0
je 0x104aa21
mov rcx, qword [rsp + 0xf80]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x104aaec
mov r9d, 0x200
lea r8, [rsp + 0xb80]
mov edx, 0x1b1
mov rcx, qword [0x01068158]
call qword [sym.imp.USER32.dll_LoadStringW]
lea rax, [0x010064c0]
mov qword [rsp + 0x28], rax
lea rax, [rsp + 0x460]
mov qword [rsp + 0x20], rax
lea r9, [rsp + 0x568]
lea r8, [rsp + 0xb80]
mov edx, 0x200
lea rcx, [rsp + 0x780]
call fcn.01015ef0
mov r9d, 0x200
lea r8, [rsp + 0x50]
mov edx, 0xdb
mov rcx, qword [0x01068158]
call qword [sym.imp.USER32.dll_LoadStringW]
lea rax, [rsp + 0x780]
mov qword [rsp + 0x20], rax
mov rax, qword [rsp + 0xfb8]
mov r9d, dword [rax]
lea r8, [rsp + 0x50]
mov edx, 0xfa0
mov rax, qword [rsp + 0xfb8]
mov rcx, qword [rax + 0x990]
call fcn.01015ef0
mov rax, qword [rsp + 0xfb8]
mov rax, qword [rax + 0x990]
mov word [rax + 0x1f3e], 0
jmp 0x104abb1
mov r9d, 0x200
lea r8, [rsp + 0x50]
mov edx, 0x1b2
mov rcx, qword [0x01068158]
call qword [sym.imp.USER32.dll_LoadStringW]
mov rax, qword [rsp + 0xfb8]
mov r9d, dword [rax + 0x4f0]
lea r8, [rsp + 0x50]
mov edx, 0x200
lea rcx, [rsp + 0x780]
call fcn.01015ef0
mov r9d, 0x200
lea r8, [rsp + 0x50]
mov edx, 0xdb
mov rcx, qword [0x01068158]
call qword [sym.imp.USER32.dll_LoadStringW]
lea rax, [rsp + 0x780]
mov qword [rsp + 0x20], rax
mov rax, qword [rsp + 0xfb8]
mov r9d, dword [rax]
lea r8, [rsp + 0x50]
mov edx, 0xfa0
mov rax, qword [rsp + 0xfb8]
mov rcx, qword [rax + 0x990]
call fcn.01015ef0
mov rax, qword [rsp + 0xfb8]
mov rax, qword [rax + 0x990]
mov word [rax + 0x1f3e], 0
mov edx, 0x31c
lea rcx, [rsp + 0x460]
call fcn.01029df0
xor eax, eax
mov rcx, qword [rsp + 0xf90]
xor rcx, rsp
call fcn.010588f0
add rsp, 0xfa0
pop rdi
ret