Function at 0x40222c
Capabilities:
Get session user name

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x38
mov dword [ebp - 4], 0
mov eax, dword [ebp + 8]
mov ecx, dword [eax + 4]
push ecx
call fcn.004020af
add esp, 4
mov dword [ebp - 8], eax
cmp dword [ebp - 8], 0
je 0x402470
call fcn.00401da1
mov dword [ebp - 0xc], eax
mov dword [ebp - 0x10], 0
mov dword [ebp - 0x14], 0
mov edx, dword [ebp - 8]
mov eax, dword [edx + 0xc]
mov dword [ebp - 0x18], eax
jmp 0x40227f
mov ecx, dword [ebp - 0x18]
mov edx, dword [ecx + 4]
mov dword [ebp - 0x18], edx
cmp dword [ebp - 0x18], 0
je 0x402296
mov eax, dword [ebp - 0x14]
add eax, 1
mov dword [ebp - 0x14], eax
mov ecx, dword [ebp - 0x18]
mov dword [ebp - 0x10], ecx
jmp 0x402276
cmp dword [ebp - 0xc], 0
je 0x402470
cmp dword [ebp - 0x10], 0
je 0x402470
mov dword [ebp - 0x24], 0
mov dword [ebp - 0x2c], 0
mov dword [ebp - 0x28], 0
mov dword [ebp - 0x1c], 0x40
mov dword [ebp - 0x20], 0x40
mov edx, dword [ebp - 0x1c]
add edx, dword [ebp - 0x20]
mov eax, dword [ebp - 0x2c]
add eax, edx
mov dword [ebp - 0x2c], eax
mov ecx, dword [ebp - 0xc]
push ecx
mov edx, dword [ebp - 0x10]
push edx
call fcn.00401df0
add esp, 8
mov eax, dword [ebp + 8]
cmp dword [eax + 0x1c], 0
jne 0x402354
push 2
call fcn.00401d8f
add esp, 4
cmp dword [eax + 4], 0
jne 0x402309
call fcn.00402d6f
mov ecx, dword [ebp + 8]
mov edx, dword [ecx + 0x18]
push edx
push 2
call fcn.00401d8f
add esp, 4
push eax
call fcn.00401fbe
add esp, 8
mov dword [ebp - 0x30], eax
cmp dword [ebp - 0x30], 0
je 0x402354
mov eax, dword [ebp - 0x30]
mov ecx, dword [eax + 0xc]
mov dword [ebp - 0x34], ecx
mov edx, dword [ebp - 0x34]
mov eax, dword [edx + 8]
mov dword [ebp - 0x28], eax
mov ecx, dword [ebp - 0x28]
push ecx
call sub.MSVCRT.dll_strlen
add esp, 4
mov edx, dword [ebp - 0x2c]
lea eax, [edx + eax + 1]
mov dword [ebp - 0x2c], eax
mov ecx, dword [ebp + 0xc]
add ecx, dword [ebp - 0x2c]
push ecx
call dword [sym.imp.MSVCRT.dll_malloc]
add esp, 4
mov edx, dword [ebp - 0xc]
mov dword [edx + 8], eax
mov eax, dword [ebp - 0xc]
cmp dword [eax + 8], 0
je 0x402470
mov ecx, dword [ebp - 0xc]
mov edx, dword [ecx + 8]
add edx, dword [ebp + 0xc]
mov dword [ebp - 0x38], edx
mov eax, dword [ebp + 0xc]
add eax, dword [ebp - 0x2c]
mov ecx, dword [ebp - 0xc]
mov dword [ecx + 0xc], eax
push 0xb
push 0x4080a4
mov edx, dword [ebp + 0xc]
push edx
mov eax, dword [ebp + 8]
push eax
mov ecx, dword [ebp + 8]
push ecx
mov edx, dword [ebp - 0xc]
mov eax, dword [edx + 8]
push eax
mov ecx, dword [ebp - 0xc]
mov edx, dword [ecx + 8]
push edx
call sub.ZSPOOL.dll_ZSP_StructCopy
cmp dword [ebp - 0x28], 0
je 0x4023f3
mov eax, dword [ebp - 0xc]
mov ecx, dword [eax + 8]
mov edx, dword [ebp - 0x38]
mov dword [ecx + 0x1c], edx
mov eax, dword [ebp - 0x28]
push eax
mov ecx, dword [ebp - 0xc]
mov edx, dword [ecx + 8]
mov eax, dword [edx + 0x1c]
push eax
call sub.MSVCRT.dll_strcpy
add esp, 8
mov ecx, dword [ebp - 0x28]
push ecx
call sub.MSVCRT.dll_strlen
add esp, 4
mov edx, dword [ebp - 0x38]
lea eax, [edx + eax + 1]
mov dword [ebp - 0x38], eax
lea ecx, [ebp - 0x1c]
push ecx
mov edx, dword [ebp - 0x38]
push edx
call dword [sym.imp.ZSPOOL.dll_GetUserNameA]
test eax, eax
je 0x40241a
mov eax, dword [ebp - 0xc]
mov ecx, dword [eax + 8]
mov edx, dword [ebp - 0x38]
mov dword [ecx + 0xc], edx
mov eax, dword [ebp - 0x38]
add eax, dword [ebp - 0x1c]
mov dword [ebp - 0x38], eax
push 0x4080d4
mov ecx, dword [ebp - 0x38]
push ecx
call sub.MSVCRT.dll_strcpy
add esp, 8
mov edx, dword [ebp - 0xc]
mov eax, dword [edx + 8]
mov ecx, dword [ebp - 0x38]
mov dword [eax + 0x2c], ecx
mov edx, dword [ebp - 0x38]
add edx, dword [ebp - 0x20]
mov dword [ebp - 0x38], edx
mov eax, dword [ebp - 0xc]
mov ecx, dword [eax + 8]
mov dword [ecx + 0x34], 8
mov edx, dword [ebp - 0xc]
mov eax, dword [edx + 8]
add eax, 0x50
push eax
call dword [sym.imp.KERNEL32.dll_GetSystemTime]
mov ecx, dword [ebp - 0xc]
mov edx, dword [ecx + 8]
mov eax, dword [ebp - 0x14]
mov dword [edx + 0x3c], eax
mov dword [ebp - 4], 1
mov eax, dword [ebp - 4]
mov esp, ebp
pop ebp
ret