Function at 0x40bd50
Capabilities:
Query environment variable

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x509f7b
mov eax, dword fs:[0]
push eax
sub esp, 0x48c
mov eax, dword [0x53307c]
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.004e7890
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.00405140
cmp dword [ebp - 0x418], 0
je 0x40be42
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 0x40be44
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 0x40be44
xor esi, esi
mov edx, dword [ebp - 0x414]
cmp edx, 8
jb 0x40be84
mov ecx, dword [ebp - 0x428]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x40be7a
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x40c1ec
push edx
push ecx
call fcn.0049e956
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 0x40c155
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.00405140
lea ecx, [ebp - 0x440]
call fcn.0040cf40
mov edx, dword [ebp - 0x42c]
mov dword [ebp - 0x48c], eax
cmp edx, 8
jb 0x40bf29
mov ecx, dword [ebp - 0x440]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x40bf19
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x40c1f1
push edx
push ecx
call fcn.0049e956
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 0x40c155
push str.Userenv.dll
lea ecx, [ebp - 0x488]
call fcn.00404f50
lea ecx, [ebp - 0x488]
call fcn.0040cf40
mov edx, dword [ebp - 0x474]
mov dword [ebp - 0x498], eax
cmp edx, 8
jb 0x40bfb5
mov ecx, dword [ebp - 0x488]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x40bfa5
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x40c1f6
push edx
push ecx
call fcn.0049e956
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 0x40c155
push str.advapi32.dll
lea ecx, [ebp - 0x470]
call fcn.00404f50
lea ecx, [ebp - 0x470]
call fcn.0040cf40
mov edx, dword [ebp - 0x45c]
mov dword [ebp - 0x490], eax
cmp edx, 8
jb 0x40c041
mov ecx, dword [ebp - 0x470]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x40c031
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x40c1fb
push edx
push ecx
call fcn.0049e956
mov eax, dword [ebp - 0x490]
add esp, 8
test eax, eax
je 0x40c155
push str.WTSGetActiveConsoleSessionId
push esi
mov esi, dword [sym.imp.KERNEL32.dll_GetProcAddress]
call esi
mov dword [ebp - 0x490], eax
test eax, eax
je 0x40c155
push str.WTSQueryUserToken
push dword [ebp - 0x48c]
call esi
mov dword [ebp - 0x48c], eax
test eax, eax
je 0x40c155
push str.ExpandEnvironmentStringsForUserA
push dword [ebp - 0x498]
call esi
mov esi, eax
test esi, esi
je 0x40c155
push str.SeTcbPrivilege
lea ecx, [ebp - 0x470]
call fcn.00404f50
lea ecx, [ebp - 0x470]
call fcn.0040ce30
mov edx, dword [ebp - 0x45c]
cmp edx, 8
jb 0x40c0f2
mov ecx, dword [ebp - 0x470]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x40c0e8
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x40c200
push edx
push ecx
call fcn.0049e956
add esp, 8
call dword [ebp - 0x490]
lea ecx, [ebp - 0x494]
push ecx
push eax
call dword [ebp - 0x48c]
test eax, eax
je 0x40c155
push 0x400
lea eax, [ebp - 0x410]
push eax
push str._tmp_
push dword [ebp - 0x494]
call esi
test eax, eax
je 0x40c155
lea ecx, [ebp - 0x410]
lea edx, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x40c130
sub ecx, edx
lea eax, [ebp - 0x410]
push ecx
push eax
lea ecx, [ebp - 0x458]
call fcn.00401c70
cmp dword [ebp - 0x448], 0
jne 0x40c19c
push 0x400
lea eax, [ebp - 0x410]
push eax
push str._tmp_
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsA]
test eax, eax
je 0x40c19c
lea ecx, [ebp - 0x410]
lea edx, [ecx + 1]
nop dword [eax]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x40c180
sub ecx, edx
lea eax, [ebp - 0x410]
push ecx
push eax
lea ecx, [ebp - 0x458]
call fcn.00401c70
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.0049e964
mov esp, ebp
pop ebp
ret 8
call fcn.004e9a8c
call fcn.004e9a8c
call fcn.004e9a8c
call fcn.004e9a8c
call fcn.004e9a8c
int3