Function at 0x59cf00
Capabilities:
Compare security identifiers
Enumerate process modules
Get common file path
Get session information
Get session user name
Get user security identifier

Disassembly:
push ebp
mov ebp, esp
mov eax, 0x173c
call fcn.0041ead0
mov eax, dword [0x70f200]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 8]
push ebx
push esi
push edi
mov edi, ecx
mov dword [ebp - 0x1738], edx
mov dword [ebp - 0x1734], eax
test edi, edi
je 0x59d37a
call dword [sym.imp.KERNEL32.dll_WTSGetActiveConsoleSessionId]
mov ebx, eax
mov dword [ebp - 0x173c], ebx
cmp ebx, 0xffffffff
je 0x59d37a
lea eax, [ebp - 0x1710]
mov dword [ebp - 0x1710], 0
push eax
lea eax, [ebp - 0x1730]
mov dword [ebp - 0x1730], 0
push eax
push 5
push ebx
push 0
mov dword [ebp - 0x172c], 0
call dword [sym.imp.WTSAPI32.dll_WTSQuerySessionInformationW]
test eax, eax
je 0x59d37a
mov eax, dword [ebp - 0x1710]
test eax, eax
je 0x59d37a
mov esi, dword [ebp - 0x1730]
push eax
push esi
push edi
call fcn.0041fb10
add esp, 0xc
push esi
call dword [sym.imp.WTSAPI32.dll_WTSFreeMemory]
push 0x100
lea eax, [ebp - 0x104]
mov dword [ebp - 0x1720], 0x100
push 0
push eax
call fcn.00420090
add esp, 0xc
mov dword [ebp - 0x171c], 0x104
lea eax, [ebp - 0x1724]
push eax
lea eax, [ebp - 0x171c]
push eax
lea eax, [ebp - 0x70c]
push eax
lea eax, [ebp - 0x1720]
push eax
lea eax, [ebp - 0x104]
push eax
push edi
push 0
call dword [sym.imp.ADVAPI32.dll_LookupAccountNameW]
test eax, eax
je 0x59d37a
push 0x400
lea eax, [ebp - 0x504]
mov dword [ebp - 0x1728], 0xffffffff
push 0
push eax
or esi, 0xffffffff
call fcn.00420090
add esp, 0xc
mov dword [ebp - 0x1710], 0x400
call dword [sym.imp.KERNEL32.dll_GetCurrentProcessId]
mov edi, dword [sym.imp.KERNEL32.dll_ProcessIdToSessionId]
lea ecx, [ebp - 0x1718]
push ecx
push eax
call edi
test eax, eax
je 0x59d14f
cmp dword [ebp - 0x1718], ebx
jne 0x59d14f
lea eax, [ebp - 0x1728]
push eax
push 8
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
push eax
call dword [sym.imp.ADVAPI32.dll_OpenProcessToken]
mov eax, dword [ebp - 0x1728]
cmp eax, esi
je 0x59d14f
test eax, eax
je 0x59d14f
lea ecx, [ebp - 0x1710]
push ecx
push 0x400
lea ecx, [ebp - 0x504]
push ecx
push 1
push eax
call dword [sym.imp.ADVAPI32.dll_GetTokenInformation]
test eax, eax
je 0x59d14f
lea eax, [ebp - 0x104]
push eax
push dword [ebp - 0x504]
call dword [sym.imp.ADVAPI32.dll_EqualSid]
test eax, eax
je 0x59d14f
mov ebx, dword [ebp - 0x1734]
test ebx, ebx
je 0x59d116
lea eax, [ebp - 0x172c]
push eax
push dword [ebp - 0x504]
call dword [sym.imp.ADVAPI32.dll_ConvertSidToStringSidW]
test eax, eax
je 0x59d116
mov edi, dword [ebp - 0x172c]
mov ecx, edi
call fcn.005d8c40
lea eax, [eax*2 + 2]
push eax
push edi
push ebx
call fcn.0041fb10
add esp, 0xc
push edi
call dword [sym.imp.KERNEL32.dll_LocalFree]
mov eax, dword [ebp - 0x1738]
test eax, eax
je 0x59d133
push eax
push 0
push dword [ebp - 0x1728]
push 0x28
push 0
call dword [sym.imp.SHELL32.dll_SHGetFolderPathW]
push 0x55
call dword [sym.imp.KERNEL32.dll_SetLastError]
mov ebx, dword [ebp - 0x1728]
or eax, 0xffffffff
mov dword [ebp - 0x1728], eax
jmp 0x59d2b4
lea eax, [ebp - 0x1714]
mov dword [ebp - 0x1714], 0x1000
push eax
push 0x1000
lea eax, [ebp - 0x170c]
push eax
call dword [sym.imp.KERNEL32.dll_K32EnumProcesses]
xor ebx, ebx
test eax, eax
je 0x59d2ae
mov eax, dword [ebp - 0x1714]
shr eax, 2
mov dword [ebp - 0x1714], eax
test eax, eax
je 0x59d2ac
nop dword [eax]
nop word [eax + eax]
lea eax, [ebp - 0x1718]
push eax
push dword [ebp + ebx*4 - 0x170c]
call edi
test eax, eax
je 0x59d29f
mov eax, dword [ebp - 0x173c]
cmp dword [ebp - 0x1718], eax
jne 0x59d29f
push dword [ebp + ebx*4 - 0x170c]
push 0
push 0x400
call dword [sym.imp.KERNEL32.dll_OpenProcess]
mov edi, eax
cmp esi, 0xffffffff
je 0x59d1f0
test esi, esi
je 0x59d1f0
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
test edi, edi
jne 0x59d1fc
or esi, 0xffffffff
jmp 0x59d299
mov esi, edi
cmp edi, 0xffffffff
je 0x59d299
mov eax, dword [ebp - 0x1728]
cmp eax, 0xffffffff
je 0x59d227
test eax, eax
je 0x59d227
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [ebp - 0x1728], 0xffffffff
lea eax, [ebp - 0x1728]
mov esi, edi
push eax
push 8
push edi
call dword [sym.imp.ADVAPI32.dll_OpenProcessToken]
test eax, eax
je 0x59d299
push 0x400
lea eax, [ebp - 0x504]
push 0
push eax
call fcn.00420090
add esp, 0xc
mov dword [ebp - 0x1710], 0x400
lea eax, [ebp - 0x1710]
push eax
push 0x400
lea eax, [ebp - 0x504]
push eax
push 1
push dword [ebp - 0x1728]
call dword [sym.imp.ADVAPI32.dll_GetTokenInformation]
test eax, eax
je 0x59d299
lea eax, [ebp - 0x104]
push eax
push dword [ebp - 0x504]
call dword [sym.imp.ADVAPI32.dll_EqualSid]
test eax, eax
jne 0x59d2d9
mov edi, dword [sym.imp.KERNEL32.dll_ProcessIdToSessionId]
inc ebx
cmp ebx, dword [ebp - 0x1714]
jb 0x59d1a0
xor ebx, ebx
mov eax, dword [ebp - 0x1728]
cmp esi, 0xffffffff
je 0x59d353
test esi, esi
je 0x59d353
push esi
mov esi, dword [sym.imp.KERNEL32.dll_CloseHandle]
call esi
mov eax, dword [ebp - 0x1728]
jmp 0x59d359
mov ebx, dword [ebp - 0x1734]
test ebx, ebx
je 0x59d320
lea eax, [ebp - 0x172c]
push eax
push dword [ebp - 0x504]
call dword [sym.imp.ADVAPI32.dll_ConvertSidToStringSidW]
test eax, eax
je 0x59d320
mov esi, dword [ebp - 0x172c]
mov ecx, esi
call fcn.005d8c40
lea eax, [eax*2 + 2]
push eax
push esi
push ebx
call fcn.0041fb10
add esp, 0xc
push esi
call dword [sym.imp.KERNEL32.dll_LocalFree]
mov eax, dword [ebp - 0x1738]
test eax, eax
je 0x59d33d
push eax
push 0
push dword [ebp - 0x1728]
push 0x28
push 0
call dword [sym.imp.SHELL32.dll_SHGetFolderPathW]
mov ebx, dword [ebp - 0x1728]
or eax, 0xffffffff
mov dword [ebp - 0x1728], eax
mov esi, edi
jmp 0x59d2b4
mov esi, dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp eax, 0xffffffff
je 0x59d365
test eax, eax
je 0x59d365
push eax
call esi
pop edi
pop esi
mov eax, ebx
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0041e1b5
mov esp, ebp
pop ebp
ret 4
mov ecx, dword [ebp - 4]
xor eax, eax
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.0041e1b5
mov esp, ebp
pop ebp
ret 4