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

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x59a76d
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 0x510607
mov eax, dword [esi]
cmp ecx, 0x16
jne 0x510844
push ecx
push str.CSIDL_PROGRAM_FILESX64
push eax
call fcn.0042f9f0
add esp, 0xc
test eax, eax
jne 0x51083e
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 0x510690
push dword [0x60c620]
lea ecx, [ebp - 0x248]
call fcn.00424740
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.005018a0
mov byte [ebp - 0x24d], 0
test al, al
jne 0x510697
mov byte [ebp - 0x24d], 1
test byte [ebp - 0x25c], 1
mov dword [ebp - 4], 0
je 0x5106b2
lea ecx, [ebp - 0x248]
call fcn.00424600
cmp byte [ebp - 0x24d], 0
je 0x5106f3
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.00500ef0
add esp, 0x14
push dword [0x60c61c]
mov ecx, edi
call fcn.00424740
lea ecx, [ebp - 0x230]
call fcn.00424600
jmp 0x510c1b
push 0x208
lea eax, [ebp - 0x218]
push 0
push eax
call fcn.00556260
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 0x510774
movzx ecx, word [ecx]
mov esi, 0x36
mov edx, 2
mov eax, 0x5a3e44
cmp ecx, esi
jb 0x51076e
sub dword [ebp - 0x254], eax
cmp cx, si
ja 0x51076e
cmp edx, 1
je 0x510810
mov ecx, dword [ebp - 0x254]
add eax, 2
dec edx
movzx ecx, word [ecx + eax]
movzx esi, word [eax]
cmp cx, si
jae 0x51074d
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 0x5107cf
movzx ecx, word [ecx]
mov esi, 0x41
mov edx, 5
mov eax, str.ARM64
cmp ecx, esi
jb 0x5107cf
sub dword [ebp - 0x254], eax
cmp cx, si
ja 0x5107cf
cmp edx, 1
je 0x510810
mov ecx, dword [ebp - 0x254]
add eax, 2
dec edx
movzx ecx, word [ecx + eax]
movzx esi, word [eax]
cmp cx, si
jae 0x5107b2
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 0x510817
cmp eax, 0x104
ja 0x510817
lea eax, [ebp - 0x218]
mov ecx, edi
push eax
call fcn.00424740
lea ecx, [ebp - 0x230]
call fcn.00424600
jmp 0x510c1b
mov eax, str.ProgramW6432
jmp 0x5107d4
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.00500ef0
add esp, 0x18
jmp 0x5106d6
mov ecx, dword [esi + 0x10]
mov edx, dword [esi + 0x14]
mov eax, esi
cmp edx, 8
jb 0x51084d
mov eax, dword [esi]
cmp ecx, 0x1d
jne 0x510a5c
push ecx
push str.CSIDL_PROGRAM_FILES_COMMONX64
push eax
call fcn.0042f9f0
add esp, 0xc
test eax, eax
jne 0x510a5c
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 0x5108da
push dword [0x60c620]
lea ecx, [ebp - 0x248]
call fcn.00424740
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.005018a0
mov byte [ebp - 0x24d], 0
test al, al
jne 0x5108e1
mov byte [ebp - 0x24d], 1
test byte [ebp - 0x25c], 4
mov dword [ebp - 4], 2
je 0x5108fc
lea ecx, [ebp - 0x248]
call fcn.00424600
cmp byte [ebp - 0x24d], 0
je 0x510911
push str.Unable_to_get_the_platform
push 0x4e
jmp 0x5106c2
push 0x208
lea eax, [ebp - 0x218]
push 0
push eax
call fcn.00556260
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 0x510992
movzx ecx, word [ecx]
mov esi, 0x36
mov edx, 2
mov eax, 0x5a3e44
cmp ecx, esi
jb 0x51098c
sub dword [ebp - 0x254], eax
cmp cx, si
ja 0x51098c
cmp edx, 1
je 0x510a2e
mov ecx, dword [ebp - 0x254]
add eax, 2
dec edx
movzx ecx, word [eax + ecx]
movzx esi, word [eax]
cmp cx, si
jae 0x51096b
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 0x5109ed
movzx ecx, word [ecx]
mov esi, 0x41
mov edx, 5
mov eax, str.ARM64
cmp ecx, esi
jb 0x5109ed
sub dword [ebp - 0x254], eax
cmp cx, si
ja 0x5109ed
cmp edx, 1
je 0x510a2e
mov ecx, dword [ebp - 0x254]
add eax, 2
dec edx
movzx ecx, word [eax + ecx]
movzx esi, word [eax]
cmp cx, si
jae 0x5109d0
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 0x510a35
cmp eax, 0x104
ja 0x510a35
lea eax, [ebp - 0x218]
mov ecx, edi
push eax
call fcn.00424740
lea ecx, [ebp - 0x230]
call fcn.00424600
jmp 0x510c1b
mov eax, str.CommonProgramW6432
jmp 0x5109f2
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.00500ef0
add esp, 0x18
jmp 0x5106d6
push dword [0x60c618]
push esi
call fcn.004379e0
add esp, 8
test al, al
je 0x510b5a
lea eax, [ebp - 0x264]
mov dword [ebp - 0x264], 0
push eax
lea eax, [ebp - 0x248]
mov dword [ebp - 0x260], 0x60c5e8
push eax
call fcn.00511030
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 0x510add
test edx, edx
jne 0x510add
lea eax, [ebp - 0x248]
mov ecx, edi
push eax
call fcn.004289f0
lea ecx, [ebp - 0x248]
call fcn.00424600
jmp 0x510c1b
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.00500ef0
add esp, 0x18
mov byte [ebp - 4], 4
lea ecx, [ebp - 0x230]
call fcn.004248c0
push dword [0x60c61c]
mov ecx, edi
call fcn.00424740
lea ecx, [ebp - 0x248]
call fcn.00424600
jmp 0x510c1b
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 0x510cc8
push esi
lea eax, [ebp - 0x23c]
mov ecx, 0x61e998
push eax
call fcn.0042fb70
mov ecx, dword [ebp - 0x234]
cmp byte [ecx + 0xd], 0
jne 0x510be8
mov eax, dword [ecx + 0x20]
add ecx, 0x10
mov dword [ebp - 0x258], eax
cmp dword [ecx + 0x14], 8
jb 0x510bac
mov ecx, dword [ecx]
cmp dword [esi + 0x14], 8
mov edx, dword [esi + 0x10]
mov dword [ebp - 0x254], esi
jb 0x510bc3
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.0042f9f0
add esp, 0xc
test eax, eax
je 0x510c3a
jns 0x510c45
mov eax, dword [esi + 0x14]
cmp eax, 8
jb 0x510bf2
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.00500ef0
add esp, 0x18
mov ecx, edi
push dword [0x60c61c]
call fcn.00424740
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.00553daa
mov esp, ebp
pop ebp
ret 0xc
mov eax, dword [ebp - 0x258]
cmp dword [esi + 0x10], eax
jb 0x510be8
mov eax, dword [ebp - 0x234]
cmp eax, dword [0x61e998]
je 0x510be8
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 0x510c8d
cmp dword [esi + 0x14], 8
jb 0x510c7d
mov esi, dword [esi]
push esi
push str.Error_retrieving_directory__s
push 0x81
jmp 0x510bfa
push dword [ebp - 0x24c]
lea ecx, [ebp - 0x230]
call fcn.00424740
push dword [ebp - 0x24c]
call dword [sym.imp.ole32.dll_CoTaskMemFree]
lea eax, [ebp - 0x230]
mov ecx, edi
push eax
call fcn.0042d840
lea ecx, [ebp - 0x230]
call fcn.00424600
jmp 0x510c1b
push 0x61e9a0
call fcn.00553eeb
add esp, 4
cmp dword [0x61e9a0], 0xffffffff
jne 0x510b7a
push str.CSIDL_COMMON_APPDATA
lea ecx, [ebp - 0x1f0]
mov dword [ebp - 4], 6
call fcn.00424740
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.00424740
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.00424740
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.00424740
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.00424740
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.00424740
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.00424740
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.00424740
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.00424740
movups xmm0, xmmword [0x5c3008]
movups xmmword [ebp - 0x98], xmm0
push str.CSIDL_SYSTEM
lea ecx, [ebp - 0x88]
mov byte [ebp - 4], 0xf
call fcn.00424740
movups xmm0, xmmword [0x5c2b88]
movups xmmword [ebp - 0x70], xmm0
push str.CSIDL_SYSTEMX86
lea ecx, [ebp - 0x60]
mov byte [ebp - 4], 0x10
call fcn.00424740
movups xmm0, xmmword [0x5c2b78]
movups xmmword [ebp - 0x48], xmm0
mov byte [ebp - 4], 0x11
lea ecx, [ebp - 0x38]
push str.CSIDL_WINDOWS
call fcn.00424740
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.00553fc1
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 0x510fe9
lea esi, [eax + 0x18]
mov dword [ebp - 0x258], esi
jmp 0x510ed8
push eax
push ecx
lea eax, [ebp - 0x224]
mov ecx, 0x61e998
push eax
call fcn.00434b90
movq xmm0, qword [eax]
mov eax, dword [eax + 8]
movq qword [ebp - 0x23c], xmm0
mov dword [ebp - 0x234], eax
test al, al
jne 0x510fae
cmp dword [0x61e99c], 0x4924924
je 0x510fd8
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.00553fc1
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.004289f0
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.0042f7e0
mov esi, dword [ebp - 0x258]
jmp 0x510fae
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 0x510fdd
mov ecx, dword [ebp - 0x26c]
jmp 0x510ed8
call fcn.00430020
mov edi, dword [ebp - 0x270]
mov esi, dword [ebp - 0x260]
push fcn.00424600
push 0xc
push 0x28
lea eax, [ebp - 0x1f0]
mov byte [ebp - 4], 6
push eax
call fcn.0055451c
push 0x59fb50
call fcn.0055422d
push 0x61e9a0
mov dword [ebp - 4], 0xffffffff
call fcn.00553ea1
add esp, 8
jmp 0x510b7a