Function at 0x40d860
Capabilities:
Get session user name

Disassembly:
sub esp, 0x488
push ebx
push ebp
push esi
push edi
mov ecx, 0xf
xor eax, eax
lea edi, [esp + 0x19]
mov byte [esp + 0x18], 0
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
mov ecx, 0x7f
xor eax, eax
lea edi, [esp + 0x99]
mov byte [esp + 0x98], 0
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
mov ecx, 0x7f
xor eax, eax
lea edi, [esp + 0x299]
mov byte [esp + 0x298], 0
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
mov ecx, 0xf
xor eax, eax
lea edi, [esp + 0x59]
mov byte [esp + 0x58], 0
rep stosd dword es:[edi], eax
mov ebp, dword [esp + 0x49c]
stosw word es:[edi], ax
test ebp, ebp
stosb byte es:[edi], al
je 0x40daca
mov ebx, dword [esp + 0x4a0]
test ebx, ebx
je 0x40daca
lea eax, [esp + 0x14]
mov dword [esp + 0x14], 0x40
push eax
push ebp
call dword [sym.imp.ADVAPI32.dll_GetUserNameA]
cmp eax, 1
jne 0x40d968
lea ecx, [esp + 0x18]
push 0x40
push ecx
push ebp
call fcn.00411b50
add esp, 0xc
cmp eax, 0xffffffff
jne 0x40d945
mov eax, dword [str.GNX_DUMMY_NAME]
mov edx, ebp
mov dword [edx], eax
mov ecx, dword [0x42c08c]
mov dword [edx + 4], ecx
mov eax, dword [0x42c090]
mov dword [edx + 8], eax
mov cx, word [0x42c094]
mov word [edx + 0xc], cx
mov al, byte [0x42c096]
mov byte [edx + 0xe], al
jmp 0x40d998
lea edi, [esp + 0x18]
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov edx, ecx
mov esi, edi
mov edi, ebp
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
jmp 0x40d998
mov ecx, dword [str.GNX_DUMMY_NAME]
mov eax, ebp
mov dword [eax], ecx
mov edx, dword [0x42c08c]
mov dword [eax + 4], edx
mov ecx, dword [0x42c090]
mov dword [eax + 8], ecx
mov dx, word [0x42c094]
mov word [eax + 0xc], dx
mov cl, byte [0x42c096]
mov byte [eax + 0xe], cl
call sub.MSVCR71.dll__getpid
mov word [ebx], ax
mov ebx, dword [esp + 0x4a4]
test ebx, ebx
je 0x40daca
mov edi, ebp
or ecx, 0xffffffff
xor eax, eax
lea edx, [esp + 0x98]
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov eax, ecx
mov esi, edi
mov edi, edx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
lea ecx, [esp + 0x58]
push ecx
call fcn.00412060
lea edi, [esp + 0x5c]
or ecx, 0xffffffff
xor eax, eax
lea edx, [esp + 0x9c]
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
push 0x40
mov esi, edi
mov ebp, ecx
mov edi, edx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, ebp
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, ebp
lea eax, [esp + 0x2a0]
and ecx, 3
push eax
rep movsb byte es:[edi], byte [esi]
lea ecx, [esp + 0xa4]
push ecx
call fcn.00411b50
add esp, 0x10
cmp eax, 0xffffffff
jne 0x40da63
mov edx, dword [str.GNX_DUMMY_SHARE]
mov eax, dword [0x42c134]
mov ecx, dword [0x42c138]
mov dword [esp + 0x98], edx
mov edx, dword [0x42c13c]
mov dword [esp + 0x9c], eax
mov dword [esp + 0xa0], ecx
mov dword [esp + 0xa4], edx
jmp 0x40da8e
lea edi, [esp + 0x298]
or ecx, 0xffffffff
xor eax, eax
lea edx, [esp + 0x98]
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov eax, ecx
mov esi, edi
mov edi, edx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
lea ecx, [esp + 0x10]
lea edi, [esp + 0x98]
push ecx
or ecx, 0xffffffff
xor eax, eax
lea edx, [esp + 0x9c]
repne scasb al, byte es:[edi]
not ecx
dec ecx
mov dword [esp + 0x14], 0
push ecx
push edx
call fcn.00411ff0
mov ecx, dword [esp + 0x1c]
add esp, 0xc
inc eax
neg eax
sbb eax, eax
and eax, ecx
mov dword [ebx], eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x488
ret