Function at 0x4c09d0
Capabilities:
Get session user name
Get token membership

Disassembly:
push ebp
mov ebp, esp
push ebx
push edi
push esi
sub esp, 0x25c
mov ecx, dword [ebp + 0x18]
mov edi, dword [ebp + 8]
mov eax, dword [0x7a9040]
xor eax, ebp
mov dword [ebp - 0x10], eax
mov esi, dword [ecx]
mov dword [ecx], 0
test esi, esi
je 0x4c0a08
mov ecx, esi
call fcn.004c1ac0
push esi
call fcn.006507ee
add esp, 4
lea esi, [ebp - 0x21c]
mov dword [esi], 0x101
lea ebx, [ebp - 0x212]
push 0x202
push 0xff
push ebx
call fcn.006547d0
add esp, 0xc
push esi
push ebx
call dword [sym.imp.ADVAPI32.dll_GetUserNameW]
xor eax, eax
mov dword [ebp - 0x220], eax
xor ecx, ecx
dec ecx
mov dword [ebp - 0x224], ecx
pcmpeqd xmm0, xmm0
movdqu xmmword [ebp - 0x234], xmm0
movdqu xmmword [ebp - 0x244], xmm0
mov dword [ebp - 0x248], ecx
mov dword [ebp - 0x24c], eax
cmp byte [edi + 0xb], 0
mov ecx, edi
jns 0x4c0a70
mov ecx, dword [edi]
mov dword [ebp - 0x268], edi
lea ebx, [ebp - 0x220]
lea esi, [ebp - 0x224]
push ebx
push eax
push esi
push eax
push eax
push 4
mov edi, dword [ebp + 0xc]
push edi
push ecx
call dword [sym.imp.ADVAPI32.dll_GetNamedSecurityInfoW]
cmp eax, 5
jne 0x4c0ac4
push edi
mov edi, dword [ebp + 8]
push edi
call fcn.004c0610
test al, al
je 0x4c0ac8
cmp byte [edi + 0xb], 0
mov eax, edi
jns 0x4c0ab1
mov eax, dword [edi]
xor ecx, ecx
push ebx
push ecx
push esi
push ecx
push ecx
push 4
push dword [ebp + 0xc]
push eax
call dword [sym.imp.ADVAPI32.dll_GetNamedSecurityInfoW]
test eax, eax
je 0x4c0b05
xor ebx, ebx
mov eax, dword [ebp - 0x24c]
test eax, eax
je 0x4c0adb
push eax
call dword [sym.imp.KERNEL32.dll_LocalFree]
mov eax, dword [ebp - 0x220]
test eax, eax
je 0x4c0aec
push eax
call dword [sym.imp.KERNEL32.dll_LocalFree]
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.00650d60
mov eax, ebx
add esp, 0x25c
pop esi
pop edi
pop ebx
pop ebp
ret 0x14
lea eax, [ebp - 0x24c]
lea ecx, [ebp - 0x248]
push eax
push ecx
push dword [ebp - 0x224]
call dword [sym.imp.ADVAPI32.dll_GetExplicitEntriesFromAclW]
test eax, eax
jne 0x4c0ac8
mov eax, dword [ebp - 0x248]
test eax, eax
je 0x4c0b8f
mov edi, dword [ebp + 0x10]
not edi
xor esi, esi
xor ebx, ebx
jmp 0x4c0b4f
mov eax, dword [ebp - 0x24c]
and dword [eax + esi], edi
mov eax, dword [ebp - 0x248]
inc ebx
add esi, 0x20
cmp ebx, eax
jae 0x4c0b8f
mov ecx, dword [ebp - 0x24c]
cmp dword [ecx + esi + 4], 3
jne 0x4c0b47
cmp dword [ecx + esi + 0x14], 0
jne 0x4c0b47
mov dword [ebp - 0x260], 0xffffffff
lea eax, [ebp - 0x260]
push eax
push dword [ecx + esi + 0x1c]
push 0
call dword [sym.imp.ADVAPI32.dll_CheckTokenMembership]
test eax, eax
je 0x4c0b41
cmp dword [ebp - 0x260], 0
jne 0x4c0b38
jmp 0x4c0b41
xor esi, esi
inc esi
lea ebx, [ebp - 0x244]
push 3
push esi
push dword [ebp + 0x10]
lea eax, [ebp - 0x212]
push eax
push ebx
call dword [sym.imp.ADVAPI32.dll_BuildExplicitAccessWithNameW]
xor eax, eax
lea ecx, [ebp - 0x250]
mov dword [ecx], eax
mov dword [ebp - 0x254], eax
push ecx
push eax
push ebx
push esi
call dword [sym.imp.ADVAPI32.dll_SetEntriesInAclW]
test eax, eax
jne 0x4c0bed
lea eax, [ebp - 0x254]
push eax
push dword [ebp - 0x250]
push dword [ebp - 0x24c]
push dword [ebp - 0x248]
call dword [sym.imp.ADVAPI32.dll_SetEntriesInAclW]
test eax, eax
je 0x4c0c18
mov eax, dword [ebp - 0x254]
test eax, eax
je 0x4c0bfe
push eax
call dword [sym.imp.KERNEL32.dll_LocalFree]
mov eax, dword [ebp - 0x250]
test eax, eax
je 0x4c0ac8
push eax
call dword [sym.imp.KERNEL32.dll_LocalFree]
jmp 0x4c0ac8
mov eax, dword [ebp - 0x254]
mov dword [ebp - 0x264], eax
xor eax, eax
mov dword [ebp - 0x260], eax
mov dword [ebp - 0x25c], eax
mov dword [ebp - 0x258], eax
mov esi, dword [ebp + 8]
movsx eax, byte [esi + 0xb]
test eax, eax
jns 0x4c0c46
mov eax, dword [esi + 4]
inc eax
lea ecx, [ebp - 0x260]
mov edi, ecx
push eax
call fcn.00689c60
movsx edx, byte [esi + 0xb]
mov eax, esi
test edx, edx
jns 0x4c0c64
mov eax, dword [esi]
mov edx, dword [esi + 4]
lea ebx, [eax + edx*2]
lea esi, [ebp - 0x218]
mov ecx, edi
push edx
push ebx
push eax
push dword [ebp - 0x260]
push esi
call fcn.004c18b0
mov word [esi], 0
mov ecx, edi
push esi
call fcn.006837f0
xor eax, eax
push eax
push dword [ebp - 0x264]
push eax
push eax
push 4
push dword [ebp + 0xc]
push dword [ebp - 0x260]
call dword [sym.imp.ADVAPI32.dll_SetNamedSecurityInfoW]
mov ebx, eax
mov eax, dword [ebp - 0x260]
test eax, eax
mov esi, dword [ebp + 0x18]
je 0x4c0cd6
mov ecx, dword [ebp - 0x25c]
cmp ecx, eax
je 0x4c0cc7
add ecx, 0xfffffffe
jne 0x4c0cbc
ud2
mov dword [ebp - 0x25c], eax
push eax
call fcn.006507ee
add esp, 4
cmp ebx, 5
jne 0x4c0cf3
push dword [ebp + 0xc]
push dword [ebp + 8]
call fcn.004c0610
mov ebx, 5
test al, al
jne 0x4c0dc1
mov eax, dword [ebp - 0x254]
test eax, eax
je 0x4c0d04
push eax
call dword [sym.imp.KERNEL32.dll_LocalFree]
mov cl, byte [ebp + 0x14]
mov eax, dword [ebp - 0x250]
test eax, eax
je 0x4c0d1b
push eax
call dword [sym.imp.KERNEL32.dll_LocalFree]
mov cl, byte [ebp + 0x14]
test ebx, ebx
sete bl
setne al
or al, cl
jne 0x4c0aca
push 0x18
call fcn.006507be
add esp, 4
mov ebx, eax
mov ecx, eax
call fcn.004c1aa0
mov ecx, ebx
mov ebx, dword [esi]
mov dword [esi], ecx
test ebx, ebx
je 0x4c0d5a
mov ecx, ebx
call fcn.004c1ac0
push ebx
call fcn.006507ee
add esp, 4
mov ecx, dword [esi]
mov ebx, dword [ebp + 0xc]
mov eax, dword [ebp + 8]
cmp ecx, eax
je 0x4c0d83
cmp byte [ecx + 0xb], 0
movzx eax, byte [eax + 0xb]
js 0x4c0e90
test al, al
jns 0x4c0dae
mov eax, dword [ebp + 8]
push dword [eax + 4]
push dword [eax]
call fcn.005245c0
mov eax, dword [ebp - 0x224]
mov ecx, dword [esi]
mov dword [ecx + 0x10], eax
mov eax, dword [esi]
mov ecx, dword [eax + 0x14]
mov edx, dword [ebp - 0x220]
mov dword [eax + 0x14], edx
mov dword [ebp - 0x220], ecx
mov eax, dword [esi]
mov dword [eax + 0xc], ebx
mov bl, 1
jmp 0x4c0aca
mov edx, dword [ebp + 8]
mov eax, dword [edx + 8]
mov dword [ecx + 8], eax
movq xmm0, qword [edx]
movq qword [ecx], xmm0
jmp 0x4c0d83
mov eax, dword [ebp - 0x254]
mov dword [ebp - 0x264], eax
xor esi, esi
mov dword [ebp - 0x260], esi
mov dword [ebp - 0x25c], esi
mov dword [ebp - 0x258], esi
mov edi, dword [ebp + 8]
movsx eax, byte [edi + 0xb]
test eax, eax
jns 0x4c0def
mov eax, dword [edi + 4]
inc eax
lea ecx, [ebp - 0x260]
push eax
call fcn.00689c60
movsx edx, byte [edi + 0xb]
mov eax, edi
test edx, edx
jns 0x4c0e0e
mov ecx, dword [ebp + 8]
mov eax, dword [ecx]
mov edx, dword [ecx + 4]
lea ebx, [eax + edx*2]
lea edi, [ebp - 0x260]
mov ecx, edi
push edx
push ebx
push eax
push dword [ebp - 0x260]
lea ebx, [ebp - 0x218]
push ebx
call fcn.004c18b0
mov word [ebp - 0x218], 0
mov ecx, edi
push ebx
call fcn.006837f0
push esi
push dword [ebp - 0x264]
push esi
push esi
push 4
push dword [ebp + 0xc]
push dword [ebp - 0x260]
call dword [sym.imp.ADVAPI32.dll_SetNamedSecurityInfoW]
mov ebx, eax
mov eax, dword [ebp - 0x260]
test eax, eax
je 0x4c0e88
mov ecx, dword [ebp - 0x25c]
cmp ecx, eax
je 0x4c0e79
add ecx, 0xfffffffe
jne 0x4c0e6b
jmp 0x4c0cc5
mov dword [ebp - 0x25c], eax
push eax
call fcn.006507ee
add esp, 4
mov esi, dword [ebp + 0x18]
jmp 0x4c0cf3
test al, al
jns 0x4c0ea2
mov edx, dword [ebp + 8]
mov eax, dword [edx + 4]
mov edx, dword [edx]
mov dword [ebp - 0x268], edx
push eax
push dword [ebp - 0x268]
call fcn.00524490
mov esi, dword [ebp + 0x18]
jmp 0x4c0d83