Function at 0x405940
Capabilities:
Get session user name

Disassembly:
push 0xffffffffffffffff
push 0x41265b
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x320
push ebx
push ebp
mov ebp, ecx
push esi
push edi
lea ecx, [esp + 0x14]
call sub.MFC42.DLL_CFile::CFile
mov edi, dword [esp + 0x344]
lea ebx, [ebp + 0x940]
mov eax, 0xf0
mov ecx, 0xd2
mov dword [ebx], eax
mov dword [ebx + 4], ecx
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
lea edx, [esp + 0x2c]
mov eax, ecx
mov esi, edi
mov edi, edx
push 0
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
push 0x8000
and ecx, 3
mov dword [esp + 0x340], 0
rep movsb byte es:[edi], byte [esi]
lea ecx, [esp + 0x34]
push ecx
lea ecx, [esp + 0x20]
call sub.MFC42.DLL_CFile::Open
test eax, eax
jne 0x4059e6
lea ecx, [esp + 0x14]
mov dword [esp + 0x338], 0xffffffff
call fcn.0041163a
xor eax, eax
jmp 0x405c4b
lea edx, [ebp + 0x918]
push 4
push edx
lea ecx, [esp + 0x1c]
call sub.MFC42.DLL_CFile::Read
lea eax, [ebp + 0x91c]
push 4
push eax
lea ecx, [esp + 0x1c]
call sub.MFC42.DLL_CFile::Read
lea esi, [ebp + 0x914]
push 4
push esi
lea ecx, [esp + 0x1c]
call sub.MFC42.DLL_CFile::Read
push 4
push esi
lea ecx, [esp + 0x1c]
call sub.MFC42.DLL_CFile::Read
lea ecx, [ebp + 0x920]
push 4
push ecx
lea ecx, [esp + 0x1c]
call sub.MFC42.DLL_CFile::Read
lea edx, [esp + 0x28]
push 4
push edx
lea ecx, [esp + 0x1c]
call sub.MFC42.DLL_CFile::Read
lea eax, [ebp + 0x92c]
push 4
push eax
lea ecx, [esp + 0x1c]
call sub.MFC42.DLL_CFile::Read
lea ecx, [ebp + 0x8d8]
push 0x3c
push ecx
lea ecx, [esp + 0x1c]
call sub.MFC42.DLL_CFile::Read
lea edx, [esp + 0x10]
push 4
push edx
lea ecx, [esp + 0x1c]
call sub.MFC42.DLL_CFile::Read
mov eax, dword [esp + 0x10]
lea ecx, [esp + 0x2c]
push eax
push ecx
lea ecx, [esp + 0x1c]
call sub.MFC42.DLL_CFile::Read
lea edx, [esp + 0x2c]
lea ecx, [ebp + 0x930]
push edx
call fcn.00411460
lea eax, [esp + 0x10]
push 4
push eax
lea ecx, [esp + 0x1c]
call sub.MFC42.DLL_CFile::Read
mov ecx, dword [esp + 0x10]
lea edx, [esp + 0x2c]
push ecx
push edx
lea ecx, [esp + 0x1c]
call sub.MFC42.DLL_CFile::Read
lea eax, [esp + 0x2c]
lea ecx, [ebp + 0x934]
push eax
call fcn.00411460
lea ecx, [esp + 0x10]
push 4
push ecx
lea ecx, [esp + 0x1c]
call sub.MFC42.DLL_CFile::Read
mov edx, dword [esp + 0x10]
lea eax, [esp + 0x2c]
push edx
push eax
lea ecx, [esp + 0x1c]
call sub.MFC42.DLL_CFile::Read
lea ecx, [esp + 0x2c]
push ecx
lea ecx, [ebp + 0x938]
call fcn.00411460
lea edx, [esp + 0x10]
push 4
push edx
lea ecx, [esp + 0x1c]
call sub.MFC42.DLL_CFile::Read
mov eax, dword [esp + 0x10]
lea ecx, [esp + 0x2c]
push eax
push ecx
lea ecx, [esp + 0x1c]
call sub.MFC42.DLL_CFile::Read
lea esi, [ebp + 0x93c]
lea edx, [esp + 0x2c]
push edx
mov ecx, esi
call fcn.00411460
lea eax, [esp + 0x2c]
push eax
call dword [sym.imp.KERNEL32.dll_lstrlenA]
test eax, eax
jle 0x405b5f
lea ecx, [esp + 0x2c]
push 0x20
push ecx
call dword [sym.imp.MSVCRT.dll_strchr]
add esp, 8
test eax, eax
je 0x405ba4
lea edx, [esp + 0x24]
lea eax, [esp + 0x22c]
push edx
push eax
mov dword [esp + 0x2c], 0xff
call dword [sym.imp.ADVAPI32.dll_GetUserNameA]
test eax, eax
jne 0x405b85
mov byte [esp + 0x22c], al
lea ecx, [esp + 0x22c]
lea edx, [esp + 0x2c]
push ecx
push edx
call dword [sym.imp.KERNEL32.dll_lstrcpyA]
lea eax, [esp + 0x2c]
mov ecx, esi
push eax
call fcn.00411460
lea ecx, [esp + 0x10]
push 4
push ecx
lea ecx, [esp + 0x1c]
call sub.MFC42.DLL_CFile::Read
mov edx, dword [esp + 0x10]
lea eax, [esp + 0x22c]
push edx
push eax
lea ecx, [esp + 0x1c]
call sub.MFC42.DLL_CFile::Read
push 8
push ebx
lea ecx, [esp + 0x1c]
call sub.MFC42.DLL_CFile::Read
mov eax, dword [ebx]
cmp eax, 0x64
jl 0x405bf6
cmp eax, 0x258
jg 0x405bf6
mov eax, dword [ebp + 0x944]
cmp eax, 0x64
jl 0x405bf6
cmp eax, 0x258
jle 0x405c05
mov eax, 0xf0
mov ecx, 0xd2
mov dword [ebx], eax
mov dword [ebx + 4], ecx
lea ecx, [ebp + 0xaa0]
push 4
push ecx
lea ecx, [esp + 0x1c]
call sub.MFC42.DLL_CFile::Read
add ebp, 0xaa4
push 4
push ebp
lea ecx, [esp + 0x1c]
call sub.MFC42.DLL_CFile::Read
lea ecx, [esp + 0x14]
call sub.MFC42.DLL_CFile::Close
lea ecx, [esp + 0x14]
mov dword [esp + 0x338], 0xffffffff
call fcn.0041163a
mov eax, 1
mov ecx, dword [esp + 0x330]
pop edi
pop esi
pop ebp
pop ebx
mov dword fs:[0], ecx
add esp, 0x32c
ret 8