Function at 0x40ba80
Capabilities:
Get common file path
Query or enumerate registry value

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x278
mov eax, dword [0x445080]
xor eax, ebp
mov dword [ebp - 4], eax
push edi
mov edi, edx
mov dword [ebp - 0x274], ecx
test edi, edi
jne 0x40bab4
mov eax, 0x80070057
pop edi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00412b32
mov esp, ebp
pop ebp
ret
push esi
push 0x104
push edi
call fcn.0040dfc0
mov esi, eax
test esi, esi
js 0x40bcf7
mov eax, dword [edi]
xor esi, esi
push ebx
mov dword [ebp - 0x264], eax
call fcn.0040fe90
mov ebx, eax
test ebx, ebx
je 0x40bbe4
mov ecx, ebx
lea edx, [ecx + 2]
nop dword [eax]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x40baf0
sub ecx, edx
sar ecx, 1
je 0x40bbe4
push ebx
lea eax, [ebp - 0x268]
mov dword [ebp - 0x268], esi
push str._sSoftwareMicrosoftWindowsCurrentVersionExplorerShell_Folders
push eax
call fcn.0040e130
push 0x208
lea eax, [ebp - 0x25c]
mov dword [ebp - 0x260], esi
push 0
push eax
call fcn.00414fa0
add esp, 0x18
mov dword [ebp - 0x26c], 0x206
lea eax, [ebp - 0x260]
mov dword [ebp - 0x270], 1
push eax
push 0x20019
push 0
push dword [ebp - 0x268]
push 0x80000003
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
test eax, eax
jne 0x40bbdb
lea eax, [ebp - 0x26c]
push eax
lea eax, [ebp - 0x25c]
push eax
lea eax, [ebp - 0x270]
push eax
push 0
push str.Local_AppData
push dword [ebp - 0x260]
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
test eax, eax
jne 0x40bbcf
lea eax, [ebp - 0x25c]
push eax
lea eax, [ebp - 0x264]
push str._sTemp
push eax
call fcn.0040e130
mov esi, dword [ebp - 0x264]
add esp, 0xc
lea ecx, [esi + 2]
mov ax, word [esi]
add esi, 2
test ax, ax
jne 0x40bbc0
sub esi, ecx
sar esi, 1
push dword [ebp - 0x260]
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
push ebx
call dword [sym.imp.KERNEL32.dll_LocalFree]
jmp 0x40bbf7
push dword [ebp - 0x264]
push 0x104
call dword [sym.imp.KERNEL32.dll_GetTempPathW]
mov esi, eax
test esi, esi
je 0x40bc03
cmp esi, 0x104
jb 0x40bc12
push dword [edi]
push 0x104
call dword [sym.imp.KERNEL32.dll_GetTempPathW]
mov esi, eax
test esi, esi
je 0x40bcc7
cmp esi, 0x104
jae 0x40bcc7
push 0
push 0x43fe80
push edi
call fcn.0040e020
mov esi, eax
test esi, esi
js 0x40bcf6
mov ebx, dword [ebp - 0x274]
lea eax, [ebp - 0x54]
push 0x27
push eax
lea eax, [ebx + 0x8c]
push eax
call dword [sym.imp.ole32.dll_StringFromGUID2]
mov esi, eax
test esi, esi
js 0x40bcf6
push 0
lea eax, [ebp - 0x54]
push eax
push edi
call fcn.0040e020
mov esi, eax
test esi, esi
js 0x40bcf6
push 0
push 0x43fe80
push edi
call fcn.0040e020
mov esi, eax
test esi, esi
js 0x40bcf6
push 0
push dword [edi]
call fcn.0040f8e0
mov esi, eax
test esi, esi
js 0x40bcf6
push 0
lea eax, [ebx + 0xc]
push eax
push edi
call fcn.0040e020
mov esi, eax
test esi, esi
js 0x40bcf6
push 2
push dword [edi]
push ebx
call fcn.0040e8c0
pop ebx
mov esi, eax
pop esi
pop edi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00412b32
mov esp, ebp
pop ebp
ret
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
test esi, esi
jle 0x40bcdc
movzx esi, si
or esi, 0x80070000
test esi, esi
mov eax, 0x80004005
cmovns esi, eax
push esi
push 0x1ff
push str.c:_buildagentwork_a8a3f5ed687aa1d8projects_setupexe_setupexe.cpp
call fcn.0040fa20
pop ebx
mov ecx, dword [ebp - 4]
mov eax, esi
pop esi
xor ecx, ebp
pop edi
call fcn.00412b32
mov esp, ebp
pop ebp
ret