Function at 0x479cf0
Capabilities:
Get session information
Get session user name
Print debug messages

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x4a495e
mov eax, dword fs:[0]
push eax
sub esp, 0x214
mov eax, dword [0x50c0b4]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov esi, dword [ebp + 8]
mov ebx, dword [ebp + 0xc]
mov dword [ebp - 0x168], 0
lea ecx, [ebp - 0x1b4]
mov dword [ebp - 4], 0
mov dword [ebp - 0x16c], esi
mov dword [ebp - 0x21c], 0x4b337c
mov dword [ebp - 0x20c], 0x4b3384
call dword [sym.imp.MSVCP110.dll_protected:_void___thiscall_std::basic_ios_char__struct_std::char_traits_char__::constructor_void_]
push 0
lea eax, [ebp - 0x204]
push eax
lea ecx, [ebp - 0x21c]
mov dword [ebp - 4], 1
mov dword [ebp - 0x168], 2
call dword [sym.imp.MSVCP110.dll_public:_void___thiscall_std::basic_iostream_char__struct_std::char_traits_char__::constructor_class_std::basic_streambuf_char__struct_std::char_traits_char____]
mov eax, dword [ebp - 0x21c]
mov dword [ebp - 4], 2
mov eax, dword [eax + 4]
mov dword [ebp + eax - method.std::basic_stringstream_char__struct_std::char_traits_char___class_std::allocator_char__.virtual_0], vtable.std::basic_stringstream_char__struct_std::char_traits_char___class_std::allocator_char__.0
mov eax, dword [ebp - 0x21c]
mov ecx, dword [eax + 4]
lea eax, [ecx - 0x68]
mov dword [ebp + ecx - 0x220], eax
lea ecx, [ebp - 0x204]
call dword [sym.imp.MSVCP110.dll_protected:_void___thiscall_std::basic_streambuf_char__struct_std::char_traits_char__::constructor_void_]
mov dword [ebp - method.std::basic_stringbuf_char__struct_std::char_traits_char___class_std::allocator_char__.virtual_0], vtable.std::basic_stringbuf_char__struct_std::char_traits_char___class_std::allocator_char__.0
mov dword [ebp - 0x1cc], 0
mov dword [ebp - 0x1c8], 0
xor eax, eax
mov dword [esi + 0x14], 7
mov dword [esi + 0x10], 0
mov dword [ebp - 4], 4
mov word [esi], ax
mov dword [ebp - 0x160], eax
mov dword [ebp - 0x164], eax
lea eax, [ebp - 0x164]
push eax
lea eax, [ebp - 0x160]
push eax
push 5
push ebx
push 0
mov dword [ebp - 0x168], 3
call sub.WTSAPI32.dll_WTSQuerySessionInformationW
test eax, eax
je 0x479f84
push dword [ebp - 0x160]
lea ecx, [ebp - 0x15c]
call fcn.0046e780
mov edx, dword [eax]
mov byte [ebp - 4], 5
cmp word [edx], 0
jne 0x479e4a
xor ecx, ecx
jmp 0x479e5f
mov ecx, edx
lea edi, [ecx + 2]
nop
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x479e50
sub ecx, edi
sar ecx, 1
push ecx
push edx
mov ecx, esi
call fcn.0043a040
mov eax, dword [ebp - 0x15c]
mov edi, dword [sym.imp.MSVCR110.dll_free]
lea ecx, [ebp - 0x158]
mov byte [ebp - 4], 4
cmp eax, ecx
je 0x479e88
push eax
call edi
add esp, 4
push dword [ebp - 0x160]
call sub.WTSAPI32.dll_WTSFreeMemory
cmp byte [ebp + 0x10], 0
je 0x47a016
lea eax, [ebp - 0x164]
push eax
lea eax, [ebp - 0x160]
push eax
push 7
push ebx
push 0
mov dword [ebp - 0x160], 0
mov dword [ebp - 0x164], 0
call sub.WTSAPI32.dll_WTSQuerySessionInformationW
test eax, eax
je 0x479f60
push dword [ebp - 0x160]
lea ecx, [ebp - 0x15c]
call fcn.0046e780
push dword [eax]
lea ecx, [ebp - 0x28]
mov byte [ebp - 4], 6
call fcn.00422fb0
mov eax, dword [ebp - 0x15c]
lea ecx, [ebp - 0x158]
mov byte [ebp - 4], 8
cmp eax, ecx
je 0x479f0a
push eax
call edi
add esp, 4
cmp dword [ebp - 0x18], 0
je 0x479f4c
push 0x4b1d78
lea eax, [ebp - 0x28]
push eax
lea eax, [ebp - 0x58]
push eax
call fcn.0046ae40
push esi
push eax
lea eax, [ebp - 0x40]
push eax
mov byte [ebp - 4], 9
call fcn.0046ae10
add esp, 0x18
mov ecx, esi
push eax
call fcn.0042f080
lea ecx, [ebp - 0x40]
call fcn.0042a480
lea ecx, [ebp - 0x58]
call fcn.0042a480
push dword [ebp - 0x160]
call sub.WTSAPI32.dll_WTSFreeMemory
cmp dword [ebp - 0x14], 8
jmp 0x47a009
push dword [sym.imp.MSVCP110.dll_class_std::basic_ostream_char__struct_std::char_traits_char______cdecl_std::endl_class_std::basic_ostream_char__struct_std::char_traits_char____]
push 0x4b23cc
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push 0x442c30
push 0x4b338c
push ebx
push str.____Error__Failed_to_get_domain_name_for_session
jmp 0x479fa6
push dword [sym.imp.MSVCP110.dll_class_std::basic_ostream_char__struct_std::char_traits_char______cdecl_std::endl_class_std::basic_ostream_char__struct_std::char_traits_char____]
push 0x4b23cc
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push 0x442c30
push 0x4b338c
push ebx
push str.____Error__Failed_to_get_user_name_for_session
lea eax, [ebp - 0x20c]
push eax
call fcn.00409c40
add esp, 8
mov ecx, eax
call dword [sym.imp.MSVCP110.dll_public:_class_std::basic_ostream_char__struct_std::char_traits_char______thiscall_std::basic_ostream_char__struct_std::char_traits_char__::operator___unsigned_long_int_]
push eax
call fcn.00409c40
add esp, 8
mov ecx, eax
call dword [sym.imp.MSVCP110.dll_public:_class_std::basic_ostream_char__struct_std::char_traits_char______thiscall_std::basic_ostream_char__struct_std::char_traits_char__::operator___class_std::ios_base_____cdecl___class_std::ios_base___]
mov ecx, eax
call dword [sym.imp.MSVCP110.dll_public:_class_std::basic_ostream_char__struct_std::char_traits_char______thiscall_std::basic_ostream_char__struct_std::char_traits_char__::operator___unsigned_long_int_]
push eax
call fcn.00409c40
add esp, 8
mov ecx, eax
call dword [sym.imp.MSVCP110.dll_public:_class_std::basic_ostream_char__struct_std::char_traits_char______thiscall_std::basic_ostream_char__struct_std::char_traits_char__::operator___class_std::basic_ostream_char__struct_std::char_traits_char_______cdecl___class_std::basic_ostream_char__struct_std::char_traits_char_____]
lea eax, [ebp - 0x28]
push eax
lea ecx, [ebp - 0x21c]
call fcn.0047d770
cmp dword [eax + 0x14], 0x10
jb 0x479ffe
mov eax, dword [eax]
push eax
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
cmp dword [ebp - 0x14], 0x10
jb 0x47a016
push dword [ebp - 0x28]
call sub.MSVCR110.dll_void___cdecl_operator_delete_void__
add esp, 4
mov eax, dword [ebp - 0x21c]
mov byte [ebp - 4], 0
mov eax, dword [eax + 4]
mov dword [ebp + eax - method.std::basic_stringstream_char__struct_std::char_traits_char___class_std::allocator_char__.virtual_0], vtable.std::basic_stringstream_char__struct_std::char_traits_char___class_std::allocator_char__.0
mov eax, dword [ebp - 0x21c]
mov ecx, dword [eax + 4]
lea eax, [ecx - 0x68]
mov dword [ebp + ecx - 0x220], eax
lea ecx, [ebp - 0x204]
mov dword [ebp - method.std::basic_stringbuf_char__struct_std::char_traits_char___class_std::allocator_char__.virtual_0], vtable.std::basic_stringbuf_char__struct_std::char_traits_char___class_std::allocator_char__.0
call fcn.00438c60
lea ecx, [ebp - 0x204]
call dword [sym.imp.MSVCP110.dll_public_virtual:_void___thiscall_std::basic_streambuf_char__struct_std::char_traits_char__::destructor_void_]
lea ecx, [ebp - 0x1fc]
call dword [sym.imp.MSVCP110.dll_public_virtual:_void___thiscall_std::basic_iostream_char__struct_std::char_traits_char__::destructor_void_]
lea ecx, [ebp - 0x1b4]
call dword [sym.imp.MSVCP110.dll_public_virtual:_void___thiscall_std::basic_ios_char__struct_std::char_traits_char__::destructor_void_]
mov eax, esi
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.0049a2a4
mov esp, ebp
pop ebp
ret