Function at 0x510520
Capabilities:
Get common file path
Query environment variable

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x59a6ed
mov eax, dword fs:[0]
push eax
sub esp, 0x26c
mov eax, dword [0x61094c]
xor eax, ebp
mov dword [ebp - 0x10], eax
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov esi, dword [ebp + 0xc]
mov edi, dword [ebp + 8]
mov eax, dword [ebp + 0x10]
mov dword [ebp - 0x260], edi
mov dword [ebp - 0x25c], 0
mov edx, dword [esi + 0x14]
mov ecx, dword [esi + 0x10]
mov dword [ebp - 0x24c], eax
mov eax, esi
mov dword [ebp - 0x270], edi
mov dword [ebp - 0x260], esi
cmp edx, 8
jb 0x510587
mov eax, dword [esi]
cmp ecx, 0x16
jne 0x5107c4
push ecx
push str.CSIDL_PROGRAM_FILESX64
push eax
call fcn.0042f980
add esp, 0xc
test eax, eax
jne 0x5107be
mov dword [ebp - 0x230], eax
mov dword [ebp - 0x220], eax
mov dword [ebp - 0x21c], 7
mov word [ebp - 0x230], ax
mov esi, dword [ebp - 0x24c]
mov dword [ebp - 4], eax
test esi, esi
je 0x510610
push dword [0x60c620]
lea ecx, [ebp - 0x248]
call fcn.004246c0
lea eax, [ebp - 0x230]
mov byte [ebp - 4], 1
push eax
lea eax, [ebp - 0x248]
mov dword [ebp - 0x25c], 1
push eax
mov ecx, esi
call fcn.00501810
mov byte [ebp - 0x24d], 0
test al, al
jne 0x510617
mov byte [ebp - 0x24d], 1
test byte [ebp - 0x25c], 1
mov dword [ebp - 4], 0
je 0x510632
lea ecx, [ebp - 0x248]
call fcn.00424580
cmp byte [ebp - 0x24d], 0
je 0x510673
push str.Unable_to_get_the_platform
push 0x38
push str.XMLUpdater::v2::CDirSubstitution::Substitute
push str.E:BT71e4c9fa_1978_4386_a3da_49ea31fa22b7WebAdvisor_XmlUpdater_srcXmlUpdaterDirSubstitution.cpp
push 1
call fcn.00500e60
add esp, 0x14
push dword [0x60c61c]
mov ecx, edi
call fcn.004246c0
lea ecx, [ebp - 0x230]
call fcn.00424580
jmp 0x510b9b
push 0x208
lea eax, [ebp - 0x218]
push 0
push eax
call fcn.005561e0
mov eax, dword [ebp - 0x230]
lea ecx, [ebp - 0x230]
add esp, 0xc
cmp dword [ebp - 0x21c], 8
cmovae ecx, eax
cmp dword [ebp - 0x220], 2
mov dword [ebp - 0x254], ecx
jne 0x5106f4
movzx ecx, word [ecx]
mov esi, 0x36
mov edx, 2
mov eax, 0x5a3e44
cmp ecx, esi
jb 0x5106ee
sub dword [ebp - 0x254], eax
cmp cx, si
ja 0x5106ee
cmp edx, 1
je 0x510790
mov ecx, dword [ebp - 0x254]
add eax, 2
dec edx
movzx ecx, word [ecx + eax]
movzx esi, word [eax]
cmp cx, si
jae 0x5106cd
mov eax, dword [ebp - 0x230]
cmp dword [ebp - 0x21c], 8
lea ecx, [ebp - 0x230]
cmovae ecx, eax
cmp dword [ebp - 0x220], 5
mov dword [ebp - 0x254], ecx
jne 0x51074f
movzx ecx, word [ecx]
mov esi, 0x41
mov edx, 5
mov eax, str.ARM64
cmp ecx, esi
jb 0x51074f
sub dword [ebp - 0x254], eax
cmp cx, si
ja 0x51074f
cmp edx, 1
je 0x510790
mov ecx, dword [ebp - 0x254]
add eax, 2
dec edx
movzx ecx, word [ecx + eax]
movzx esi, word [eax]
cmp cx, si
jae 0x510732
mov eax, str.ProgramFiles
push 0x104
lea ecx, [ebp - 0x218]
push ecx
push eax
call dword [sym.imp.KERNEL32.dll_GetEnvironmentVariableW]
test eax, eax
je 0x510797
cmp eax, 0x104
ja 0x510797
lea eax, [ebp - 0x218]
mov ecx, edi
push eax
call fcn.004246c0
lea ecx, [ebp - 0x230]
call fcn.00424580
jmp 0x510b9b
mov eax, str.ProgramW6432
jmp 0x510754
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.GetEnvironmentVariable_failed___d_
push 0x41
push str.XMLUpdater::v2::CDirSubstitution::Substitute
push str.E:BT71e4c9fa_1978_4386_a3da_49ea31fa22b7WebAdvisor_XmlUpdater_srcXmlUpdaterDirSubstitution.cpp
push 1
call fcn.00500e60
add esp, 0x18
jmp 0x510656
mov ecx, dword [esi + 0x10]
mov edx, dword [esi + 0x14]
mov eax, esi
cmp edx, 8
jb 0x5107cd
mov eax, dword [esi]
cmp ecx, 0x1d
jne 0x5109dc
push ecx
push str.CSIDL_PROGRAM_FILES_COMMONX64
push eax
call fcn.0042f980
add esp, 0xc
test eax, eax
jne 0x5109dc
mov dword [ebp - 0x230], eax
mov dword [ebp - 0x220], eax
mov dword [ebp - 0x21c], 7
mov word [ebp - 0x230], ax
mov esi, dword [ebp - 0x24c]
mov dword [ebp - 4], 2
test esi, esi
je 0x51085a
push dword [0x60c620]
lea ecx, [ebp - 0x248]
call fcn.004246c0
lea eax, [ebp - 0x230]
mov byte [ebp - 4], 3
push eax
lea eax, [ebp - 0x248]
mov dword [ebp - 0x25c], 4
push eax
mov ecx, esi
call fcn.00501810
mov byte [ebp - 0x24d], 0
test al, al
jne 0x510861
mov byte [ebp - 0x24d], 1
test byte [ebp - 0x25c], 4
mov dword [ebp - 4], 2
je 0x51087c
lea ecx, [ebp - 0x248]
call fcn.00424580
cmp byte [ebp - 0x24d], 0
je 0x510891
push str.Unable_to_get_the_platform
push 0x4e
jmp 0x510642
push 0x208
lea eax, [ebp - 0x218]
push 0
push eax
call fcn.005561e0
mov eax, dword [ebp - 0x230]
lea ecx, [ebp - 0x230]
add esp, 0xc
cmp dword [ebp - 0x21c], 8
cmovae ecx, eax
cmp dword [ebp - 0x220], 2
mov dword [ebp - 0x254], ecx
jne 0x510912
movzx ecx, word [ecx]
mov esi, 0x36
mov edx, 2
mov eax, 0x5a3e44
cmp ecx, esi
jb 0x51090c
sub dword [ebp - 0x254], eax
cmp cx, si
ja 0x51090c
cmp edx, 1
je 0x5109ae
mov ecx, dword [ebp - 0x254]
add eax, 2
dec edx
movzx ecx, word [eax + ecx]
movzx esi, word [eax]
cmp cx, si
jae 0x5108eb
mov eax, dword [ebp - 0x230]
cmp dword [ebp - 0x21c], 8
lea ecx, [ebp - 0x230]
cmovae ecx, eax
cmp dword [ebp - 0x220], 5
mov dword [ebp - 0x254], ecx
jne 0x51096d
movzx ecx, word [ecx]
mov esi, 0x41
mov edx, 5
mov eax, str.ARM64
cmp ecx, esi
jb 0x51096d
sub dword [ebp - 0x254], eax
cmp cx, si
ja 0x51096d
cmp edx, 1
je 0x5109ae
mov ecx, dword [ebp - 0x254]
add eax, 2
dec edx
movzx ecx, word [eax + ecx]
movzx esi, word [eax]
cmp cx, si
jae 0x510950
mov eax, str.CommonProgramFiles
push 0x104
lea ecx, [ebp - 0x218]
push ecx
push eax
call dword [sym.imp.KERNEL32.dll_GetEnvironmentVariableW]
test eax, eax
je 0x5109b5
cmp eax, 0x104
ja 0x5109b5
lea eax, [ebp - 0x218]
mov ecx, edi
push eax
call fcn.004246c0
lea ecx, [ebp - 0x230]
call fcn.00424580
jmp 0x510b9b
mov eax, str.CommonProgramW6432
jmp 0x510972
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.GetEnvironmentVariable_failed___d_
push 0x57
push str.XMLUpdater::v2::CDirSubstitution::Substitute
push str.E:BT71e4c9fa_1978_4386_a3da_49ea31fa22b7WebAdvisor_XmlUpdater_srcXmlUpdaterDirSubstitution.cpp
push 1
call fcn.00500e60
add esp, 0x18
jmp 0x510656
push dword [0x60c618]
push esi
call fcn.00437980
add esp, 8
test al, al
je 0x510ada
lea eax, [ebp - 0x264]
mov dword [ebp - 0x264], 0
push eax
lea eax, [ebp - 0x248]
mov dword [ebp - 0x260], 0x60c5e8
push eax
call fcn.00510fb0
add esp, 8
mov ecx, dword [ebp - 0x260]
mov edx, dword [ebp - 0x264]
mov dword [ebp - 4], 4
mov eax, dword [ecx + 4]
cmp eax, dword [0x60c5ec]
jne 0x510a5d
test edx, edx
jne 0x510a5d
lea eax, [ebp - 0x248]
mov ecx, edi
push eax
call fcn.00428970
lea ecx, [ebp - 0x248]
call fcn.00424580
jmp 0x510b9b
mov eax, dword [ecx]
push edx
mov esi, dword [eax + 8]
lea eax, [ebp - 0x230]
push eax
mov ecx, esi
call dword [0x5a0478]
mov ecx, dword [ebp - 0x260]
call esi
cmp dword [ebp - 0x21c], 0x10
lea eax, [ebp - 0x230]
mov byte [ebp - 4], 5
cmovae eax, dword [ebp - 0x230]
push eax
push str.Unable_to_get_temp_directory_path._Error:__hs
push 0x63
push str.XMLUpdater::v2::CDirSubstitution::Substitute
push str.E:BT71e4c9fa_1978_4386_a3da_49ea31fa22b7WebAdvisor_XmlUpdater_srcXmlUpdaterDirSubstitution.cpp
push 1
call fcn.00500e60
add esp, 0x18
mov byte [ebp - 4], 4
lea ecx, [ebp - 0x230]
call fcn.00424840
push dword [0x60c61c]
mov ecx, edi
call fcn.004246c0
lea ecx, [ebp - 0x248]
call fcn.00424580
jmp 0x510b9b
mov eax, dword fs:[0x2c]
mov ecx, dword [0x61f218]
mov ecx, dword [eax + ecx*4]
mov eax, dword [0x61e9a0]
cmp eax, dword [ecx + 8]
jg 0x510c48
push esi
lea eax, [ebp - 0x23c]
mov ecx, 0x61e998
push eax
call fcn.0042fb00
mov ecx, dword [ebp - 0x234]
cmp byte [ecx + 0xd], 0
jne 0x510b68
mov eax, dword [ecx + 0x20]
add ecx, 0x10
mov dword [ebp - 0x258], eax
cmp dword [ecx + 0x14], 8
jb 0x510b2c
mov ecx, dword [ecx]
cmp dword [esi + 0x14], 8
mov edx, dword [esi + 0x10]
mov dword [ebp - 0x254], esi
jb 0x510b43
mov eax, dword [esi]
mov dword [ebp - 0x254], eax
cmp dword [ebp - 0x258], edx
mov eax, edx
cmovb eax, dword [ebp - 0x258]
push eax
push ecx
push dword [ebp - 0x254]
call fcn.0042f980
add esp, 0xc
test eax, eax
je 0x510bba
jns 0x510bc5
mov eax, dword [esi + 0x14]
cmp eax, 8
jb 0x510b72
mov esi, dword [esi]
push esi
push str.Unknown_folder_identifier:__s
push 0x7a
push str.XMLUpdater::v2::CDirSubstitution::Substitute
push str.E:BT71e4c9fa_1978_4386_a3da_49ea31fa22b7WebAdvisor_XmlUpdater_srcXmlUpdaterDirSubstitution.cpp
push 1
call fcn.00500e60
add esp, 0x18
mov ecx, edi
push dword [0x60c61c]
call fcn.004246c0
mov eax, edi
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.00553d2a
mov esp, ebp
pop ebp
ret 0xc
mov eax, dword [ebp - 0x258]
cmp dword [esi + 0x10], eax
jb 0x510b68
mov eax, dword [ebp - 0x234]
cmp eax, dword [0x61e998]
je 0x510b68
lea ecx, [ebp - 0x24c]
mov dword [ebp - 0x24c], 0
push ecx
push 0
push 0
add eax, 0x28
push eax
call sub.SHELL32.dll_SHGetKnownFolderPath
test eax, eax
je 0x510c0d
cmp dword [esi + 0x14], 8
jb 0x510bfd
mov esi, dword [esi]
push esi
push str.Error_retrieving_directory__s
push 0x81
jmp 0x510b7a
push dword [ebp - 0x24c]
lea ecx, [ebp - 0x230]
call fcn.004246c0
push dword [ebp - 0x24c]
call dword [sym.imp.ole32.dll_CoTaskMemFree]
lea eax, [ebp - 0x230]
mov ecx, edi
push eax
call fcn.0042d7d0
lea ecx, [ebp - 0x230]
call fcn.00424580
jmp 0x510b9b
push 0x61e9a0
call fcn.00553e6b
add esp, 4
cmp dword [0x61e9a0], 0xffffffff
jne 0x510afa
push str.CSIDL_COMMON_APPDATA
lea ecx, [ebp - 0x1f0]
mov dword [ebp - 4], 6
call fcn.004246c0
movups xmm0, xmmword [0x5c2bf8]
movups xmmword [ebp - 0x1d8], xmm0
push str.CSIDL_COMMON_DOCUMENTS
lea ecx, [ebp - 0x1c8]
mov byte [ebp - 4], 7
call fcn.004246c0
movups xmm0, xmmword [0x5c2be8]
movups xmmword [ebp - 0x1b0], xmm0
push str.CSIDL_COMMON_STARTUP
lea ecx, [ebp - 0x1a0]
mov byte [ebp - 4], 8
call fcn.004246c0
movups xmm0, xmmword [0x5c2bd8]
movups xmmword [ebp - 0x188], xmm0
push str.CSIDL_PROGRAM_FILES
lea ecx, [ebp - 0x178]
mov byte [ebp - 4], 9
call fcn.004246c0
movups xmm0, xmmword [0x5c2bc8]
movups xmmword [ebp - 0x160], xmm0
push str.CSIDL_PROGRAM_FILESX86
lea ecx, [ebp - 0x150]
mov byte [ebp - 4], 0xa
call fcn.004246c0
movups xmm0, xmmword [0x5c2bb8]
movups xmmword [ebp - 0x138], xmm0
push str.CSIDL_PROGRAM_FILESX64
lea ecx, [ebp - 0x128]
mov byte [ebp - 4], 0xb
call fcn.004246c0
movups xmm0, xmmword [0x5c2ba8]
movups xmmword [ebp - 0x110], xmm0
push str.CSIDL_PROGRAM_FILES_COMMON
lea ecx, [ebp - 0x100]
mov byte [ebp - 4], 0xc
call fcn.004246c0
movups xmm0, xmmword [0x5c2b98]
movups xmmword [ebp - 0xe8], xmm0
push str.CSIDL_PROGRAM_FILES_COMMONX86
lea ecx, [ebp - 0xd8]
mov byte [ebp - 4], 0xd
call fcn.004246c0
movups xmm0, xmmword [0x5c2dc8]
movups xmmword [ebp - 0xc0], xmm0
push str.CSIDL_PROGRAM_FILES_COMMONX64
lea ecx, [ebp - 0xb0]
mov byte [ebp - 4], 0xe
call fcn.004246c0
movups xmm0, xmmword [0x5c3008]
movups xmmword [ebp - 0x98], xmm0
push str.CSIDL_SYSTEM
lea ecx, [ebp - 0x88]
mov byte [ebp - 4], 0xf
call fcn.004246c0
movups xmm0, xmmword [0x5c2b88]
movups xmmword [ebp - 0x70], xmm0
push str.CSIDL_SYSTEMX86
lea ecx, [ebp - 0x60]
mov byte [ebp - 4], 0x10
call fcn.004246c0
movups xmm0, xmmword [0x5c2b78]
movups xmmword [ebp - 0x48], xmm0
mov byte [ebp - 4], 0x11
lea ecx, [ebp - 0x38]
push str.CSIDL_WINDOWS
call fcn.004246c0
movups xmm0, xmmword [0x5c2b68]
movups xmmword [ebp - 0x20], xmm0
lea eax, [ebp - 0x1f0]
mov byte [ebp - 4], 0x12
push 0x38
mov dword [ebp - 0x254], eax
mov dword [0x61e998], 0
mov dword [0x61e99c], 0
call fcn.00553f41
mov ecx, eax
add esp, 4
mov dword [ebp - 0x26c], ecx
mov dword [ecx], ecx
mov dword [ecx + 4], ecx
mov dword [ecx + 8], ecx
mov word [ecx + 0xc], 0x101
mov dword [0x61e998], ecx
lea eax, [ebp - 0x1f0]
mov byte [ebp - 4], 0x13
lea edx, [ebp - 0x10]
cmp eax, edx
je 0x510f69
lea esi, [eax + 0x18]
mov dword [ebp - 0x258], esi
jmp 0x510e58
push eax
push ecx
lea eax, [ebp - 0x224]
mov ecx, 0x61e998
push eax
call fcn.00434b20
movq xmm0, qword [eax]
mov eax, dword [eax + 8]
movq qword [ebp - 0x23c], xmm0
mov dword [ebp - 0x234], eax
test al, al
jne 0x510f2e
cmp dword [0x61e99c], 0x4924924
je 0x510f58
mov eax, dword [0x61e998]
mov dword [ebp - 0x268], eax
mov dword [ebp - 0x278], 0x61e998
push 0x38
mov byte [ebp - 4], 0x14
mov dword [ebp - 0x274], 0
call fcn.00553f41
mov edi, eax
add esp, 4
mov dword [ebp - 0x274], edi
mov eax, dword [ebp - 0x254]
lea ecx, [edi + 0x10]
push eax
mov byte [ebp - 4], 0x15
call fcn.00428970
mov eax, dword [ebp - 0x258]
mov ecx, 0x61e998
push edi
push dword [ebp - 0x238]
mov byte [ebp - 4], 0x13
movups xmm0, xmmword [eax]
mov eax, dword [ebp - 0x268]
push dword [ebp - 0x23c]
movups xmmword [edi + 0x28], xmm0
mov dword [edi], eax
mov dword [edi + 4], eax
mov dword [edi + 8], eax
mov word [edi + 0xc], 0
mov dword [ebp - 0x274], 0
call fcn.0042f770
mov esi, dword [ebp - 0x258]
jmp 0x510f2e
mov eax, dword [ebp - 0x254]
lea ecx, [ebp - 0x10]
add eax, 0x28
add esi, 0x28
mov dword [ebp - 0x254], eax
mov dword [ebp - 0x258], esi
cmp eax, ecx
je 0x510f5d
mov ecx, dword [ebp - 0x26c]
jmp 0x510e58
call fcn.0042ffb0
mov edi, dword [ebp - 0x270]
mov esi, dword [ebp - 0x260]
push fcn.00424580
push 0xc
push 0x28
lea eax, [ebp - 0x1f0]
mov byte [ebp - 4], 6
push eax
call fcn.0055449c
push 0x59faa0
call fcn.005541ad
push 0x61e9a0
mov dword [ebp - 4], 0xffffffff
call fcn.00553e21
add esp, 8
jmp 0x510afa