Function at 0x40fa30
Capabilities:
Query environment variable

Disassembly:
push ebp
mov ebp, esp
sub esp, 0xc
push ebx
mov ebx, dword [ebp + 0xc]
xor eax, eax
xor ecx, ecx
mov dword [ebp - 4], eax
test byte [ebp + 0x10], 1
push esi
push edi
mov dword [ebp - 0xc], ecx
mov dword [ebp - 8], eax
je 0x40fb64
push 0x40
lea eax, [ebp - 4]
mov dword [ebp - 0xc], 0x40
push eax
call fcn.0040dfc0
mov esi, eax
test esi, esi
js 0x40fc92
push dword [ebp - 0xc]
mov edi, dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
push dword [ebp - 4]
push ebx
call edi
test eax, eax
jne 0x40fab6
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
test esi, esi
jle 0x40fa97
movzx esi, si
or esi, 0x80070000
test esi, esi
mov eax, 0x80004005
cmovns esi, eax
push esi
push 0xf7
push str.c:_buildagentwork1198dd0165ef29c7projects_third_partydutilpathutil.cpp
call fcn.0040fa20
jmp 0x40fc92
mov ecx, dword [ebp - 0xc]
cmp ecx, eax
jae 0x40fb26
push eax
mov dword [ebp - 0xc], eax
lea eax, [ebp - 4]
push eax
call fcn.0040dfc0
mov esi, eax
test esi, esi
js 0x40fc92
push dword [ebp - 0xc]
push dword [ebp - 4]
push ebx
call edi
test eax, eax
jne 0x40fb15
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
test esi, esi
jle 0x40faf6
movzx esi, si
or esi, 0x80070000
test esi, esi
mov eax, 0x80004005
cmovns esi, eax
push esi
push 0x102
push str.c:_buildagentwork1198dd0165ef29c7projects_third_partydutilpathutil.cpp
call fcn.0040fa20
jmp 0x40fc92
mov ecx, dword [ebp - 0xc]
cmp ecx, eax
jae 0x40fb26
mov esi, 0x8007007a
jmp 0x40fc92
cmp eax, 0x104
jbe 0x40fb61
lea eax, [ebp - 4]
push eax
call fcn.0040fd60
mov esi, eax
cmp esi, 0x80070057
je 0x40fb48
test esi, esi
js 0x40fc92
lea eax, [ebp - 0xc]
push eax
push dword [ebp - 4]
call fcn.0040e730
mov esi, eax
test esi, esi
js 0x40fc92
mov ecx, dword [ebp - 0xc]
mov eax, dword [ebp - 4]
test byte [ebp + 0x10], 2
je 0x40fc76
test eax, eax
mov dword [ebp + 0x10], 0
mov edx, ebx
mov edi, 0x40
cmovne edx, eax
cmp ecx, edi
lea eax, [ebp - 8]
mov dword [ebp + 0xc], edx
cmova edi, ecx
push edi
push eax
call fcn.0040dfc0
mov esi, eax
test esi, esi
js 0x40fc92
lea eax, [ebp + 0x10]
push eax
push dword [ebp - 8]
push edi
push dword [ebp + 0xc]
call dword [sym.imp.KERNEL32.dll_GetFullPathNameW]
test eax, eax
jne 0x40fbe6
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
test esi, esi
jle 0x40fbc7
movzx esi, si
or esi, 0x80070000
test esi, esi
mov eax, 0x80004005
cmovns esi, eax
push esi
push 0x128
push str.c:_buildagentwork1198dd0165ef29c7projects_third_partydutilpathutil.cpp
call fcn.0040fa20
jmp 0x40fc92
cmp edi, eax
jae 0x40fc5b
mov edi, eax
cmp eax, 0x104
jb 0x40fbf6
lea edi, [eax + 7]
push edi
lea eax, [ebp - 8]
push eax
call fcn.0040dfc0
mov esi, eax
test esi, esi
js 0x40fc92
lea eax, [ebp + 0x10]
push eax
push dword [ebp - 8]
push edi
push dword [ebp + 0xc]
call dword [sym.imp.KERNEL32.dll_GetFullPathNameW]
test eax, eax
jne 0x40fc50
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
test esi, esi
jle 0x40fc34
movzx esi, si
or esi, 0x80070000
test esi, esi
mov eax, 0x80004005
cmovns esi, eax
push esi
push 0x133
push str.c:_buildagentwork1198dd0165ef29c7projects_third_partydutilpathutil.cpp
call fcn.0040fa20
jmp 0x40fc92
cmp edi, eax
jae 0x40fc5b
mov esi, 0x8007007a
jmp 0x40fc92
cmp eax, 0x104
jbe 0x40fc71
lea eax, [ebp - 8]
push eax
call fcn.0040fd60
mov esi, eax
test esi, esi
js 0x40fc92
mov eax, dword [ebp - 8]
jmp 0x40fc80
mov dword [ebp - 8], eax
mov dword [ebp - 4], 0
test eax, eax
push 0
cmovne ebx, eax
push ebx
push dword [ebp + 8]
call fcn.0040e3d0
mov esi, eax
mov eax, dword [ebp - 8]
test eax, eax
je 0x40fc9f
push eax
call fcn.0040e720
mov eax, dword [ebp - 4]
test eax, eax
je 0x40fcac
push eax
call fcn.0040e720
pop edi
mov eax, esi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0xc