Function at 0x403d20
Capabilities:
Get session user name

Disassembly:
sub esp, 0x58
mov ecx, dword [esp + 0x5c]
push ebx
push ebp
xor eax, eax
push esi
xor esi, esi
push edi
mov dword [esp + 0x4c], eax
mov dword [esp + 0x50], eax
mov dword [esp + 0x54], eax
mov dword [esp + 0x58], eax
mov dword [esp + 0x5c], eax
mov dword [esp + 0x60], eax
mov dword [esp + 0x64], eax
lea eax, [esp + 0x10]
push eax
push esi
push esi
push 4
push ecx
xor ebp, ebp
mov dword [esp + 0x2c], esi
mov dword [esp + 0x24], esi
mov dword [esp + 0x30], esi
mov dword [esp + 0x58], esi
mov dword [esp + 0x50], esi
mov dword [esp + 0x28], esi
mov dword [esp + 0x54], esi
mov dword [esp + 0x44], esi
mov dword [esp + 0x5c], esi
mov dword [esp + 0x40], esi
mov dword [esp + 0x3c], esi
mov dword [esp + 0x38], esi
mov dword [esp + 0x34], esi
mov dword [esp + 0x48], esi
mov dword [esp + 0x4c], esi
call dword [sym.imp.ADVAPI32.dll_GetKernelObjectSecurity]
mov edx, dword [esp + 0x10]
mov edi, dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push edx
push 8
call edi
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov ebx, eax
cmp ebx, esi
je 0x403f78
mov ecx, dword [esp + 0x10]
mov edx, dword [esp + 0x6c]
lea eax, [esp + 0x1c]
push eax
push ecx
push ebx
push 4
push edx
call dword [sym.imp.ADVAPI32.dll_GetKernelObjectSecurity]
mov ebp, eax
cmp ebp, esi
je 0x403f68
lea eax, [esp + 0x3c]
push eax
lea ecx, [esp + 0x18]
push ecx
lea edx, [esp + 0x4c]
push edx
push ebx
call dword [sym.imp.ADVAPI32.dll_GetSecurityDescriptorDacl]
mov ebp, eax
cmp ebp, esi
je 0x403f68
lea eax, [esp + 0x1c]
push eax
push 0x41ae58
mov dword [esp + 0x24], 0x400
call dword [sym.imp.ADVAPI32.dll_GetUserNameW]
push esi
push 1
push 0xe
push 0x41ae58
lea ecx, [esp + 0x58]
push ecx
call dword [sym.imp.ADVAPI32.dll_BuildExplicitAccessWithNameW]
mov eax, dword [esp + 0x14]
lea edx, [esp + 0x40]
push edx
push eax
lea ecx, [esp + 0x50]
push ecx
push 1
call dword [sym.imp.ADVAPI32.dll_SetEntriesInAclW]
test eax, eax
jne 0x403f68
lea edx, [esp + 0x20]
push edx
push esi
lea eax, [esp + 0x2c]
push eax
mov eax, dword [esp + 0x20]
push esi
lea ecx, [esp + 0x38]
push ecx
push esi
lea edx, [esp + 0x44]
push edx
push eax
lea ecx, [esp + 0x30]
push ecx
push esi
push ebx
call dword [sym.imp.ADVAPI32.dll_MakeAbsoluteSD]
mov edx, dword [esp + 0x2c]
push edx
push 8
call edi
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
cmp eax, esi
mov dword [esp + 0x14], eax
je 0x403f68
mov eax, dword [esp + 0x28]
push eax
push 8
call edi
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
cmp eax, esi
mov dword [esp + 0x30], eax
je 0x403f68
mov ecx, dword [esp + 0x24]
push ecx
push 8
call edi
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
cmp eax, esi
mov dword [esp + 0x34], eax
je 0x403f68
mov edx, dword [esp + 0x20]
push edx
push 8
call edi
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
cmp eax, esi
mov dword [esp + 0x38], eax
je 0x403f68
mov eax, dword [esp + 0x10]
push eax
push 8
call edi
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
cmp eax, esi
mov dword [esp + 0x18], eax
je 0x403f68
mov edx, dword [esp + 0x38]
lea ecx, [esp + 0x20]
push ecx
push edx
mov edx, dword [esp + 0x3c]
lea ecx, [esp + 0x2c]
push ecx
push edx
mov edx, dword [esp + 0x40]
lea ecx, [esp + 0x38]
push ecx
push edx
mov edx, dword [esp + 0x2c]
lea ecx, [esp + 0x44]
push ecx
push edx
lea ecx, [esp + 0x30]
push ecx
push eax
push ebx
call dword [sym.imp.ADVAPI32.dll_MakeAbsoluteSD]
mov ebp, eax
cmp ebp, esi
je 0x403f68
mov edx, dword [esp + 0x3c]
mov eax, dword [esp + 0x40]
mov ecx, dword [esp + 0x44]
push edx
mov edx, dword [esp + 0x1c]
push eax
push ecx
push edx
call dword [sym.imp.ADVAPI32.dll_SetSecurityDescriptorDacl]
mov ebp, eax
cmp ebp, esi
je 0x403f68
mov eax, dword [esp + 0x18]
mov ecx, dword [esp + 0x6c]
push eax
push 4
push ecx
call dword [sym.imp.ADVAPI32.dll_SetKernelObjectSecurity]
lea ebp, [esi + 1]
push ebx
push 1
call edi
mov ebx, dword [sym.imp.KERNEL32.dll_HeapFree]
push eax
call ebx
jmp 0x403f7e
mov ebx, dword [sym.imp.KERNEL32.dll_HeapFree]
mov eax, dword [esp + 0x14]
cmp eax, esi
je 0x403f8e
push eax
push 1
call edi
push eax
call ebx
mov eax, dword [esp + 0x30]
cmp eax, esi
je 0x403f9e
push eax
push 1
call edi
push eax
call ebx
mov eax, dword [esp + 0x34]
cmp eax, esi
je 0x403fae
push eax
push 1
call edi
push eax
call ebx
mov eax, dword [esp + 0x38]
cmp eax, esi
je 0x403fbe
push eax
push 1
call edi
push eax
call ebx
mov eax, dword [esp + 0x18]
cmp eax, esi
je 0x403fce
push eax
push 1
call edi
push eax
call ebx
pop edi
pop esi
mov eax, ebp
pop ebp
pop ebx
add esp, 0x58
ret