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

Disassembly:
push ebp
lea ebp, [esp - 0x61c]
sub esp, 0x61c
push 0xffffffffffffffff
push 0x10082549
mov eax, dword fs:[0]
push eax
sub esp, 0x18
mov eax, dword [0x100c6034]
xor eax, ebp
mov dword [ebp + 0x618], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov byte [ebp - 0x15], dl
mov ebx, ecx
mov eax, dword [ebx]
mov ecx, str.ProgramFiles64Folder
mov dx, word [eax]
cmp dx, word [ecx]
jne 0x1002f34b
test dx, dx
je 0x1002f347
mov dx, word [eax + 2]
cmp dx, word [ecx + 2]
jne 0x1002f34b
add eax, 4
add ecx, 4
test dx, dx
jne 0x1002f325
xor eax, eax
jmp 0x1002f350
sbb eax, eax
or eax, 1
or edi, 0xffffffff
test eax, eax
jne 0x1002f453
push ebx
lea ecx, [ebp - 0x14]
call fcn.1002c320
mov dword [ebp - 4], 0
lea ecx, [ebp - 0x14]
push str.ProgramW6432
call fcn.1002e6b0
test eax, eax
je 0x1002f432
lea eax, [ebp - 0x14]
mov ecx, ebx
push eax
call fcn.1002bf90
mov edx, dword [ebx]
mov esi, dword [edx - 0xc]
test esi, esi
jle 0x1002f3eb
lea eax, [esi - 1]
test eax, eax
js 0x1002fda0
cmp eax, esi
jg 0x1002fda0
cmp word [edx + eax*2], 0x5c
je 0x1002f3eb
mov eax, dword [edx - 8]
lea edi, [esi + 1]
mov ecx, 1
sub eax, edi
sub ecx, dword [edx - 4]
or eax, ecx
jge 0x1002f3cc
push edi
mov ecx, ebx
call fcn.1002b370
mov edx, dword [ebx]
mov eax, 0x5c
mov word [edx + esi*2], ax
mov eax, dword [ebx]
cmp edi, dword [eax - 8]
jg 0x1002fda0
mov dword [eax - 0xc], edi
xor ecx, ecx
mov eax, dword [ebx]
mov word [eax + edi*2], cx
mov dword [ebp - 4], 0xffffffff
or eax, 0xffffffff
mov edx, dword [ebp - 0x14]
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x1002f40d
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov al, 1
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp + 0x618]
xor ecx, ebp
call fcn.1005c4e7
lea esp, [ebp + 0x61c]
pop ebp
ret
mov dword [ebp - 4], 0xffffffff
mov eax, edi
mov edx, dword [ebp - 0x14]
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x1002f453
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov byte [ebp - 0xd], 1
call fcn.10029330
mov ecx, eax
test ecx, ecx
je 0x1002fd96
mov eax, dword [ecx]
call dword [eax + 0xc]
add eax, 0x10
mov dword [ebp - 0x14], eax
mov dword [ebp - 4], 3
lea ecx, [ebp - 0x14]
push str.SystemFolder
call fcn.1002b120
test al, al
jne 0x1002f498
push 0xc
push str.SystemFolder
lea ecx, [ebp - 0x14]
call fcn.1002b490
mov dword [ebp - 4], 4
mov eax, dword [ebp - 0x14]
test eax, eax
je 0x1002fd96
mov ecx, dword [ebx]
mov edx, eax
nop
mov si, word [ecx]
cmp si, word [edx]
jne 0x1002f4d6
test si, si
je 0x1002f4d2
mov si, word [ecx + 2]
cmp si, word [edx + 2]
jne 0x1002f4d6
add ecx, 4
add edx, 4
test si, si
jne 0x1002f4b0
xor esi, esi
jmp 0x1002f4db
sbb esi, esi
or esi, 1
mov dword [ebp - 4], 0xffffffff
lea edx, [eax - 0x10]
mov eax, edi
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x1002f4f9
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
test esi, esi
jne 0x1002f53b
lea eax, [ebp + 0x410]
push eax
movzx eax, byte [ebp - 0x15]
xor eax, 1
push esi
push esi
lea eax, [eax*4 + 0x25]
push eax
push esi
call dword [sym.imp.SHELL32.dll_SHGetFolderPathW]
lea ecx, [ebp + 0x410]
lea edx, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x1002f525
lea eax, [ebp + 0x410]
jmp 0x1002fb6e
call fcn.10029330
mov ecx, eax
test ecx, ecx
je 0x1002fd96
mov eax, dword [ecx]
call dword [eax + 0xc]
add eax, 0x10
mov dword [ebp - 0x14], eax
mov dword [ebp - 4], 6
lea ecx, [ebp - 0x14]
push str.System32Folder
call fcn.1002b120
test al, al
jne 0x1002f57c
push 0xe
push str.System32Folder
lea ecx, [ebp - 0x14]
call fcn.1002b490
mov dword [ebp - 4], 7
mov eax, dword [ebp - 0x14]
test eax, eax
je 0x1002fd96
mov ecx, dword [ebx]
mov edx, eax
mov si, word [ecx]
cmp si, word [edx]
jne 0x1002f5b8
test si, si
je 0x1002f5b4
mov si, word [ecx + 2]
cmp si, word [edx + 2]
jne 0x1002f5b8
add ecx, 4
add edx, 4
test si, si
jne 0x1002f592
xor esi, esi
jmp 0x1002f5bd
sbb esi, esi
or esi, 1
mov dword [ebp - 4], 0xffffffff
lea edx, [eax - 0x10]
mov eax, edi
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x1002f5db
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
test esi, esi
jne 0x1002f649
push 0x104
lea eax, [ebp + 0x410]
push eax
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryW]
mov ecx, 0x5c
mov word [ebp + eax*2 + 0x410], cx
lea eax, [eax*2 + 2]
cmp eax, 0x208
jae 0x1002fdaa
xor ecx, ecx
lea edx, [ebp + 0x410]
mov word [ebp + eax + 0x410], cx
lea ecx, [edx + 2]
mov ax, word [edx]
add edx, 2
test ax, ax
jne 0x1002f623
sub edx, ecx
lea eax, [ebp + 0x410]
sar edx, 1
mov ecx, ebx
push edx
push eax
call fcn.1002b490
mov al, byte [ebp - 0xd]
jmp 0x1002f40f
call fcn.10029330
mov ecx, eax
test ecx, ecx
je 0x1002fd96
mov eax, dword [ecx]
call dword [eax + 0xc]
add eax, 0x10
mov dword [ebp - 0x14], eax
mov dword [ebp - 4], 9
lea ecx, [ebp - 0x14]
push str.WindowsFolder
call fcn.1002b120
test al, al
jne 0x1002f68a
push 0xd
push str.WindowsFolder
lea ecx, [ebp - 0x14]
call fcn.1002b490
mov dword [ebp - 4], 0xa
mov eax, dword [ebp - 0x14]
test eax, eax
je 0x1002fd96
mov ecx, dword [ebx]
mov edx, eax
mov si, word [ecx]
cmp si, word [edx]
jne 0x1002f6c6
test si, si
je 0x1002f6c2
mov si, word [ecx + 2]
cmp si, word [edx + 2]
jne 0x1002f6c6
add ecx, 4
add edx, 4
test si, si
jne 0x1002f6a0
xor esi, esi
jmp 0x1002f6cb
sbb esi, esi
or esi, 1
mov dword [ebp - 4], 0xffffffff
lea edx, [eax - 0x10]
mov eax, edi
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x1002f6e9
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
test esi, esi
jne 0x1002f757
push 0x104
lea eax, [ebp + 0x410]
push eax
call dword [sym.imp.KERNEL32.dll_GetWindowsDirectoryW]
mov ecx, 0x5c
mov word [ebp + eax*2 + 0x410], cx
lea eax, [eax*2 + 2]
cmp eax, 0x208
jae 0x1002fdaa
xor ecx, ecx
mov word [ebp + eax + 0x410], cx
lea ecx, [ebp + 0x410]
lea edx, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x1002f731
sub ecx, edx
lea eax, [ebp + 0x410]
sar ecx, 1
push ecx
push eax
mov ecx, ebx
call fcn.1002b490
mov al, byte [ebp - 0xd]
jmp 0x1002f40f
call fcn.10029330
mov ecx, eax
test ecx, ecx
je 0x1002fd96
mov eax, dword [ecx]
call dword [eax + 0xc]
add eax, 0x10
mov dword [ebp - 0x14], eax
mov dword [ebp - 4], 0xc
lea ecx, [ebp - 0x14]
push str.WindowsVolume
call fcn.1002b120
test al, al
jne 0x1002f798
push 0xd
push str.WindowsVolume
lea ecx, [ebp - 0x14]
call fcn.1002b490
mov dword [ebp - 4], 0xd
mov eax, dword [ebp - 0x14]
test eax, eax
je 0x1002fd96
mov ecx, dword [ebx]
mov edx, eax
nop
mov si, word [ecx]
cmp si, word [edx]
jne 0x1002f7d6
test si, si
je 0x1002f7d2
mov si, word [ecx + 2]
cmp si, word [edx + 2]
jne 0x1002f7d6
add ecx, 4
add edx, 4
test si, si
jne 0x1002f7b0
xor esi, esi
jmp 0x1002f7db
sbb esi, esi
or esi, 1
mov dword [ebp - 4], 0xffffffff
lea edx, [eax - 0x10]
lock xadd dword [edx + 0xc], edi
dec edi
test edi, edi
jg 0x1002f7f7
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
test esi, esi
jne 0x1002f830
push 0x104
lea eax, [ebp + 0x410]
push eax
call dword [sym.imp.KERNEL32.dll_GetWindowsDirectoryW]
xor eax, eax
lea ecx, [ebp + 0x410]
mov word [ebp + 0x416], ax
lea edx, [ecx + 2]
nop
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x1002f820
jmp 0x1002f73c
mov edi, dword [ebx]
mov ecx, str.TempFolder
mov eax, edi
nop dword [eax]
mov dx, word [eax]
cmp dx, word [ecx]
jne 0x1002f866
test dx, dx
je 0x1002f862
mov dx, word [eax + 2]
cmp dx, word [ecx + 2]
jne 0x1002f866
add eax, 4
add ecx, 4
test dx, dx
jne 0x1002f840
xor eax, eax
jmp 0x1002f86b
sbb eax, eax
or eax, 1
test eax, eax
jne 0x1002f8b1
lea eax, [ebp + 0x410]
push eax
push 0x104
call dword [sym.imp.KERNEL32.dll_GetTempPathW]
add eax, eax
cmp eax, 0x208
jae 0x1002fdaa
xor ecx, ecx
mov word [ebp + eax + 0x410], cx
lea ecx, [ebp + 0x410]
lea edx, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x1002f8a1
jmp 0x1002f73c
mov ecx, str.SETUPEXEDIR
mov eax, edi
mov dx, word [eax]
cmp dx, word [ecx]
jne 0x1002f8de
test dx, dx
je 0x1002f8da
mov dx, word [eax + 2]
cmp dx, word [ecx + 2]
jne 0x1002f8de
add eax, 4
add ecx, 4
test dx, dx
jne 0x1002f8b8
xor eax, eax
jmp 0x1002f8e3
sbb eax, eax
or eax, 1
test eax, eax
jne 0x1002f97a
mov eax, dword [0x100d1f5c]
cmp dword [eax - 0xc], 0
jne 0x1002f966
push 0x104
lea eax, [ebp + 0x410]
push eax
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
sub eax, 1
je 0x1002f920
nop
cmp word [ebp + eax*2 + 0x410], 0x5c
je 0x1002f920
sub eax, 1
jne 0x1002f910
lea eax, [eax*2 + 2]
cmp eax, 0x208
jae 0x1002fdaa
xor ecx, ecx
mov word [ebp + eax + 0x410], cx
lea ecx, [ebp + 0x410]
lea edx, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x1002f945
sub ecx, edx
lea eax, [ebp + 0x410]
sar ecx, 1
push ecx
push eax
mov ecx, 0x100d1f5c
call fcn.1002b490
push 0x100d1f5c
mov ecx, ebx
call fcn.1002bf90
mov al, byte [ebp - 0xd]
jmp 0x1002f40f
xor esi, esi
nop dword [eax]
mov eax, dword [esi*4 + 0x100a6568]
test eax, eax
je 0x1002fd96
mov ecx, edi
mov dx, word [ecx]
cmp dx, word [eax]
jne 0x1002f9b7
test dx, dx
je 0x1002f9b3
mov dx, word [ecx + 2]
cmp dx, word [eax + 2]
jne 0x1002f9b7
add ecx, 4
add eax, 4
test dx, dx
jne 0x1002f991
xor eax, eax
jmp 0x1002f9bc
sbb eax, eax
or eax, 1
test eax, eax
je 0x1002f9cd
inc esi
cmp esi, 0xe
jb 0x1002f980
xor al, al
jmp 0x1002f40f
cmp esi, 0xe
jae 0x1002f9c6
lea eax, [ebp - 0x20]
push eax
push dword [esi*4 + 0x100a6530]
push 0
call dword [sym.imp.SHELL32.dll_SHGetSpecialFolderLocation]
test eax, eax
je 0x1002fd3c
mov eax, dword fs:[0x2c]
mov ecx, dword [0x100d1704]
mov edi, dword [esi*4 + 0x100a6530]
mov ecx, dword [eax + ecx*4]
mov eax, dword [0x100d1f68]
cmp eax, dword [ecx + 4]
jle 0x1002fa5f
push 0x100d1f68
call fcn.1005c89d
add esp, 4
cmp dword [0x100d1f68], 0xffffffff
jne 0x1002fa5f
mov dword [ebp - 4], 0xf
push 0x10095ec0
mov dword [0x100d1f6c], 0x100a32fc
mov dword [0x100d1f70], 0
call fcn.1005cc78
mov dword [ebp - 4], 0xffffffff
push 0x100d1f68
call fcn.1005c853
add esp, 8
cmp dword [0x100d1f70], 0
jne 0x1002fb30
push str.shfolder.dll
call dword [sym.imp.KERNEL32.dll_LoadLibraryW]
mov esi, eax
mov eax, dword [0x100d1f70]
cmp esi, eax
je 0x1002fa96
mov eax, dword [0x100d1f6c]
mov ecx, 0x100d1f6c
call dword [eax + 4]
mov eax, esi
mov dword [0x100d1f70], eax
test eax, eax
je 0x1002fab3
push 0x100a64e0
push eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov dword [0x100d1ef0], eax
test eax, eax
jne 0x1002fb3d
mov eax, dword [0x100c6a80]
cmp eax, 0xffffffff
jne 0x1002fbf0
lea eax, [ebp - 0x24]
mov dword [0x100c6a80], 0
push eax
lea edx, [ebp - 0x14]
mov ecx, str.Shlwapi.dll
call fcn.1002ec20
add esp, 4
test al, al
je 0x1002faeb
cmp dword [ebp - 0x14], 5
ja 0x1002fb21
je 0x1002fb21
mov eax, dword [0x100c6a80]
cmp eax, 1
je 0x1002fbf3
lea eax, [ebp - 0x24]
mov ecx, str.Shell32.dll
push eax
lea edx, [ebp - 0x14]
call fcn.1002ec20
add esp, 4
test al, al
je 0x1002fbeb
cmp dword [ebp - 0x14], 5
ja 0x1002fb21
jne 0x1002fbeb
mov eax, 1
mov dword [0x100c6a80], eax
jmp 0x1002fbf0
mov eax, dword [0x100d1ef0]
test eax, eax
je 0x1002fab3
lea ecx, [ebp]
push ecx
push 0
push 0
push edi
push 0
call eax
test eax, eax
jne 0x1002fab3
lea ecx, [ebp]
lea edx, [ecx + 2]
nop dword [eax + eax]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x1002fb60
lea eax, [ebp]
sub ecx, edx
sar ecx, 1
push ecx
push eax
mov ecx, ebx
call fcn.1002b490
mov edx, dword [ebx]
mov edi, dword [edx - 0xc]
test edi, edi
jle 0x1002f641
lea eax, [edi - 1]
test eax, eax
js 0x1002fda0
cmp eax, edi
jg 0x1002fda0
cmp word [edx + eax*2], 0x5c
je 0x1002f641
mov eax, dword [edx - 8]
lea esi, [edi + 1]
mov ecx, 1
sub eax, esi
sub ecx, dword [edx - 4]
or ecx, eax
jge 0x1002fbc4
push esi
mov ecx, ebx
call fcn.1002b370
mov edx, dword [ebx]
mov eax, 0x5c
mov word [edx + edi*2], ax
mov eax, dword [ebx]
cmp esi, dword [eax - 8]
jg 0x1002fda0
mov dword [eax - 0xc], esi
xor ecx, ecx
mov eax, dword [ebx]
mov word [eax + esi*2], cx
mov al, byte [ebp - 0xd]
jmp 0x1002f40f
mov eax, dword [0x100c6a80]
cmp eax, 1
sete al
test al, al
jne 0x1002f9c6
mov eax, dword [ebx]
mov ecx, str.ProgramFilesFolder
mov dx, word [eax]
cmp dx, word [ecx]
jne 0x1002fc2b
test dx, dx
je 0x1002fc27
mov dx, word [eax + 2]
cmp dx, word [ecx + 2]
jne 0x1002fc2b
add eax, 4
add ecx, 4
test dx, dx
jne 0x1002fc05
xor eax, eax
jmp 0x1002fc30
sbb eax, eax
or eax, 1
test eax, eax
je 0x1002fc79
mov ecx, ebx
call fcn.1002fdb0
test al, al
jne 0x1002fc79
mov eax, dword [ebx]
mov ecx, str.AppDataFolder
mov dx, word [eax]
cmp dx, word [ecx]
jne 0x1002fc6c
test dx, dx
je 0x1002fc68
mov dx, word [eax + 2]
cmp dx, word [ecx + 2]
jne 0x1002fc6c
add eax, 4
add ecx, 4
test dx, dx
jne 0x1002fc46
xor eax, eax
jmp 0x1002fc71
sbb eax, eax
or eax, 1
test eax, eax
jne 0x1002f9c6
mov eax, dword [ebx]
mov ecx, str.AppDataFolder
mov dx, word [eax]
cmp dx, word [ecx]
jne 0x1002fca6
test dx, dx
je 0x1002fca2
mov dx, word [eax + 2]
cmp dx, word [ecx + 2]
jne 0x1002fca6
add eax, 4
add ecx, 4
test dx, dx
jne 0x1002fc80
xor ecx, ecx
jmp 0x1002fcab
sbb ecx, ecx
or ecx, 1
xor eax, eax
mov edx, str.PROGRAMFILES
mov word [ebp + 0x208], ax
test ecx, ecx
push 0x104
lea eax, [ebp + 0x208]
push eax
mov eax, str.APPDATA
cmovne eax, edx
push eax
call dword [sym.imp.KERNEL32.dll_GetEnvironmentVariableW]
mov esi, eax
test esi, esi
je 0x1002fcea
mov eax, 0x5c
mov word [ebp + esi*2 + 0x208], ax
inc esi
lea eax, [esi + esi]
cmp eax, 0x208
jae 0x1002fdaa
xor ecx, ecx
mov word [ebp + eax + 0x208], cx
cmp word [ebp + 0x208], cx
je 0x1002fd32
lea ecx, [ebp + 0x208]
lea edx, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x1002fd14
sub ecx, edx
lea eax, [ebp + 0x208]
sar ecx, 1
push ecx
push eax
mov ecx, ebx
call fcn.1002b490
test esi, esi
setne al
jmp 0x1002f40f
lea eax, [ebp + 0x410]
push eax
push dword [ebp - 0x20]
call dword [sym.imp.SHELL32.dll_SHGetPathFromIDListW]
mov esi, eax
mov dword [ebp - 0x1c], 0
lea eax, [ebp - 0x1c]
push eax
call dword [sym.imp.SHELL32.dll_SHGetMalloc]
mov ecx, dword [ebp - 0x1c]
push dword [ebp - 0x20]
push ecx
mov edx, dword [ecx]
call dword [edx + 0x14]
test esi, esi
je 0x1002f9c6
lea ecx, [ebp + 0x410]
lea edx, [ecx + 2]
nop dword [eax]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x1002fd80
lea eax, [ebp + 0x410]
jmp 0x1002fb6e
push 0x80004005
call fcn.100269b0
push 0x80070057
call fcn.100269b0
call fcn.1005c68f
int3