Function at 0x428db0
Capabilities:
Get session information
Get session user name
Query environment variable

Disassembly:
push 0xffffffffffffffff
push 0x49f301
mov eax, dword fs:[0]
push eax
sub esp, 0x444
mov eax, dword [0x4d6720]
xor eax, esp
mov dword [esp + 0x440], eax
push ebx
push ebp
push esi
push edi
mov eax, dword [0x4d6720]
xor eax, esp
push eax
lea eax, [esp + 0x458]
mov dword fs:[0], eax
mov edi, dword [esp + 0x468]
xor ebx, ebx
lea ecx, [esp + 0x38]
mov dword [esp + 0x34], edi
mov dword [esp + 0x30], ebx
mov dword [esp + 0x14], ebx
call fcn.0041f9c0
lea eax, [esp + 0x24]
push eax
mov dword [esp + 0x464], ebx
mov dword [esp + 0x28], 0xffffffff
call dword [sym.imp.KERNEL32.dll_GetCurrentProcessId]
push eax
call dword [sym.imp.KERNEL32.dll_ProcessIdToSessionId]
test eax, eax
je 0x4290e2
call fcn.00468b49
xor ecx, ecx
cmp eax, ebx
setne cl
cmp ecx, ebx
jne 0x428e4c
push 0x80004005
call fcn.00401210
mov edx, dword [eax]
mov ecx, eax
mov eax, dword [edx + 0xc]
call eax
lea esi, [eax + 0x10]
mov dword [esp + 0x2c], esi
mov byte [esp + 0x460], 1
call fcn.00468b49
xor ecx, ecx
cmp eax, ebx
setne cl
cmp ecx, ebx
jne 0x428e7e
push 0x80004005
call fcn.00401210
mov edx, dword [eax]
mov ecx, eax
mov eax, dword [edx + 0xc]
call eax
lea ebp, [eax + 0x10]
mov dword [esp + 0x1c], ebp
lea edx, [esp + 0x18]
push edx
xor ecx, ecx
lea eax, [esp + 0x24]
push eax
mov word [esp + 0x50], cx
mov ecx, dword [esp + 0x2c]
push 5
push ecx
push ebx
mov byte [esp + 0x474], 2
mov dword [esp + 0x2c], ebx
mov dword [esp + 0x34], ebx
call sub.WTSAPI32.dll_WTSQuerySessionInformationW
test eax, eax
je 0x42907d
mov ecx, dword [esp + 0x20]
cmp ecx, ebx
je 0x429099
mov eax, dword [esp + 0x18]
push eax
push ecx
shr eax, 1
push eax
lea ecx, [esp + 0x38]
call fcn.004051a0
push eax
call fcn.00484120
mov esi, dword [esp + 0x38]
mov eax, dword [esi - 8]
push eax
push esi
call fcn.00483313
add esp, 0x14
cmp eax, ebx
jl 0x429073
cmp eax, dword [esi - 8]
jg 0x429073
mov dword [esi - 0xc], eax
xor edx, edx
mov word [esi + eax*2], dx
lea eax, [esp + 0x2c]
push eax
lea ecx, [esp + 0x3c]
call fcn.00401a50
cmp dword [esi - 0xc], ebx
je 0x429087
mov eax, dword [esp + 0x24]
lea ecx, [esp + 0x18]
push ecx
lea edx, [esp + 0x2c]
push edx
push 7
push eax
push ebx
mov dword [esp + 0x3c], ebx
call sub.WTSAPI32.dll_WTSQuerySessionInformationW
test eax, eax
je 0x429059
mov ecx, dword [esp + 0x28]
cmp ecx, ebx
je 0x429087
mov eax, dword [esp + 0x18]
push eax
push ecx
shr eax, 1
push eax
lea ecx, [esp + 0x28]
call fcn.004051a0
push eax
call fcn.00484120
add esp, 0xc
push 0xffffffffffffffff
lea ecx, [esp + 0x20]
call fcn.00405150
lea ecx, [esp + 0x1c]
push ecx
lea ecx, [esp + 0x40]
call fcn.00401a50
mov ebp, dword [esp + 0x1c]
cmp dword [ebp - 0xc], ebx
je 0x429063
lea edx, [esp + 0x18]
push edx
lea eax, [esp + 0x4c]
push eax
mov dword [esp + 0x20], 0x101
call dword [sym.imp.ADVAPI32.dll_GetUserNameW]
xor ecx, ecx
lea edx, [esp + 0x48]
mov word [esp + 0x248], cx
push edx
lea ecx, [esp + 0x44]
call fcn.00401d90
cmp word [esp + 0x48], bx
je 0x429059
push 0x104
lea ecx, [esp + 0x250]
push ecx
xor eax, eax
push str.USERDOMAIN
mov word [esp + 0x258], ax
call dword [sym.imp.KERNEL32.dll_GetEnvironmentVariableW]
lea eax, [esp + 0x24c]
xor edx, edx
push eax
lea ecx, [esp + 0x48]
mov word [esp + 0x456], dx
call fcn.00401d90
cmp word [esp + 0x24c], bx
je 0x429059
mov edi, dword [sym.imp.KERNEL32.dll_lstrcmpiW]
lea ecx, [esp + 0x48]
push ecx
push esi
call edi
test eax, eax
jne 0x42904b
lea edx, [esp + 0x24c]
push edx
push ebp
call edi
test eax, eax
jne 0x42904b
mov edi, dword [esp + 0x34]
mov dword [esp + 0x30], 1
jmp 0x429063
mov edi, dword [esp + 0x34]
mov dword [esp + 0x30], 2
jmp 0x429063
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [esp + 0x14], eax
mov eax, dword [esp + 0x28]
cmp eax, ebx
je 0x429087
push eax
call sub.WTSAPI32.dll_WTSFreeMemory
jmp 0x429087
push 0x80070057
call fcn.00401210
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [esp + 0x14], eax
mov eax, dword [esp + 0x20]
cmp eax, ebx
je 0x429099
push eax
call sub.WTSAPI32.dll_WTSFreeMemory
mov dword [esp + 0x20], ebx
lea eax, [ebp - 0x10]
mov byte [esp + 0x460], 1
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x4290bd
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
lea eax, [esi - 0x10]
mov byte [esp + 0x460], bl
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x4290ec
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
jmp 0x4290ec
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [esp + 0x14], eax
cmp edi, ebx
je 0x429123
lea ecx, [esp + 0x38]
push ecx
mov ecx, edi
call fcn.00401a50
lea edx, [esp + 0x3c]
push edx
lea ecx, [edi + 4]
call fcn.00401a50
lea eax, [esp + 0x40]
push eax
lea ecx, [edi + 8]
call fcn.00401a50
lea ecx, [esp + 0x44]
push ecx
lea ecx, [edi + 0xc]
call fcn.00401a50
mov edx, dword [esp + 0x14]
push edx
call dword [sym.imp.KERNEL32.dll_SetLastError]
lea ecx, [esp + 0x38]
call fcn.0041fa50
mov eax, dword [esp + 0x30]
mov ecx, dword [esp + 0x458]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
pop ebx
mov ecx, dword [esp + 0x440]
xor ecx, esp
call fcn.00482b5f
add esp, 0x450
ret