Function at 0x512414
Capabilities:
Get session user name

Disassembly:
push ebp
mov ebp, esp
push ecx
mov ecx, 0x29
push 0
push 0
dec ecx
jne 0x51241d
xchg dword [ebp - 4], ecx
push ebx
push esi
push edi
mov ebx, ecx
mov dword [ebp - 4], edx
mov esi, eax
xor eax, eax
push ebp
push 0x51294f
push dword fs:[eax]
mov dword fs:[eax], esp
lea eax, [ebp - 8]
call fcn.00512288
lea eax, [ebp - 0xc]
call fcn.005122f8
mov dword [ebp - 0x40], pe_nt_image_headers32
lea eax, [ebp - 0x40]
push eax
lea eax, [ebp - 0x140]
push eax
call sub.advapi32.dll_GetUserNameA
lea eax, [ebp - 0x10]
lea edx, [ebp - 0x140]
mov ecx, pe_nt_image_headers32
call fcn.00404bf8
call sub.kernel32.dll_GetCurrentProcessId
xor edx, edx
push edx
push eax
lea eax, [ebp - 0x144]
call fcn.004099a4
push dword [ebp - 0x144]
push 0x512968
call sub.kernel32.dll_GetCurrentThreadId_1
xor edx, edx
push edx
push eax
lea eax, [ebp - 0x148]
call fcn.004099a4
push dword [ebp - 0x148]
lea eax, [ebp - 0x14]
mov edx, 3
call fcn.00404d24
push pe_nt_image_headers32
lea eax, [ebp - 0x140]
push eax
push 0
call sub.kernel32.dll_GetModuleFileNameA_1
lea eax, [ebp - 0x14c]
lea edx, [ebp - 0x140]
mov ecx, pe_nt_image_headers32
call fcn.00404bf8
mov eax, dword [ebp - 0x14c]
lea edx, [ebp - 0x18]
call fcn.0040a168
lea eax, [ebp - 0x24]
mov edx, dword [0x4aeb5c]
call fcn.00406254
lea eax, [ebp - 0x28]
mov edx, dword [0x4aeb5c]
call fcn.00406254
lea eax, [ebp - 0x2c]
mov edx, dword [0x4aeb5c]
call fcn.00406254
lea eax, [ebp - 0x34]
mov edx, dword [0x4aeb5c]
call fcn.00406254
test bl, bl
je 0x512545
lea eax, [ebp - 0x3c]
mov edx, dword [0x4aeb5c]
call fcn.00406254
jmp 0x512697
mov eax, dword [esi + 0x1c]
call fcn.00405f78
cmp eax, 0x10
jle 0x51255c
mov eax, 0x6a
call fcn.0050ec88
lea edx, [ebp - 0x1c]
mov eax, dword [esi + 0x10]
mov eax, dword [eax + 0xc]
call fcn.004094c4
lea edx, [ebp - 0x20]
mov eax, dword [esi + 0x10]
mov eax, dword [eax + 0x10]
call fcn.004094c4
lea ecx, [ebp - 0x24]
mov edx, dword [ebp - 0x20]
mov eax, dword [ebp - 0x1c]
call fcn.00506d20
lea ecx, [ebp - 0x28]
mov edx, dword [esi + 0x1c]
mov eax, dword [ebp - 0x24]
call fcn.00506db8
mov eax, dword [0x4aec34]
call fcn.004af290
lea ecx, [ebp - 0x2c]
mov edx, dword [ebp - 0x20]
mov edi, dword [eax]
call dword [edi]
mov eax, dword [ebp - 0x2c]
call fcn.00405f78
and eax, 0x80000007
jns 0x5125bc
dec eax
or eax, 0xfffffff8
inc eax
test eax, eax
jle 0x5125dd
mov eax, dword [ebp - 0x2c]
call fcn.00405f78
and eax, 0x80000007
jns 0x5125d4
dec eax
or eax, 0xfffffff8
inc eax
mov dl, 8
sub dl, al
mov byte [ebp - 0x35], dl
jmp 0x5125e1
mov byte [ebp - 0x35], 0
mov eax, dword [ebp - 0x2c]
call fcn.00405f78
xor edx, edx
mov dl, byte [ebp - 0x35]
add eax, edx
push eax
lea eax, [ebp - 0x30]
mov ecx, 1
mov edx, dword [0x4aeb5c]
call fcn.00406134
add esp, 4
push 0
mov eax, dword [ebp - 0x2c]
call fcn.00405f78
push eax
mov ecx, dword [ebp - 0x30]
xor edx, edx
mov eax, dword [ebp - 0x2c]
call fcn.00505ec8
lea ecx, [ebp - 0x34]
mov edx, dword [ebp - 0x30]
mov eax, dword [ebp - 0x28]
call fcn.00506e44
mov eax, dword [ebp - 0x30]
call fcn.00405f78
add eax, eax
inc eax
push eax
lea eax, [ebp - 0x3c]
mov ecx, 1
mov edx, dword [0x4aeb5c]
call fcn.00406134
add esp, 4
mov eax, dword [ebp - 0x3c]
call fcn.00405f78
mov edi, eax
mov eax, dword [ebp - 0x34]
call fcn.00405f78
add eax, eax
cmp edi, eax
jge 0x512671
mov eax, 0x6a
call fcn.0050ec88
mov edx, dword [ebp - 0x3c]
mov eax, dword [ebp - 0x34]
call fcn.00506b64
mov eax, dword [ebp - 0x3c]
call fcn.00405f78
mov edx, dword [ebp - 0x3c]
lea eax, [edx + eax - 1]
push eax
mov al, byte [ebp - 0x35]
call fcn.00506b2c
pop edx
mov byte [edx], al
mov dl, 3
mov eax, dword [esi + 0x14]
call fcn.00510240
test bl, bl
je 0x5126b1
mov dl, 0x52
mov eax, dword [esi + 0x14]
call fcn.00510240
jmp 0x5126bb
mov dl, 0x51
mov eax, dword [esi + 0x14]
call fcn.00510240
xor edx, edx
mov eax, dword [esi + 0x14]
call fcn.00510240
mov eax, dword [esi + 0x10]
mov eax, dword [eax + 0xc]
call fcn.00404c64
test eax, eax
jne 0x5126de
mov eax, dword [esi + 0x14]
call fcn.00510508
jmp 0x5126e6
mov eax, dword [esi + 0x14]
call fcn.005104fc
mov eax, dword [esi + 0x10]
mov eax, dword [eax + 0xc]
call fcn.00404c64
mov edx, eax
mov eax, dword [esi + 0x14]
call fcn.00510290
mov eax, dword [ebp - 0x3c]
call fcn.00405f78
test eax, eax
jne 0x512711
mov eax, dword [esi + 0x14]
call fcn.00510508
jmp 0x512719
mov eax, dword [esi + 0x14]
call fcn.005104fc
mov eax, dword [ebp - 0x3c]
call fcn.00405f78
mov edx, eax
mov eax, dword [esi + 0x14]
call fcn.00510290
xor edx, edx
mov eax, dword [esi + 0x14]
call fcn.00510290
xor eax, eax
cmp dword [ebp - 4], 2
jne 0x512744
mov eax, 8
jmp 0x51274f
cmp dword [ebp - 4], 4
jne 0x51274f
mov eax, 0x10
mov edx, eax
mov eax, dword [esi + 0x14]
call fcn.005102dc
xor edx, edx
mov eax, dword [esi + 0x14]
call fcn.00510290
xor edx, edx
mov eax, dword [esi + 0x14]
call fcn.005102e8
mov eax, dword [ebp - 8]
call fcn.00404c64
test eax, eax
jne 0x512783
mov eax, dword [esi + 0x14]
call fcn.00510508
jmp 0x51278b
mov eax, dword [esi + 0x14]
call fcn.005104fc
mov eax, dword [ebp - 8]
call fcn.00404c64
mov edx, eax
mov eax, dword [esi + 0x14]
call fcn.00510290
mov eax, dword [ebp - 0xc]
call fcn.00404c64
test eax, eax
jne 0x5127b3
mov eax, dword [esi + 0x14]
call fcn.00510508
jmp 0x5127bb
mov eax, dword [esi + 0x14]
call fcn.005104fc
mov eax, dword [ebp - 0xc]
call fcn.00404c64
mov edx, eax
mov eax, dword [esi + 0x14]
call fcn.00510290
mov eax, dword [ebp - 0x10]
call fcn.00404c64
test eax, eax
jne 0x5127e3
mov eax, dword [esi + 0x14]
call fcn.00510508
jmp 0x5127eb
mov eax, dword [esi + 0x14]
call fcn.005104fc
mov eax, dword [ebp - 0x10]
call fcn.00404c64
mov edx, eax
mov eax, dword [esi + 0x14]
call fcn.00510290
mov edx, 0x1000
mov eax, dword [esi + 0x14]
call fcn.00510290
mov eax, dword [ebp - 0x14]
call fcn.00404c64
test eax, eax
jne 0x512820
mov eax, dword [esi + 0x14]
call fcn.00510508
jmp 0x512828
mov eax, dword [esi + 0x14]
call fcn.005104fc
mov eax, dword [ebp - 0x14]
call fcn.00404c64
mov edx, eax
mov eax, dword [esi + 0x14]
call fcn.00510290
mov eax, dword [ebp - 0x18]
call fcn.00404c64
test eax, eax
jne 0x512850
mov eax, dword [esi + 0x14]
call fcn.00510508
jmp 0x512858
mov eax, dword [esi + 0x14]
call fcn.005104fc
mov eax, dword [ebp - 0x18]
call fcn.00404c64
mov edx, eax
mov eax, dword [esi + 0x14]
call fcn.00510290
xor edx, edx
mov eax, dword [esi + 0x14]
call fcn.0051024c
xor edx, edx
mov eax, dword [esi + 0x14]
call fcn.00510290
xor edx, edx
mov eax, dword [esi + 0x14]
call fcn.005102e8
xor edx, edx
mov eax, dword [esi + 0x14]
call fcn.00510290
mov edx, ebx
mov eax, dword [esi + 0x14]
call fcn.005102e8
mov edx, 0x10
mov eax, dword [esi + 0x14]
call fcn.00510290
mov edx, ebx
mov eax, dword [esi + 0x14]
call fcn.005102e8
mov eax, dword [esi + 0x10]
mov edx, dword [eax + 0xc]
mov eax, dword [esi + 0x14]
call fcn.00510328
mov edx, dword [ebp - 0x3c]
mov eax, dword [esi + 0x14]
call fcn.005102fc
mov edx, dword [ebp - 8]
mov eax, dword [esi + 0x14]
call fcn.00510328
mov edx, dword [ebp - 0xc]
mov eax, dword [esi + 0x14]
call fcn.00510328
mov edx, dword [ebp - 0x10]
mov eax, dword [esi + 0x14]
call fcn.00510328
mov edx, dword [ebp - 0x14]
mov eax, dword [esi + 0x14]
call fcn.00510328
mov edx, dword [ebp - 0x18]
mov eax, dword [esi + 0x14]
call fcn.00510328
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x512956
lea eax, [ebp - 0x14c]
mov edx, 3
call fcn.0040499c
lea eax, [ebp - 0x3c]
mov edx, dword [0x4aeb5c]
call fcn.00406254
lea eax, [ebp - 0x34]
mov edx, dword [0x4aeb5c]
mov ecx, 5
call fcn.00405658
lea eax, [ebp - 0x20]
mov edx, 7
call fcn.0040499c
ret