Function at 0x412d50
Capabilities:
Query environment variable

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x4b8134
mov eax, dword fs:[0]
push eax
sub esp, 0x544
mov eax, dword [0x4ff1a0]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
xor ebx, ebx
mov dword [ebp - 0x4b0], ebx
mov edi, ecx
mov esi, 0xf
mov dword [ebp - 0x4a0], edi
mov dword [ebp - 0x450], esi
mov dword [ebp - 0x454], ebx
mov byte [ebp - 0x464], bl
mov dword [ebp - 4], 1
xor eax, eax
cmp eax, str._tmp_
jne 0x412e01
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
cmp cl, bl
jne 0x412db8
sub eax, edx
cmp eax, ebx
jne 0x412e01
lea ecx, [ebp - 0x464]
push ecx
mov dword [edi + 0x14], esi
mov dword [edi + 0x10], ebx
mov ecx, edi
mov byte [edi], bl
call fcn.0040e5d0
mov dword [ebp - 0x4b0], 1
mov byte [ebp - 4], bl
cmp dword [ebp - 0x450], 0x10
jb 0x413467
mov edx, dword [ebp - 0x464]
push edx
jmp 0x41345f
push 0x3ff
lea eax, [ebp - 0x40f]
push ebx
push eax
mov byte [ebp - 0x410], bl
call fcn.004911e0
add esp, 0xc
xor ecx, ecx
push 0xc
mov word [ebp - 0x49c], cx
mov esi, 7
push str.Kernel32.dll
lea ecx, [ebp - 0x49c]
mov dword [ebp - 0x4a4], ebx
mov dword [ebp - 0x488], esi
mov dword [ebp - 0x48c], ebx
call fcn.0040e680
mov byte [ebp - 4], 2
lea ecx, [ebp - 0x49c]
call fcn.0042a2c0
mov dword [ebp - 0x4b8], eax
mov byte [ebp - 4], 1
cmp dword [ebp - 0x488], 8
jb 0x412e7f
mov edx, dword [ebp - 0x49c]
push edx
call fcn.00490458
add esp, 4
xor eax, eax
mov dword [ebp - 0x488], esi
mov dword [ebp - 0x48c], ebx
mov word [ebp - 0x49c], ax
cmp dword [ebp - 0x4b8], ebx
je 0x4133cc
xor ecx, ecx
push 0xc
mov word [ebp - 0x480], cx
push str.Wtsapi32.dll
lea ecx, [ebp - 0x480]
mov dword [ebp - 0x46c], esi
mov dword [ebp - 0x470], ebx
call fcn.0040e680
mov byte [ebp - 4], 3
lea ecx, [ebp - 0x480]
call fcn.0042a2c0
mov dword [ebp - 0x4ac], eax
mov byte [ebp - 4], 1
cmp dword [ebp - 0x46c], 8
jb 0x412ef8
mov edx, dword [ebp - 0x480]
push edx
call fcn.00490458
add esp, 4
xor eax, eax
mov dword [ebp - 0x46c], esi
mov dword [ebp - 0x470], ebx
mov word [ebp - 0x480], ax
cmp dword [ebp - 0x4ac], ebx
je 0x4133cc
xor ecx, ecx
push 0xb
mov word [ebp - 0x448], cx
push str.Userenv.dll
lea ecx, [ebp - 0x448]
mov dword [ebp - 0x434], esi
mov dword [ebp - 0x438], ebx
call fcn.0040e680
mov byte [ebp - 4], 4
lea ecx, [ebp - 0x448]
call fcn.0042a2c0
mov dword [ebp - 0x4b4], eax
mov byte [ebp - 4], 1
cmp dword [ebp - 0x434], 8
jb 0x412f71
mov edx, dword [ebp - 0x448]
push edx
call fcn.00490458
add esp, 4
xor eax, eax
mov dword [ebp - 0x434], esi
mov dword [ebp - 0x438], ebx
mov word [ebp - 0x448], ax
cmp dword [ebp - 0x4b4], ebx
je 0x4133cc
push str.advapi32.dll
lea ecx, [ebp - 0x42c]
call fcn.0040e770
mov byte [ebp - 4], 5
lea ecx, [ebp - 0x42c]
call fcn.0042a2c0
mov dword [ebp - 0x4a8], eax
mov byte [ebp - 4], 1
cmp dword [ebp - 0x418], 8
jb 0x412fd3
mov ecx, dword [ebp - 0x42c]
push ecx
call fcn.00490458
add esp, 4
xor edx, edx
mov dword [ebp - 0x418], esi
mov dword [ebp - 0x41c], ebx
mov word [ebp - 0x42c], dx
cmp dword [ebp - 0x4a8], ebx
je 0x4133cc
mov eax, dword [ebp - 0x4b8]
mov edi, dword [sym.imp.KERNEL32.dll_GetProcAddress]
push 0x4c4c80
push eax
call edi
mov dword [ebp - 0x4a8], eax
cmp eax, ebx
jne 0x4130d1
push 1
push 2
lea ecx, [ebp - 0x550]
call fcn.00413cc0
mov byte [ebp - 4], 6
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push ecx
lea ecx, [ebp - 0x550]
push str.GetProcAddress__WTSGetActiveConsoleSessionId__FAILED._GetLastError:
push ecx
call fcn.00416b90
add esp, 0xc
push eax
call fcn.004135f0
push str.CPathUtility::GetPathFromEvr
lea ecx, [ebp - 0x448]
call fcn.0040ece0
mov byte [ebp - 4], 7
push str.PathUtility.cpp
lea ecx, [ebp - 0x42c]
call fcn.0040ece0
mov byte [ebp - 4], 8
lea edx, [ebp - 0x480]
push edx
lea ecx, [ebp - 0x550]
call fcn.00413de0
mov byte [ebp - 4], 9
push eax
lea eax, [ebp - 0x448]
push eax
push 0x1dc
lea ecx, [ebp - 0x42c]
push ecx
push ebx
call fcn.004144e0
mov ecx, eax
call fcn.0042e360
mov byte [ebp - 4], 8
lea ecx, [ebp - 0x480]
call fcn.0040f320
mov byte [ebp - 4], 7
lea ecx, [ebp - 0x42c]
call fcn.0040f350
mov byte [ebp - 4], 6
jmp 0x4133ac
mov edx, dword [ebp - 0x4ac]
push 0x4c4d2c
push edx
call edi
mov esi, eax
cmp esi, ebx
jne 0x4131a4
push 1
push 2
lea ecx, [ebp - 0x550]
call fcn.00413cc0
mov byte [ebp - 4], 0xa
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push ecx
lea eax, [ebp - 0x550]
push str.GetProcAddress__WTSQueryUserToken__FAILED._GetLastError:
push eax
call fcn.00416b90
add esp, 0xc
push eax
call fcn.004135f0
push str.CPathUtility::GetPathFromEvr
lea ecx, [ebp - 0x448]
call fcn.0040ece0
mov byte [ebp - 4], 0xb
push str.PathUtility.cpp
lea ecx, [ebp - 0x42c]
call fcn.0040ece0
mov byte [ebp - 4], 0xc
lea ecx, [ebp - 0x480]
push ecx
lea ecx, [ebp - 0x550]
call fcn.00413de0
mov byte [ebp - 4], 0xd
push eax
lea edx, [ebp - 0x448]
push edx
push 0x1e3
lea eax, [ebp - 0x42c]
push eax
push ebx
call fcn.004144e0
mov ecx, eax
call fcn.0042e360
mov byte [ebp - 4], 0xc
lea ecx, [ebp - 0x480]
call fcn.0040f320
mov byte [ebp - 4], 0xb
lea ecx, [ebp - 0x42c]
call fcn.0040f350
mov byte [ebp - 4], 0xa
jmp 0x4133ac
mov ecx, dword [ebp - 0x4b4]
push str.ExpandEnvironmentStringsForUserA
push ecx
call edi
mov edi, eax
cmp edi, ebx
jne 0x413277
push 1
push 2
lea ecx, [ebp - 0x550]
call fcn.00413cc0
mov byte [ebp - 4], 0xe
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push ecx
lea edx, [ebp - 0x550]
push str.GetProcAddress__ExpandEnvironmentStringsForUserA__FAILED._GetLastError:
push edx
call fcn.00416b90
add esp, 0xc
push eax
call fcn.004135f0
push str.CPathUtility::GetPathFromEvr
lea ecx, [ebp - 0x448]
call fcn.0040ece0
mov byte [ebp - 4], 0xf
push str.PathUtility.cpp
lea ecx, [ebp - 0x42c]
call fcn.0040ece0
mov byte [ebp - 4], 0x10
lea eax, [ebp - 0x480]
push eax
lea ecx, [ebp - 0x550]
call fcn.00413de0
mov byte [ebp - 4], 0x11
push eax
lea ecx, [ebp - 0x448]
push ecx
push 0x1ea
lea edx, [ebp - 0x42c]
push edx
push ebx
call fcn.004144e0
mov ecx, eax
call fcn.0042e360
mov byte [ebp - 4], 0x10
lea ecx, [ebp - 0x480]
call fcn.0040f320
mov byte [ebp - 4], 0xf
lea ecx, [ebp - 0x42c]
call fcn.0040f350
mov byte [ebp - 4], 0xe
jmp 0x4133ac
push str.SeTcbPrivilege
lea ecx, [ebp - 0x42c]
call fcn.0040e770
mov byte [ebp - 4], 0x12
lea eax, [ebp - 0x42c]
push eax
call fcn.0042a520
add esp, 4
mov byte [ebp - 4], 1
lea ecx, [ebp - 0x42c]
call fcn.0040f320
call dword [ebp - 0x4a8]
lea ecx, [ebp - 0x4a4]
push ecx
push eax
call esi
cmp eax, ebx
je 0x4132f6
mov eax, dword [ebp - 0x4a4]
push 0x400
lea edx, [ebp - 0x410]
push edx
push str._tmp_
push eax
call edi
cmp eax, ebx
je 0x4133c6
lea ecx, [ebp - 0x464]
push ecx
lea edx, [ebp - 0x410]
call fcn.00404840
jmp 0x4133c6
push 1
push 2
lea ecx, [ebp - 0x550]
call fcn.00413cc0
mov byte [ebp - 4], 0x13
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push ecx
lea edx, [ebp - 0x550]
push str.WTSQueryUserToken_FAILED._GetLastError:
push edx
call fcn.00416b90
add esp, 0xc
push eax
call fcn.004135f0
push str.CPathUtility::GetPathFromEvr
lea ecx, [ebp - 0x448]
call fcn.0040ece0
mov byte [ebp - 4], 0x14
push str.PathUtility.cpp
lea ecx, [ebp - 0x42c]
call fcn.0040ece0
mov byte [ebp - 4], 0x15
lea eax, [ebp - 0x480]
push eax
lea ecx, [ebp - 0x550]
call fcn.00413de0
mov byte [ebp - 4], 0x16
push eax
lea ecx, [ebp - 0x448]
push ecx
push 0x1ff
lea edx, [ebp - 0x42c]
push edx
push ebx
call fcn.004144e0
mov ecx, eax
call fcn.0042e360
mov byte [ebp - 4], 0x15
lea ecx, [ebp - 0x480]
call fcn.0040f320
mov byte [ebp - 4], 0x14
lea ecx, [ebp - 0x42c]
call fcn.0040f350
mov byte [ebp - 4], 0x13
lea ecx, [ebp - 0x448]
call fcn.0040f350
mov byte [ebp - 4], 1
lea ecx, [ebp - 0x550]
call fcn.00412cc0
mov edi, dword [ebp - 0x4a0]
cmp dword [ebp - 0x454], ebx
jne 0x413414
push 0x400
lea eax, [ebp - 0x410]
push eax
push str._tmp_
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsA]
cmp eax, ebx
je 0x413414
lea eax, [ebp - 0x410]
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
cmp cl, bl
jne 0x4133f8
sub eax, edx
push eax
lea ecx, [ebp - 0x410]
push ecx
lea ecx, [ebp - 0x464]
call fcn.0040ebe0
mov edx, dword [ebp - 0x4a4]
push edx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
lea eax, [ebp - 0x464]
mov esi, 0xf
mov dword [ebp - 0x4a4], ebx
mov dword [edi + 0x14], esi
mov dword [edi + 0x10], ebx
push eax
mov ecx, edi
mov byte [edi], bl
call fcn.0040e5d0
mov dword [ebp - 0x4b0], 1
mov byte [ebp - 4], bl
cmp dword [ebp - 0x450], 0x10
jb 0x413467
mov ecx, dword [ebp - 0x464]
push ecx
call fcn.00490458
add esp, 4
mov dword [ebp - 0x450], esi
mov dword [ebp - 0x454], ebx
mov byte [ebp - 0x464], bl
mov eax, edi
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.004911d1
mov esp, ebp
pop ebp
ret