Function at 0x40fe10
Capabilities:
Query environment variable

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x51c1eb
mov eax, dword fs:[0]
push eax
sub esp, 0x48c
mov eax, dword [0x54735c]
xor eax, ebp
mov dword [ebp - 0x10], eax
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov edi, dword [ebp + 8]
mov dword [ebp - 0x490], edi
mov dword [ebp - 0x448], 0
mov dword [ebp - 0x444], 0xf
mov byte [ebp - 0x458], 0
push 0x400
lea eax, [ebp - 0x410]
mov dword [ebp - 4], 0
push 0
push eax
call fcn.004f53d0
add esp, 0xc
mov dword [ebp - 0x494], 0
xor eax, eax
mov dword [ebp - 0x418], 0
lea ecx, [ebp - 0x428]
mov dword [ebp - 0x414], 7
mov word [ebp - 0x428], ax
push 0xc
push str.Kernel32.dll
call fcn.00403ab0
cmp dword [ebp - 0x418], 0
je 0x40ff02
cmp dword [ebp - 0x414], 8
lea eax, [ebp - 0x428]
cmovae eax, dword [ebp - 0x428]
push eax
call dword [sym.imp.KERNEL32.dll_GetModuleHandleW]
mov esi, eax
test esi, esi
jne 0x40ff04
cmp dword [ebp - 0x414], 8
lea eax, [ebp - 0x428]
cmovae eax, dword [ebp - 0x428]
push eax
call dword [sym.imp.KERNEL32.dll_LoadLibraryW]
mov esi, eax
test esi, esi
jne 0x40ff04
xor esi, esi
mov edx, dword [ebp - 0x414]
cmp edx, 8
jb 0x40ff44
mov ecx, dword [ebp - 0x428]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x40ff3a
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x4102ac
push edx
push ecx
call fcn.004f2ead
add esp, 8
xor eax, eax
mov dword [ebp - 0x418], 0
mov dword [ebp - 0x414], 7
mov word [ebp - 0x428], ax
test esi, esi
je 0x410215
push 0xc
push str.Wtsapi32.dll
lea ecx, [ebp - 0x440]
mov dword [ebp - 0x430], eax
mov dword [ebp - 0x42c], 7
mov word [ebp - 0x440], ax
call fcn.00403ab0
lea ecx, [ebp - 0x440]
call fcn.004019c0
mov edx, dword [ebp - 0x42c]
mov dword [ebp - 0x48c], eax
cmp edx, 8
jb 0x40ffe9
mov ecx, dword [ebp - 0x440]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x40ffd9
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x4102b1
push edx
push ecx
call fcn.004f2ead
mov eax, dword [ebp - 0x48c]
add esp, 8
xor ecx, ecx
mov dword [ebp - 0x430], 0
mov dword [ebp - 0x42c], 7
mov word [ebp - 0x440], cx
test eax, eax
je 0x410215
push str.Userenv.dll
lea ecx, [ebp - 0x488]
call fcn.00402260
lea ecx, [ebp - 0x488]
call fcn.004019c0
mov edx, dword [ebp - 0x474]
mov dword [ebp - 0x498], eax
cmp edx, 8
jb 0x410075
mov ecx, dword [ebp - 0x488]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x410065
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x4102b6
push edx
push ecx
call fcn.004f2ead
mov eax, dword [ebp - 0x498]
add esp, 8
xor ecx, ecx
mov dword [ebp - 0x478], 0
mov dword [ebp - 0x474], 7
mov word [ebp - 0x488], cx
test eax, eax
je 0x410215
push str.advapi32.dll
lea ecx, [ebp - 0x470]
call fcn.00402260
lea ecx, [ebp - 0x470]
call fcn.004019c0
mov edx, dword [ebp - 0x45c]
mov dword [ebp - 0x490], eax
cmp edx, 8
jb 0x410101
mov ecx, dword [ebp - 0x470]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x4100f1
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x4102bb
push edx
push ecx
call fcn.004f2ead
mov eax, dword [ebp - 0x490]
add esp, 8
test eax, eax
je 0x410215
push str.WTSGetActiveConsoleSessionId
push esi
mov esi, dword [sym.imp.KERNEL32.dll_GetProcAddress]
call esi
mov dword [ebp - 0x490], eax
test eax, eax
je 0x410215
push str.WTSQueryUserToken
push dword [ebp - 0x48c]
call esi
mov dword [ebp - 0x48c], eax
test eax, eax
je 0x410215
push str.ExpandEnvironmentStringsForUserA
push dword [ebp - 0x498]
call esi
mov esi, eax
test esi, esi
je 0x410215
push str.SeTcbPrivilege
lea ecx, [ebp - 0x470]
call fcn.00402260
lea ecx, [ebp - 0x470]
call fcn.004018b0
mov edx, dword [ebp - 0x45c]
cmp edx, 8
jb 0x4101b2
mov ecx, dword [ebp - 0x470]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x4101a8
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x4102c0
push edx
push ecx
call fcn.004f2ead
add esp, 8
call dword [ebp - 0x490]
lea ecx, [ebp - 0x494]
push ecx
push eax
call dword [ebp - 0x48c]
test eax, eax
je 0x410215
push 0x400
lea eax, [ebp - 0x410]
push eax
push str._tmp_
push dword [ebp - 0x494]
call esi
test eax, eax
je 0x410215
lea ecx, [ebp - 0x410]
lea edx, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x4101f0
sub ecx, edx
lea eax, [ebp - 0x410]
push ecx
push eax
lea ecx, [ebp - 0x458]
call fcn.00409bb0
cmp dword [ebp - 0x448], 0
jne 0x41025c
push 0x400
lea eax, [ebp - 0x410]
push eax
push str._tmp_
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsA]
test eax, eax
je 0x41025c
lea ecx, [ebp - 0x410]
lea edx, [ecx + 1]
nop dword [eax]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x410240
sub ecx, edx
lea eax, [ebp - 0x410]
push ecx
push eax
lea ecx, [ebp - 0x458]
call fcn.00409bb0
push dword [ebp - 0x494]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
movups xmm0, xmmword [ebp - 0x458]
mov dword [edi + 0x10], 0
mov eax, edi
mov dword [edi + 0x14], 0
movups xmmword [edi], xmm0
movq xmm0, qword [ebp - 0x448]
movq qword [edi + 0x10], xmm0
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.004f313b
mov esp, ebp
pop ebp
ret 8
call fcn.004f855c
call fcn.004f855c
call fcn.004f855c
call fcn.004f855c
call fcn.004f855c
int3