Function at 0x410640
Capabilities:
Get session information
Get session user name
Get user security identifier

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x41107c
mov eax, dword fs:[0]
push eax
push ecx
sub esp, 0xf0
mov eax, dword [0x4170a0]
xor eax, ebp
mov dword [ebp - 0x28], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov dword [ebp - 0x10], esp
mov dword [ebp - 0x18], 0
mov dword [ebp - 0x50], 0
mov dword [ebp - 0x4c], 0
mov dword [ebp - 0x48], 0
lea ecx, [ebp - 0x44]
call fcn.00401160
mov dword [ebp - 4], 0
mov dword [ebp - 0x14], 0
mov byte [ebp - 0x1d], 0
mov dword [ebp - 0x24], 0
mov dword [ebp - 0x54], 0
push str.GetRealUserSID_Starts...
call fcn.00410030
add esp, 4
mov byte [ebp - 4], 1
push 0x1000
call dword [sym.imp.USER32.dll_GetSystemMetrics]
test eax, eax
jne 0x41083a
call dword [sym.imp.KERNEL32.dll_WTSGetActiveConsoleSessionId]
mov dword [ebp - 0x90], eax
cmp dword [ebp - 0x90], 0xffffffff
jne 0x41070a
mov dword [ebp - 0x94], 0x4142f8
push 0x41532c
lea eax, [ebp - 0x94]
push eax
call fcn.0040498b
lea ecx, [ebp - 0x24]
push ecx
lea edx, [ebp - 0x50]
push edx
push 5
mov eax, dword [ebp - 0x90]
push eax
push 0
call sub.WTSAPI32.dll_WTSQuerySessionInformationW
test eax, eax
je 0x410742
lea ecx, [ebp - 0x24]
push ecx
lea edx, [ebp - 0x4c]
push edx
push 7
mov eax, dword [ebp - 0x90]
push eax
push 0
call sub.WTSAPI32.dll_WTSQuerySessionInformationW
test eax, eax
jne 0x41075d
mov dword [ebp - 0x98], 0x414310
push 0x41532c
lea ecx, [ebp - 0x98]
push ecx
call fcn.0040498b
mov edx, dword [ebp - 0x50]
push edx
lea ecx, [ebp - 0x70]
call fcn.00401190
mov dword [ebp - 0xec], eax
mov byte [ebp - 4], 2
mov eax, dword [ebp - 0x4c]
push eax
lea ecx, [ebp - 0x8c]
call fcn.00401190
mov dword [ebp - 0xf0], eax
mov byte [ebp - 4], 3
push 0x414334
lea ecx, [ebp - 0x8c]
push ecx
lea edx, [ebp - 0xb4]
push edx
call fcn.00401900
add esp, 0xc
mov dword [ebp - 0xf4], eax
mov eax, dword [ebp - 0xf4]
mov dword [ebp - 0xf8], eax
mov byte [ebp - 4], 4
lea ecx, [ebp - 0x70]
push ecx
mov edx, dword [ebp - 0xf8]
push edx
lea eax, [ebp - 0xd0]
push eax
call fcn.00401990
add esp, 0xc
mov dword [ebp - 0xfc], eax
mov ecx, dword [ebp - 0xfc]
mov dword [ebp - 0x100], ecx
mov byte [ebp - 4], 5
mov edx, dword [ebp - 0x100]
push edx
lea ecx, [ebp - 0x44]
call fcn.004011f0
mov byte [ebp - 4], 4
lea ecx, [ebp - 0xd0]
call fcn.004011d0
mov byte [ebp - 4], 3
lea ecx, [ebp - 0xb4]
call fcn.004011d0
mov byte [ebp - 4], 2
lea ecx, [ebp - 0x8c]
call fcn.004011d0
mov byte [ebp - 4], 1
lea ecx, [ebp - 0x70]
call fcn.004011d0
jmp 0x4108c3
mov byte [ebp - 0x1d], 1
lea eax, [ebp - 0x24]
push eax
push 0
push 0xc
call sub.Secur32.dll_GetUserNameExW
mov ecx, dword [ebp - 0x24]
lea edx, [ecx + ecx + 2]
push edx
push 8
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov dword [ebp - 0x50], eax
cmp dword [ebp - 0x50], 0
jne 0x410886
mov dword [ebp - 0xd4], 0x414338
push 0x41532c
lea eax, [ebp - 0xd4]
push eax
call fcn.0040498b
lea ecx, [ebp - 0x24]
push ecx
mov edx, dword [ebp - 0x50]
push edx
push 0xc
call sub.Secur32.dll_GetUserNameExW
movzx eax, al
test eax, eax
jne 0x4108b7
mov dword [ebp - 0xd8], 0x414354
push 0x41532c
lea ecx, [ebp - 0xd8]
push ecx
call fcn.0040498b
mov edx, dword [ebp - 0x50]
push edx
lea ecx, [ebp - 0x44]
call fcn.00401210
mov dword [ebp - 0x24], 0
mov dword [ebp - 0x54], 0
lea eax, [ebp - 0x1c]
push eax
lea ecx, [ebp - 0x54]
push ecx
push 0
lea edx, [ebp - 0x24]
push edx
push 0
lea ecx, [ebp - 0x44]
call fcn.00401230
push eax
push 0
call dword [sym.imp.ADVAPI32.dll_LookupAccountNameW]
mov eax, dword [ebp - 0x24]
push eax
push 8
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov dword [ebp - 0x18], eax
mov ecx, dword [ebp - 0x54]
shl ecx, 1
push ecx
push 8
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov dword [ebp - 0x48], eax
cmp dword [ebp - 0x18], 0
je 0x41092c
cmp dword [ebp - 0x48], 0
jne 0x410947
mov dword [ebp - 0xdc], 0x41436c
push 0x41532c
lea edx, [ebp - 0xdc]
push edx
call fcn.0040498b
lea eax, [ebp - 0x1c]
push eax
lea ecx, [ebp - 0x54]
push ecx
mov edx, dword [ebp - 0x48]
push edx
lea eax, [ebp - 0x24]
push eax
mov ecx, dword [ebp - 0x18]
push ecx
lea ecx, [ebp - 0x44]
call fcn.00401230
push eax
push 0
call dword [sym.imp.ADVAPI32.dll_LookupAccountNameW]
test eax, eax
jne 0x41098b
mov dword [ebp - 0xe0], 0x414388
push 0x41532c
lea edx, [ebp - 0xe0]
push edx
call fcn.0040498b
lea eax, [ebp - 0x14]
push eax
mov ecx, dword [ebp - 0x18]
push ecx
call sub.ADVAPI32.dll_ConvertSidToStringSidW
test eax, eax
jne 0x4109b7
mov dword [ebp - 0xe4], 0x41439c
push 0x41532c
lea edx, [ebp - 0xe4]
push edx
call fcn.0040498b
movzx eax, byte [ebp - 0x1d]
test eax, eax
je 0x4109d2
mov ecx, dword [ebp - 0x50]
push ecx
push 0
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapFree]
mov edx, dword [ebp - 0x18]
push edx
push 0
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapFree]
mov eax, dword [ebp - 0x48]
push eax
push 0
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapFree]
jmp 0x410a72
mov dword [ebp - 4], 0
mov ecx, dword [ebp - 0x14]
push ecx
push str.GetRealUserSID_returns__s
call fcn.00410030
add esp, 8
mov edx, dword [ebp - 0x14]
mov dword [ebp - 0xe8], edx
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x44]
call fcn.004011d0
mov eax, dword [ebp - 0xe8]
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x28]
xor ecx, ebp
call fcn.00403653
mov esp, ebp
pop ebp
ret