Function at 0x40fac0
Capabilities:
Get session user name

Disassembly:
sub esp, 0x32c
mov eax, dword [0x4292b4]
xor eax, esp
mov dword [esp + 0x328], eax
call fcn.0040eda0
test eax, eax
jne 0x40faf7
mov eax, 1
mov ecx, dword [esp + 0x328]
xor ecx, esp
call fcn.0040ffc4
add esp, 0x32c
ret
push ebx
push ebp
push str.NETAPI32.DLL
call dword [sym.imp.KERNEL32.dll_LoadLibraryA]
mov ebp, eax
xor ebx, ebx
cmp ebp, ebx
mov dword [esp + 0xc], ebp
jne 0x40fb29
pop ebp
xor eax, eax
pop ebx
mov ecx, dword [esp + 0x328]
xor ecx, esp
call fcn.0040ffc4
add esp, 0x32c
ret
push esi
mov esi, dword [sym.imp.KERNEL32.dll_GetProcAddress]
push edi
push str.NetWkstaUserGetInfo
push ebp
call esi
push str.NetUserGetInfo
push ebp
mov edi, eax
call esi
mov ebp, eax
mov eax, dword [esp + 0x14]
push str.NetApiBufferFree
push eax
call esi
mov ecx, dword [esp + 0x14]
push str.NetUserGetLocalGroups
push ecx
mov dword [esp + 0x24], eax
call esi
cmp edi, ebx
mov dword [esp + 0x24], eax
je 0x40fd2c
cmp ebp, ebx
je 0x40fd2c
cmp dword [esp + 0x1c], ebx
je 0x40fd2c
cmp eax, ebx
je 0x40fd2c
lea edx, [esp + 0x2c]
push edx
lea eax, [esp + 0x23c]
push eax
mov byte [esp + 0x1b], bl
mov dword [esp + 0x30], ebx
mov dword [esp + 0x34], 0xff
call dword [sym.imp.ADVAPI32.dll_GetUserNameA]
test eax, eax
je 0x40fbe0
lea ecx, [esp + 0x28]
push ecx
push 1
lea edx, [esp + 0x40]
push edx
lea eax, [esp + 0x244]
push eax
call fcn.0040ed70
add esp, 8
push eax
push ebx
call ebp
test eax, eax
jne 0x40fbe0
mov ecx, dword [esp + 0x28]
cmp dword [ecx + 0xc], 2
je 0x40fd15
lea edx, [esp + 0x20]
push edx
push 1
push ebx
mov dword [esp + 0x2c], ebx
mov dword [esp + 0x24], ebx
call edi
test eax, eax
jne 0x40fce3
mov esi, dword [esp + 0x20]
mov ecx, dword [esi + 4]
lea edx, [esp + 0x38]
movzx eax, word [ecx]
mov word [edx], ax
add ecx, 2
add edx, 2
cmp ax, bx
jne 0x40fc05
lea edi, [esp + 0x38]
add edi, 0xfffffffe
lea ecx, [ecx]
mov ax, word [edi + 2]
add edi, 2
cmp ax, bx
jne 0x40fc20
mov eax, dword [0x423b6c]
mov dword [edi], eax
mov eax, dword [esi]
mov edx, eax
mov cx, word [eax]
add eax, 2
cmp cx, bx
jne 0x40fc37
lea edi, [esp + 0x38]
sub eax, edx
add edi, 0xfffffffe
jmp 0x40fc50
mov cx, word [edi + 2]
add edi, 2
cmp cx, bx
jne 0x40fc50
mov ecx, eax
shr ecx, 2
mov esi, edx
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
lea ecx, [esp + 0x34]
push ecx
lea edx, [esp + 0x34]
push edx
push 0xffffffffffffffff
lea eax, [esp + 0x24]
push eax
push 1
push ebx
lea ecx, [esp + 0x50]
push ecx
push ebx
call dword [esp + 0x44]
test eax, eax
jne 0x40fcd4
mov esi, dword [esp + 0x18]
xor edi, edi
cmp dword [esp + 0x30], ebx
jbe 0x40fccb
lea ebx, [ebx]
cmp esi, ebx
je 0x40fcb8
mov edx, dword [esi]
push str.Administrators
push edx
call fcn.00421925
add esp, 8
test eax, eax
je 0x40fcc6
add edi, 1
add esi, 4
cmp edi, dword [esp + 0x30]
jb 0x40fca0
jmp 0x40fccb
mov byte [esp + 0x13], 1
mov eax, dword [esp + 0x18]
push eax
call dword [esp + 0x20]
mov ecx, dword [esp + 0x20]
push ecx
call dword [esp + 0x20]
cmp byte [esp + 0x13], bl
jne 0x40fd1a
lea edx, [esp + 0x2c]
push edx
lea eax, [esp + 0x28]
push eax
push ebx
push 0x20006
push ebx
push ebx
push ebx
push str.System
push 0x80000002
call dword [sym.imp.ADVAPI32.dll_RegCreateKeyExA]
test eax, eax
jne 0x40fd1a
mov ecx, dword [esp + 0x24]
push ecx
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov byte [esp + 0x13], 1
mov edx, dword [esp + 0x14]
push edx
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
movzx eax, byte [esp + 0x13]
jmp 0x40fd39
mov eax, dword [esp + 0x14]
push eax
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
xor eax, eax
mov ecx, dword [esp + 0x338]
pop edi
pop esi
pop ebp
pop ebx
xor ecx, esp
call fcn.0040ffc4
add esp, 0x32c
ret