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

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x47a0b1
mov eax, dword fs:[0]
push eax
sub esp, 0x634
mov eax, dword [0x4a6024]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov byte [ebp - 0x631], dl
mov ebx, ecx
mov esi, dword [ebx]
mov ecx, str.ProgramFiles64Folder
mov eax, esi
nop
mov dx, word [eax]
cmp dx, word [ecx]
jne 0x42f176
test dx, dx
je 0x42f172
mov dx, word [eax + 2]
cmp dx, word [ecx + 2]
jne 0x42f176
add eax, 4
add ecx, 4
test dx, dx
jne 0x42f150
xor eax, eax
jmp 0x42f17b
sbb eax, eax
or eax, 1
or edi, 0xffffffff
test eax, eax
jne 0x42f274
lea ecx, [esi - 0x10]
call fcn.004058b0
add eax, 0x10
mov dword [ebp - 0x630], eax
mov dword [ebp - 4], 1
lea ecx, [ebp - 0x630]
push str.ProgramW6432
call fcn.00424860
test eax, eax
je 0x42f250
lea eax, [ebp - 0x630]
mov ecx, ebx
push eax
call fcn.00405ad0
mov edx, dword [ebx]
mov esi, dword [edx - 0xc]
test esi, esi
jle 0x42f224
lea eax, [esi - 1]
test eax, eax
js 0x42fc4a
cmp eax, esi
jg 0x42fc4a
cmp word [edx + eax*2], 0x5c
je 0x42f224
mov eax, dword [edx - 8]
lea edi, [esi + 1]
mov ecx, 1
sub eax, edi
sub ecx, dword [edx - 4]
or eax, ecx
jge 0x42f203
push edi
mov ecx, ebx
call fcn.00404db0
mov eax, dword [ebx]
mov ecx, 0x5c
mov word [eax + esi*2], cx
mov eax, dword [ebx]
cmp edi, dword [eax - 8]
jg 0x42fc4a
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 - 0x630]
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x42f249
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov al, 1
jmp 0x42f3e4
mov dword [ebp - 4], 0xffffffff
mov eax, edi
mov edx, dword [ebp - 0x630]
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x42f274
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov byte [ebp - 0x629], 1
call fcn.00403270
test eax, eax
je 0x42fc40
mov edx, dword [eax]
mov ecx, eax
call dword [edx + 0xc]
add eax, 0x10
mov dword [ebp - 0x630], eax
mov dword [ebp - 4], 4
mov eax, str.SystemFolder
lea ecx, [ebp - 0x630]
test eax, 0xffff0000
jne 0x42f2bc
movzx eax, ax
push eax
call fcn.00404b50
jmp 0x42f2c8
push 0xc
push str.SystemFolder
call fcn.00404e20
mov dword [ebp - 4], 5
mov eax, dword [ebp - 0x630]
test eax, eax
je 0x42fc40
mov ecx, dword [ebx]
mov edx, eax
mov si, word [ecx]
cmp si, word [edx]
jne 0x42f307
test si, si
je 0x42f303
mov si, word [ecx + 2]
cmp si, word [edx + 2]
jne 0x42f307
add ecx, 4
add edx, 4
test si, si
jne 0x42f2e1
xor esi, esi
jmp 0x42f30c
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 0x42f32a
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
test esi, esi
jne 0x42f400
lea eax, [ebp - 0x218]
push eax
movzx eax, byte [ebp - 0x631]
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 - 0x218]
lea edx, [ecx + 2]
nop dword [eax]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x42f360
sub ecx, edx
lea eax, [ebp - 0x218]
sar ecx, 1
push ecx
push eax
mov ecx, ebx
call fcn.00404e20
mov edx, dword [ebx]
mov edi, dword [edx - 0xc]
test edi, edi
jle 0x42f3de
lea eax, [edi - 1]
test eax, eax
js 0x42fc4a
cmp eax, edi
jg 0x42fc4a
cmp word [edx + eax*2], 0x5c
je 0x42f3de
mov eax, dword [edx - 8]
lea esi, [edi + 1]
mov ecx, 1
sub eax, esi
sub ecx, dword [edx - 4]
or ecx, eax
jge 0x42f3bd
push esi
mov ecx, ebx
call fcn.00404db0
mov eax, dword [ebx]
mov ecx, 0x5c
mov word [eax + edi*2], cx
mov eax, dword [ebx]
cmp esi, dword [eax - 8]
jg 0x42fc4a
mov dword [eax - 0xc], esi
xor ecx, ecx
mov eax, dword [ebx]
mov word [eax + esi*2], cx
mov al, byte [ebp - 0x629]
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.00452869
mov esp, ebp
pop ebp
ret
call fcn.00403270
test eax, eax
je 0x42fc40
mov edx, dword [eax]
mov ecx, eax
call dword [edx + 0xc]
add eax, 0x10
mov dword [ebp - 0x630], eax
mov dword [ebp - 4], 7
mov eax, str.System32Folder
lea ecx, [ebp - 0x630]
test eax, 0xffff0000
jne 0x42f441
movzx eax, ax
push eax
call fcn.00404b50
jmp 0x42f44d
push 0xe
push str.System32Folder
call fcn.00404e20
mov dword [ebp - 4], 8
mov eax, dword [ebp - 0x630]
test eax, eax
je 0x42fc40
mov ecx, dword [ebx]
mov edx, eax
mov si, word [ecx]
cmp si, word [edx]
jne 0x42f48c
test si, si
je 0x42f488
mov si, word [ecx + 2]
cmp si, word [edx + 2]
jne 0x42f48c
add ecx, 4
add edx, 4
test si, si
jne 0x42f466
xor esi, esi
jmp 0x42f491
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 0x42f4af
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
test esi, esi
jne 0x42f51a
push 0x104
lea eax, [ebp - 0x218]
push eax
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryW]
mov ecx, 0x5c
mov word [ebp + eax*2 - 0x218], cx
lea eax, [eax*2 + 2]
cmp eax, 0x208
jae 0x42fc54
xor ecx, ecx
lea edx, [ebp - 0x218]
mov word [ebp + eax - 0x218], cx
lea esi, [edx + 2]
mov ax, word [edx]
add edx, 2
test ax, ax
jne 0x42f4f7
sub edx, esi
lea eax, [ebp - 0x218]
sar edx, 1
mov ecx, ebx
push edx
push eax
call fcn.00404e20
jmp 0x42f3de
call fcn.00403270
test eax, eax
je 0x42fc40
mov edx, dword [eax]
mov ecx, eax
call dword [edx + 0xc]
add eax, 0x10
mov dword [ebp - 0x630], eax
mov dword [ebp - 4], 0xa
mov eax, str.WindowsFolder
lea ecx, [ebp - 0x630]
test eax, 0xffff0000
jne 0x42f55b
movzx eax, ax
push eax
call fcn.00404b50
jmp 0x42f567
push 0xd
push str.WindowsFolder
call fcn.00404e20
mov dword [ebp - 4], 0xb
mov eax, dword [ebp - 0x630]
test eax, eax
je 0x42fc40
mov ecx, dword [ebx]
mov edx, eax
mov si, word [ecx]
cmp si, word [edx]
jne 0x42f5a6
test si, si
je 0x42f5a2
mov si, word [ecx + 2]
cmp si, word [edx + 2]
jne 0x42f5a6
add ecx, 4
add edx, 4
test si, si
jne 0x42f580
xor esi, esi
jmp 0x42f5ab
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 0x42f5c9
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
test esi, esi
jne 0x42f634
push 0x104
lea eax, [ebp - 0x218]
push eax
call dword [sym.imp.KERNEL32.dll_GetWindowsDirectoryW]
mov ecx, 0x5c
mov word [ebp + eax*2 - 0x218], cx
lea eax, [eax*2 + 2]
cmp eax, 0x208
jae 0x42fc54
xor ecx, ecx
mov word [ebp + eax - 0x218], cx
lea ecx, [ebp - 0x218]
lea edx, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x42f611
sub ecx, edx
lea eax, [ebp - 0x218]
sar ecx, 1
push ecx
push eax
mov ecx, ebx
call fcn.00404e20
jmp 0x42f3de
call fcn.00403270
test eax, eax
je 0x42fc40
mov edx, dword [eax]
mov ecx, eax
call dword [edx + 0xc]
add eax, 0x10
mov dword [ebp - 0x630], eax
mov dword [ebp - 4], 0xd
mov eax, str.WindowsVolume
lea ecx, [ebp - 0x630]
test eax, 0xffff0000
jne 0x42f675
movzx eax, ax
push eax
call fcn.00404b50
jmp 0x42f681
push 0xd
push str.WindowsVolume
call fcn.00404e20
mov dword [ebp - 4], 0xe
mov eax, dword [ebp - 0x630]
test eax, eax
je 0x42fc40
mov ecx, dword [ebx]
mov edx, eax
nop word [eax + eax]
mov si, word [ecx]
cmp si, word [edx]
jne 0x42f6c6
test si, si
je 0x42f6c2
mov si, word [ecx + 2]
cmp si, word [edx + 2]
jne 0x42f6c6
add ecx, 4
add edx, 4
test si, si
jne 0x42f6a0
xor esi, esi
jmp 0x42f6cb
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 0x42f6e7
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
test esi, esi
jne 0x42f720
push 0x104
lea eax, [ebp - 0x218]
push eax
call dword [sym.imp.KERNEL32.dll_GetWindowsDirectoryW]
xor eax, eax
lea ecx, [ebp - 0x218]
mov word [ebp - 0x212], ax
lea edx, [ecx + 2]
nop
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x42f710
jmp 0x42f61c
mov edi, dword [ebx]
mov ecx, str.TempFolder
mov eax, edi
nop dword [eax]
mov dx, word [eax]
cmp dx, word [ecx]
jne 0x42f756
test dx, dx
je 0x42f752
mov dx, word [eax + 2]
cmp dx, word [ecx + 2]
jne 0x42f756
add eax, 4
add ecx, 4
test dx, dx
jne 0x42f730
xor eax, eax
jmp 0x42f75b
sbb eax, eax
or eax, 1
test eax, eax
jne 0x42f7a1
lea eax, [ebp - 0x218]
push eax
push 0x104
call dword [sym.imp.KERNEL32.dll_GetTempPathW]
add eax, eax
cmp eax, 0x208
jae 0x42fc54
xor ecx, ecx
mov word [ebp + eax - 0x218], cx
lea ecx, [ebp - 0x218]
lea edx, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x42f791
jmp 0x42f61c
mov ecx, str.SETUPEXEDIR
mov eax, edi
mov dx, word [eax]
cmp dx, word [ecx]
jne 0x42f7ce
test dx, dx
je 0x42f7ca
mov dx, word [eax + 2]
cmp dx, word [ecx + 2]
jne 0x42f7ce
add eax, 4
add ecx, 4
test dx, dx
jne 0x42f7a8
xor eax, eax
jmp 0x42f7d3
sbb eax, eax
or eax, 1
test eax, eax
jne 0x42f867
mov eax, dword [0x4a89e0]
cmp dword [eax - 0xc], 0
jne 0x42f856
push 0x104
lea eax, [ebp - 0x218]
push eax
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
sub eax, 1
je 0x42f810
nop
cmp word [ebp + eax*2 - 0x218], 0x5c
je 0x42f810
sub eax, 1
jne 0x42f800
lea eax, [eax*2 + 2]
cmp eax, 0x208
jae 0x42fc54
xor ecx, ecx
mov word [ebp + eax - 0x218], cx
lea ecx, [ebp - 0x218]
lea edx, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x42f835
sub ecx, edx
lea eax, [ebp - 0x218]
sar ecx, 1
push ecx
push eax
mov ecx, 0x4a89e0
call fcn.00404e20
push 0x4a89e0
mov ecx, ebx
call fcn.00405ad0
jmp 0x42f3de
xor esi, esi
nop dword [eax]
mov eax, dword [esi*4 + 0x4919ec]
test eax, eax
je 0x42fc40
mov ecx, edi
mov dx, word [ecx]
cmp dx, word [eax]
jne 0x42f8a7
test dx, dx
je 0x42f8a3
mov dx, word [ecx + 2]
cmp dx, word [eax + 2]
jne 0x42f8a7
add ecx, 4
add eax, 4
test dx, dx
jne 0x42f881
xor eax, eax
jmp 0x42f8ac
sbb eax, eax
or eax, 1
test eax, eax
je 0x42f8bd
inc esi
cmp esi, 0xe
jb 0x42f870
xor al, al
jmp 0x42f3e4
cmp esi, 0xe
jae 0x42f8b6
lea eax, [ebp - 0x63c]
push eax
push dword [esi*4 + 0x4919b4]
push 0
call dword [sym.imp.SHELL32.dll_SHGetSpecialFolderLocation]
test eax, eax
je 0x42fbdc
mov eax, dword fs:[0x2c]
mov edi, dword [esi*4 + 0x4919b4]
mov ecx, dword [eax]
mov eax, dword [0x4a8e34]
cmp eax, dword [ecx + 4]
jle 0x42f94e
push 0x4a8e34
call fcn.00452c11
add esp, 4
cmp dword [0x4a8e34], 0xffffffff
jne 0x42f94e
mov dword [ebp - 4], 0x10
push 0x4808c0
mov dword [0x4a8e38], 0x48f24c
mov dword [0x4a8e3c], 0
call fcn.00452f23
add esp, 4
mov dword [ebp - 4], 0xffffffff
push 0x4a8e34
call fcn.00452bc7
add esp, 4
cmp dword [0x4a8e3c], 0
jne 0x42fa29
push str.shfolder.dll
call dword [sym.imp.KERNEL32.dll_LoadLibraryW]
mov ecx, dword [0x4a8e3c]
mov esi, eax
cmp esi, ecx
je 0x42f988
mov edx, dword [0x4a8e38]
mov ecx, 0x4a8e38
call dword [edx + 4]
mov ecx, esi
mov dword [0x4a8e3c], ecx
test ecx, ecx
je 0x42f9a5
push 0x491964
push ecx
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov dword [0x4a8a24], eax
test eax, eax
jne 0x42fa36
mov eax, dword [0x4a6ab8]
cmp eax, 0xffffffff
jne 0x42fa86
lea eax, [ebp - 0x640]
mov dword [0x4a6ab8], 0
push eax
lea edx, [ebp - 0x630]
mov ecx, str.Shlwapi.dll
call fcn.0042bc70
add esp, 4
test al, al
je 0x42f9e6
cmp dword [ebp - 0x630], 5
ja 0x42fa1d
je 0x42fa1d
mov eax, dword [0x4a6ab8]
cmp eax, 1
je 0x42fa89
lea eax, [ebp - 0x640]
mov ecx, str.Shell32.dll
push eax
lea edx, [ebp - 0x630]
call fcn.0042bc70
add esp, 4
test al, al
je 0x42fa81
cmp dword [ebp - 0x630], 5
ja 0x42fa1d
jne 0x42fa81
mov eax, 1
mov dword [0x4a6ab8], eax
jmp 0x42fa86
mov eax, dword [0x4a8a24]
test eax, eax
je 0x42f9a5
lea ecx, [ebp - 0x628]
push ecx
push 0
push 0
push edi
push 0
call eax
test eax, eax
jne 0x42f9a5
lea ecx, [ebp - 0x628]
lea edx, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x42fa57
sub ecx, edx
lea eax, [ebp - 0x628]
sar ecx, 1
push ecx
push eax
mov ecx, ebx
call fcn.00404e20
mov ecx, ebx
call fcn.00422fd0
jmp 0x42f3de
mov eax, dword [0x4a6ab8]
cmp eax, 1
sete al
test al, al
jne 0x42f8b6
mov eax, dword [ebx]
mov ecx, str.ProgramFilesFolder
nop dword [eax + eax]
mov dx, word [eax]
cmp dx, word [ecx]
jne 0x42fac6
test dx, dx
je 0x42fac2
mov dx, word [eax + 2]
cmp dx, word [ecx + 2]
jne 0x42fac6
add eax, 4
add ecx, 4
test dx, dx
jne 0x42faa0
xor eax, eax
jmp 0x42facb
sbb eax, eax
or eax, 1
test eax, eax
je 0x42fb19
mov edx, str.ProgramFiles
mov ecx, ebx
call fcn.0042fc60
test al, al
jne 0x42fb19
mov eax, dword [ebx]
mov ecx, str.AppDataFolder
mov dx, word [eax]
cmp dx, word [ecx]
jne 0x42fb0c
test dx, dx
je 0x42fb08
mov dx, word [eax + 2]
cmp dx, word [ecx + 2]
jne 0x42fb0c
add eax, 4
add ecx, 4
test dx, dx
jne 0x42fae6
xor eax, eax
jmp 0x42fb11
sbb eax, eax
or eax, 1
test eax, eax
jne 0x42f8b6
mov eax, dword [ebx]
mov ecx, str.AppDataFolder
mov dx, word [eax]
cmp dx, word [ecx]
jne 0x42fb46
test dx, dx
je 0x42fb42
mov dx, word [eax + 2]
cmp dx, word [ecx + 2]
jne 0x42fb46
add eax, 4
add ecx, 4
test dx, dx
jne 0x42fb20
xor ecx, ecx
jmp 0x42fb4b
sbb ecx, ecx
or ecx, 1
xor eax, eax
mov edx, str.PROGRAMFILES
mov word [ebp - 0x420], ax
test ecx, ecx
push 0x104
lea eax, [ebp - 0x420]
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 0x42fb8a
mov eax, 0x5c
mov word [ebp + esi*2 - 0x420], ax
inc esi
lea eax, [esi + esi]
cmp eax, 0x208
jae 0x42fc54
xor ecx, ecx
mov word [ebp + eax - 0x420], cx
cmp word [ebp - 0x420], cx
je 0x42fbd2
lea ecx, [ebp - 0x420]
lea edx, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x42fbb4
sub ecx, edx
lea eax, [ebp - 0x420]
sar ecx, 1
push ecx
push eax
mov ecx, ebx
call fcn.00404e20
test esi, esi
setne al
jmp 0x42f3e4
lea eax, [ebp - 0x218]
push eax
push dword [ebp - 0x63c]
call dword [sym.imp.SHELL32.dll_SHGetPathFromIDListW]
mov esi, eax
mov dword [ebp - 0x638], 0
lea eax, [ebp - 0x638]
push eax
call dword [sym.imp.SHELL32.dll_SHGetMalloc]
mov ecx, dword [ebp - 0x638]
push dword [ebp - 0x63c]
push ecx
mov edx, dword [ecx]
call dword [edx + 0x14]
test esi, esi
je 0x42f8b6
lea ecx, [ebp - 0x218]
lea edx, [ecx + 2]
nop dword [eax + eax]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x42fc30
jmp 0x42f36b
push 0x80004005
call fcn.00402f30
push 0x80070057
call fcn.00402f30
call fcn.00452a03
int3