Function at 0x660a24d0
Capabilities:
Get session user name
Manipulate user privileges

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x63c
mov dword [ebp - 0x18], edi
mov dword [ebp - 0x14], esi
mov dword [ebp - 0x10], ebx
mov edx, dword [ebp + 8]
mov dword [ebp - 0x24], 0x101
xor eax, eax
cmp edx, 2
mov dword [ebp - 0x20], eax
mov dword [ebp - 0x1c], eax
jle 0x660a2715
mov esi, dword [ebp + 0xc]
mov ebx, 2
push 2
push 0x660c5240
lea edi, [ebx + ebx]
push dword [esi + ebx*4]
call fcn.660ac190
add esp, 0xc
test eax, eax
jne 0x660a2707
mov edi, dword [esi + edi*2]
add edi, 4
movzx eax, word [edi]
test eax, eax
je 0x660a281d
mov eax, dword [ebp + 8]
add ebx, 1
cmp ebx, eax
jge 0x660a27f7
test edi, edi
je 0x660a2505
mov dword [ebp - 0xc], edi
lea eax, [ebp - 0xc]
lea edx, [ebp - 0x430]
push eax
push 0x100
push edx
push 0x400
push 0xc0020035
push 0
push 0x3800
call dword [sym.imp.KERNEL32.dll_FormatMessageW]
lea eax, [ebp - 0x430]
push eax
mov edx, 0x660c1760
push section..data1
push edx
call fcn.660abfb0
add esp, 0xc
lea edx, [ebp - 0x20]
mov eax, edi
call fcn.660a23a4
mov ebx, eax
test ebx, ebx
jne 0x660a27d9
lea eax, [ebp - 0x1c]
call fcn.660a2480
mov esi, eax
test esi, esi
jne 0x660a27b2
mov edx, dword [ebp + 8]
cmp edx, 2
jle 0x660a27ab
mov dword [ebp - 0x30], esi
mov esi, dword [ebp + 0xc]
xor ebx, ebx
mov edi, 2
push 2
push 0x660c5248
push dword [esi + edi*4]
call fcn.660ac190
add esp, 0xc
test eax, eax
jne 0x660a25e1
add ebx, 1
mov eax, dword [ebp + 8]
add edi, 1
cmp edi, eax
jl 0x660a25c8
mov esi, dword [ebp - 0x30]
test ebx, ebx
jbe 0x660a2792
lea edx, [ebx + ebx]
add edx, edx
add edx, edx
push edx
push 0x40
call dword [sym.imp.KERNEL32.dll_LocalAlloc]
mov ecx, eax
test ecx, ecx
je 0x660a2777
mov edx, dword [ebp + 8]
cmp edx, 1
jle 0x660a26d2
mov edx, dword [ebp + 0xc]
mov dword [ebp - 0x30], esi
mov dword [ebp - 4], ecx
lea eax, [edx + 4]
mov dword [ebp - 0x28], ebx
xor edi, edi
mov dword [ebp - 0x2c], edi
mov ebx, eax
mov edi, dword [ebp + 8]
mov esi, dword [ebp - 0x2c]
lea edi, [edx + edi*4]
push 2
push 0x660c5248
push dword [ebx]
call fcn.660ac190
add esp, 0xc
test eax, eax
jne 0x660a26be
mov edx, dword [ebx]
movzx ecx, word [edx + 4]
lea eax, [edx + 4]
test ecx, ecx
je 0x660a2804
mov dword [ebp - 0xc], eax
lea edx, [ebp - 0xc]
lea ecx, [ebp - 0x230]
push edx
push 0x100
push ecx
push 0x400
push 0xc0020038
push 0
push 0x3800
call dword [sym.imp.KERNEL32.dll_FormatMessageW]
lea edx, [ebp - 0x230]
push edx
mov ecx, 0x660c1760
push section..data1
push ecx
call fcn.660abfb0
mov edx, dword [ebx]
lea ecx, [esi + esi]
add ecx, ecx
add ecx, ecx
add edx, 4
add ecx, dword [ebp - 4]
push edx
push ecx
call fcn.660a2918
add esp, 0x14
add esi, 1
add ebx, 4
cmp ebx, edi
jb 0x660a263b
mov esi, dword [ebp - 0x30]
mov ecx, dword [ebp - 4]
mov ebx, dword [ebp - 0x28]
test esi, esi
jne 0x660a26e7
push ebx
push ecx
push dword [ebp - 0x20]
push dword [ebp - 0x1c]
call sub.ADVAPI32.dll_LsaAddAccountRights
test eax, eax
jne 0x660a275c
push dword [ebp - 0x20]
call dword [sym.imp.KERNEL32.dll_LocalFree]
push dword [ebp - 0x1c]
call sub.ADVAPI32.dll_LsaClose
mov ebx, dword [ebp - 0x10]
mov edi, dword [ebp - 0x18]
mov eax, esi
mov esi, dword [ebp - 0x14]
mov esp, ebp
pop ebp
ret
mov eax, dword [ebp + 8]
add ebx, 1
cmp ebx, eax
jl 0x660a2505
lea edx, [ebp - 0x634]
lea eax, [ebp - 0x24]
push eax
push edx
push 2
call sub.Secur32.dll_GetUserNameExW
movzx eax, al
test eax, eax
je 0x660a2739
lea edi, [ebp - 0x634]
jmp 0x660a2545
call dword [sym.imp.KERNEL32.dll_GetLastError]
push 0
push eax
call fcn.660a2840
add esp, 8
mov ebx, dword [ebp - 0x10]
mov esi, dword [ebp - 0x14]
mov edi, dword [ebp - 0x18]
mov eax, 0x65
mov esp, ebp
pop ebp
ret
push eax
call sub.ADVAPI32.dll_LsaNtStatusToWinError
push 0
push eax
call fcn.660a2840
add esp, 8
mov esi, 0x66
jmp 0x660a26e7
call dword [sym.imp.KERNEL32.dll_GetLastError]
push 0
push eax
call fcn.660a2840
add esp, 8
mov esi, 0x69
jmp 0x660a26f0
push 0
push 0xc0020039
call fcn.660a2840
add esp, 8
mov esi, 2
jmp 0x660a26f0
xor ebx, ebx
jmp 0x660a25ee
push 0
push 0xc0020037
call fcn.660a2840
add esp, 8
push dword [ebp - 0x20]
call dword [sym.imp.KERNEL32.dll_LocalFree]
mov ebx, dword [ebp - 0x10]
mov edi, dword [ebp - 0x18]
mov eax, esi
mov esi, dword [ebp - 0x14]
mov esp, ebp
pop ebp
ret
push 0
push 0xc0020036
call fcn.660a2840
add esp, 8
mov esi, dword [ebp - 0x14]
mov edi, dword [ebp - 0x18]
mov eax, ebx
mov ebx, dword [ebp - 0x10]
mov esp, ebp
pop ebp
ret
test edi, edi
je 0x660a2715
jmp 0x660a2545
push 0
push 0xc0020042
call fcn.660a2840
add esp, 8
mov esi, 2
jmp 0x660a26e7
push 0
push 0xc002003f
call fcn.660a2840
add esp, 8
mov ebx, dword [ebp - 0x10]
mov esi, dword [ebp - 0x14]
mov edi, dword [ebp - 0x18]
mov eax, 2
mov esp, ebp
pop ebp
ret