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

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x5dd534
mov eax, dword fs:[0]
push eax
sub esp, 0x214
mov eax, dword [0x671330]
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]
lea eax, [ebp - 0xdc]
mov ebx, dword [ebp + 0xc]
push 0xb0
push 0
push eax
mov dword [ebp - 4], 0
mov dword [ebp - 0xe8], esi
mov dword [ebp - 0xe4], 0
call sub.VCRUNTIME140.dll_memset
add esp, 0xc
mov dword [ebp - 0xdc], 0x5f7ce0
lea ecx, [ebp - 0x74]
mov dword [ebp - 0xcc], 0x5f7ce8
call dword [sym.imp.MSVCP140.dll_protected:_void___thiscall_std::basic_ios_char__struct_std::char_traits_char__::constructor_void_]
push 0
lea eax, [ebp - 0xc4]
mov dword [ebp - 4], 1
push eax
lea ecx, [ebp - 0xdc]
mov dword [ebp - 0xe4], 2
call dword [sym.imp.MSVCP140.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 - 0xdc]
mov dword [ebp - 4], 2
mov eax, dword [eax + 4]
mov dword [ebp + eax - 0xdc], vtable.std::basic_stringstream_char__struct_std::char_traits_char___class_std::allocator_char__.0
mov eax, dword [ebp - 0xdc]
mov ecx, dword [eax + 4]
lea eax, [ecx - 0x68]
mov dword [ebp + ecx - 0xe0], eax
lea eax, [ebp - 0xc4]
mov ecx, eax
mov dword [ebp - 0xec], eax
call dword [sym.imp.MSVCP140.dll_protected:_void___thiscall_std::basic_streambuf_char__struct_std::char_traits_char__::constructor_void_]
mov dword [ebp - 0xc4], vtable.std::basic_stringbuf_char__struct_std::char_traits_char___class_std::allocator_char__.0
mov dword [ebp - 0x8c], 0
mov dword [ebp - 0x88], 0
mov dword [esi + 0x10], 0
mov dword [esi + 0x14], 0
mov dword [esi + 0x14], 7
cmp dword [esi + 0x14], 8
mov dword [ebp - 4], 4
mov dword [esi + 0x10], 0
jb 0x542b41
mov eax, dword [esi]
jmp 0x542b43
mov eax, esi
xor ecx, ecx
mov word [eax], cx
lea eax, [ebp - 0x14]
mov dword [ebp - 0xe4], 3
push eax
lea eax, [ebp - 0xe0]
mov dword [ebp - 0xe0], ecx
push eax
push 5
push ebx
push ecx
mov dword [ebp - 0x14], ecx
call sub.WTSAPI32.dll_WTSQuerySessionInformationW
test eax, eax
je 0x542d4d
push dword [ebp - 0xe0]
lea ecx, [ebp - 0x220]
call fcn.0053f960
mov edx, dword [eax]
mov byte [ebp - 4], 5
cmp word [edx], 0
jne 0x542b98
xor ecx, ecx
jmp 0x542baf
mov ecx, edx
lea edi, [ecx + 2]
nop dword [eax]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x542ba0
sub ecx, edi
sar ecx, 1
push ecx
push edx
mov ecx, esi
call fcn.0040b190
mov eax, dword [ebp - 0x220]
lea ecx, [ebp - 0x21c]
mov edi, dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov byte [ebp - 4], 4
cmp eax, ecx
je 0x542bd8
push eax
call edi
add esp, 4
push dword [ebp - 0xe0]
call sub.WTSAPI32.dll_WTSFreeMemory
cmp byte [ebp + 0x10], 0
je 0x542de4
lea eax, [ebp - 0x14]
mov dword [ebp - 0xe0], 0
push eax
lea eax, [ebp - 0xe0]
mov dword [ebp - 0x14], 0
push eax
push 7
push ebx
push 0
call sub.WTSAPI32.dll_WTSQuerySessionInformationW
test eax, eax
je 0x542cba
push dword [ebp - 0xe0]
lea ecx, [ebp - 0x220]
call fcn.0053f960
push dword [eax]
lea ecx, [ebp - 0x2c]
mov byte [ebp - 4], 6
call fcn.0040b2a0
mov eax, dword [ebp - 0x220]
lea ecx, [ebp - 0x21c]
mov byte [ebp - 4], 8
cmp eax, ecx
je 0x542c54
push eax
call edi
add esp, 4
cmp dword [ebp - 0x1c], 0
je 0x542ca2
push 0x5f8474
lea eax, [ebp - 0x2c]
push eax
lea eax, [ebp - 0x104]
push eax
call fcn.004232d0
push esi
push eax
lea eax, [ebp - 0x11c]
mov byte [ebp - 4], 9
push eax
call fcn.00423250
add esp, 0x18
mov ecx, esi
push eax
call fcn.00421880
lea ecx, [ebp - 0x11c]
call fcn.0040a7f0
lea ecx, [ebp - 0x104]
call fcn.0040a7f0
push dword [ebp - 0xe0]
call sub.WTSAPI32.dll_WTSFreeMemory
lea ecx, [ebp - 0x2c]
call fcn.0040a7f0
jmp 0x542de4
push 0x41a100
push 0x6090bc
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push 0x416260
push 0x5f8898
push ebx
lea eax, [ebp - 0xcc]
push str.____Error__Failed_to_get_domain_name_for_session
push eax
call fcn.00414ff0
add esp, 8
mov ecx, eax
call dword [sym.imp.MSVCP140.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.00414ff0
add esp, 8
mov ecx, eax
call dword [sym.imp.MSVCP140.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.MSVCP140.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.00414ff0
add esp, 8
mov ecx, eax
call dword [sym.imp.MSVCP140.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 - 0x104]
push eax
lea ecx, [ebp - 0xdc]
call fcn.00531ae0
cmp dword [eax + 0x14], 0x10
jb 0x542d36
mov eax, dword [eax]
push eax
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
lea ecx, [ebp - 0x104]
call fcn.0040b3b0
jmp 0x542de4
push 0x41a100
push 0x6090bc
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push 0x416260
push 0x5f8898
push ebx
lea eax, [ebp - 0xcc]
push str.____Error__Failed_to_get_user_name_for_session
push eax
call fcn.00414ff0
add esp, 8
mov ecx, eax
call dword [sym.imp.MSVCP140.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.00414ff0
add esp, 8
mov ecx, eax
call dword [sym.imp.MSVCP140.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.MSVCP140.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.00414ff0
add esp, 8
mov ecx, eax
call dword [sym.imp.MSVCP140.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 - 0x2c]
push eax
lea ecx, [ebp - 0xdc]
call fcn.00531ae0
cmp dword [eax + 0x14], 0x10
jb 0x542dc6
mov eax, dword [eax]
push eax
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
mov eax, dword [ebp - 0x18]
cmp eax, 0x10
jb 0x542de4
inc eax
push 1
push eax
push dword [ebp - 0x2c]
call fcn.0040b970
add esp, 0xc
mov eax, dword [ebp - 0xdc]
mov eax, dword [eax + 4]
mov dword [ebp + eax - 0xdc], vtable.std::basic_stringstream_char__struct_std::char_traits_char___class_std::allocator_char__.0
mov eax, dword [ebp - 0xdc]
mov ecx, dword [eax + 4]
lea eax, [ecx - 0x68]
mov dword [ebp + ecx - 0xe0], eax
lea ecx, [ebp - 0xc4]
mov dword [ebp - 4], 0xa
mov dword [ebp - 0xc4], vtable.std::basic_stringbuf_char__struct_std::char_traits_char___class_std::allocator_char__.0
call fcn.004160a0
lea ecx, [ebp - 0xc4]
call dword [sym.imp.MSVCP140.dll_public_virtual:_void___thiscall_std::basic_streambuf_char__struct_std::char_traits_char__::destructor_void_]
lea ecx, [ebp - 0xbc]
call dword [sym.imp.MSVCP140.dll_public_virtual:_void___thiscall_std::basic_iostream_char__struct_std::char_traits_char__::destructor_void_]
lea ecx, [ebp - 0x74]
call dword [sym.imp.MSVCP140.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.00544286
mov esp, ebp
pop ebp
ret