Function at 0x4017eb
Capabilities:
Check if file exists
Delete file
Get common file path
Get file attributes
Move file
Persist via lnk shortcut
Query or enumerate registry value
Set file attributes

Disassembly:
push ebx
push esi
push edi
push ebp
push eax
mov eax, 0xc
add esp, 0xfffff004
push eax
dec eax
jne 0x4017f5
mov eax, dword [esp + 0xc000]
add esp, 0xfffff504
mov esi, edx
mov edi, 0x40c064
mov dword [esp + 4], ecx
mov dword [esp], eax
test esi, esi
je 0x4022f5
jmp case.0x401872.10
lea eax, [esp + 0x1024]
xor ebx, ebx
mov edx, ebx
shl edx, 0xc
lea ecx, [esp + 0x2024]
add edx, ecx
call fcn.004029f4
inc ebx
cmp ebx, 6
jl 0x401830
or ebp, 0xffffffff
xor ebx, ebx
push dword [edi + ebx*4]
lea eax, [esp + 0x28]
push eax
call sub.KERNEL32.DLL_lstrcmpiA
test eax, eax
jne 0x401863
mov ebp, ebx
jmp 0x401869
inc ebx
cmp ebx, 0xd
jl 0x40184e
cmp ebp, 0xc
ja case.0x401872.10
jmp dword [ebp*4 + 0x401879]
cmp dword [esp + 4], 2
jne case.0x401872.10
lea eax, [esp + 0x8024]
push eax
push 0x400
call sub.KERNEL32.DLL_GetCurrentDirectoryA
lea edx, [esp + 0x8024]
lea eax, [esp + 0x8424]
call fcn.00406b00
lea eax, [esp + 0x8424]
call fcn.004028e8
lea edx, [esp + 0x1024]
lea eax, [esp + 0x8424]
call fcn.00406bd4
lea eax, [esp + 0x8824]
call fcn.0040521c
lea edx, [esp + 0x8424]
lea eax, [esp + 0x8824]
call fcn.00405270
lea eax, [esp + 0xa040]
call fcn.004059c4
lea eax, [esp + 0xa06c]
call fcn.004059c4
lea eax, [esp + 0xa098]
call fcn.004059c4
jmp 0x401aa9
push 0
lea edx, [esp + 0x9430]
push edx
call sub.KERNEL32.DLL_SetFileAttributesA
cmp byte [esp + 0xa03c], 0
je 0x401a1e
call fcn.00405028
cmp eax, 4
je 0x401a1e
lea edx, [esp + 0xa0e0]
lea eax, [esp + 0x8024]
call fcn.00405940
lea eax, [esp + 0xa0e0]
call fcn.004028e8
lea eax, [esp + 0x8024]
call fcn.00406a80
mov ebx, eax
cmp ebx, 4
jl 0x4019b1
lea eax, [esp + 0xa0e0]
call fcn.00406a80
cmp eax, ebx
jb 0x4019c7
lea eax, [esp + 0x1024]
xor edx, edx
call fcn.004057fc
test al, al
jne 0x401ac6
lea eax, [esp + 0x942c]
call fcn.00406a80
mov byte [esp + eax + 0x942d], 0
lea eax, [esp + 0xa4e0]
mov ecx, 0x1e
xor edx, edx
call fcn.00406a24
mov dword [esp + 0xa4e4], 3
mov word [esp + 0xa4f0], 0x14
lea eax, [esp + 0x942c]
mov dword [esp + 0xa4e8], eax
lea edx, [esp + 0xa4e0]
push edx
call sub.SHELL32.DLL_SHFileOperationA
lea ecx, [esp + 0x942c]
push ecx
call sub.KERNEL32.DLL_GetFileAttributesA
cmp eax, 0xffffffff
je 0x401aa9
lea eax, [esp + 0x942c]
push eax
call sub.KERNEL32.DLL_DeleteFileA
test eax, eax
jne 0x401aa9
xor ebx, ebx
push ebx
lea eax, [esp + 0x9430]
push eax
push str._s._d.tmp
lea edx, [esp + 0xa50c]
push edx
call sub.USER32.DLL_wsprintfA
add esp, 0x10
lea ecx, [esp + 0xa500]
push ecx
call sub.KERNEL32.DLL_GetFileAttributesA
cmp eax, 0xffffffff
je 0x401a76
inc ebx
jmp 0x401a43
lea eax, [esp + 0xa500]
push eax
lea edx, [esp + 0x9430]
push edx
call sub.KERNEL32.DLL_MoveFileA
test eax, eax
je 0x401aa9
call fcn.00405028
test eax, eax
je 0x401aa9
push 4
push 0
lea ecx, [esp + 0xa508]
push ecx
call sub.KERNEL32.DLL_MoveFileExA
lea edx, [esp + 0x942c]
lea eax, [esp + 0x8824]
xor ecx, ecx
call fcn.004052a8
test al, al
jne 0x401944
lea eax, [esp + 0x8824]
mov edx, 2
call fcn.00405240
jmp case.0x401872.10
cmp dword [esp + 4], 0
jne case.0x401872.10
cmp dword [0x40c04c], 0
sete bl
and ebx, 1
test bl, bl
jne 0x401b07
mov edx, 0x40c197
mov eax, dword [0x40c04c]
call fcn.00406bd4
cmp byte [esp + 8], 0
je 0x401b17
lea ebp, [esp + 0x1024]
jmp 0x401b20
mov eax, esi
call fcn.00402690
mov ebp, eax
test bl, bl
je 0x401b28
xor eax, eax
jmp 0x401b32
mov eax, dword [0x40c04c]
call fcn.00406a80
mov dword [esp + 0xc], eax
mov eax, ebp
call fcn.00406a80
mov edx, eax
mov eax, dword [0x40c04c]
add edx, dword [esp + 0xc]
add edx, 5
call fcn.00406850
mov dword [0x40c04c], eax
test bl, bl
je 0x401b62
mov edx, dword [0x40c04c]
mov byte [edx], 0
mov edx, ebp
mov eax, dword [0x40c04c]
call fcn.00406bd4
cmp byte [esp + 8], 0
jne case.0x401872.10
mov eax, ebp
call fcn.00406838
jmp case.0x401872.10
cmp dword [esp + 4], 0
jne case.0x401872.10
lea edx, [esp + 0x1024]
push edx
push dword [esp + 4]
call sub.USER32.DLL_SetWindowTextA
jmp case.0x401872.10
cmp dword [esp + 4], 0
jne case.0x401872.10
mov byte [esp + 0xa900], 0
xor ecx, ecx
mov cl, byte [esp + 0x1024]
cmp ecx, 0x2e
jne 0x401bed
xor eax, eax
mov al, byte [esp + 0x1025]
cmp eax, 0x5c
jne 0x401bed
lea edx, [esp + 0x1026]
lea eax, [esp + 0xa900]
call fcn.00406b00
jmp 0x401cc2
xor edx, edx
mov dl, byte [esp + 0x1024]
cmp edx, 0x5c
je 0x401c13
cmp byte [esp + 0x1024], 0
je 0x401c2b
xor ecx, ecx
mov cl, byte [esp + 0x1025]
cmp ecx, 0x3a
jne 0x401c2b
lea edx, [esp + 0x1024]
lea eax, [esp + 0xa900]
call fcn.00406b00
jmp 0x401cc2
lea ecx, [esp + 0x10]
push ecx
push 1
push 0
push str.SoftwareMicrosoftWindowsCurrentVersion
push 0x80000002
call sub.ADVAPI32.DLL_RegOpenKeyExA
test eax, eax
jne 0x401c7a
mov dword [esp + 0x18], 0x400
lea eax, [esp + 0x18]
push eax
lea edx, [esp + 0xa904]
push edx
lea ecx, [esp + 0x1c]
push ecx
push 0
push str.ProgramFilesDir
push dword [esp + 0x24]
call sub.ADVAPI32.DLL_RegQueryValueExA
push dword [esp + 0x10]
call sub.ADVAPI32.DLL_RegCloseKey
cmp byte [esp + 0xa900], 0
je 0x401caf
lea eax, [esp + 0xa900]
call fcn.00406a80
xor edx, edx
mov dl, byte [esp + eax + 0xa8ff]
cmp edx, 0x5c
je 0x401caf
mov edx, 0x40c098
lea eax, [esp + 0xa900]
call fcn.00406bd4
lea edx, [esp + 0x1024]
lea eax, [esp + 0xa900]
call fcn.00406bd4
lea edx, [esp + 0xa900]
mov eax, 0x40dd70
call fcn.00406b00
lea eax, [esp + 0xa900]
call fcn.004027c3
push 0x65
push dword [esp + 4]
call sub.USER32.DLL_GetDlgItem
mov ebx, eax
lea eax, [esp + 0xa900]
push eax
push ebx
call sub.USER32.DLL_SetWindowTextA
push 0x40dd70
push 0
push 0x143
push ebx
call sub.USER32.DLL_SendMessageA
lea edx, [esp + 0xa900]
mov eax, 0x40dd70
call fcn.00406b2c
test eax, eax
je case.0x401872.10
lea edx, [esp + 0xa900]
push edx
push 0
push 0x143
push ebx
call sub.USER32.DLL_SendMessageA
jmp case.0x401872.10
cmp dword [0x40c058], 1
je case.0x401872.10
xor eax, eax
mov al, byte [esp + 0x1024]
call fcn.00406c30
test eax, eax
je 0x401d75
xor edx, edx
mov dl, byte [esp + 0x1024]
add edx, 0xffffffd0
mov dword [0x40c058], edx
jmp case.0x401872.10
mov dword [0x40c058], 2
jmp case.0x401872.10
mov cl, byte [esp + 0x1024]
sub cl, 1
jb 0x401db6
sub cl, 0x2f
je 0x401da2
dec cl
je 0x401db6
dec cl
je 0x401dcd
jmp case.0x401872.10
xor eax, eax
mov dword [0x40cc9c], eax
xor edx, edx
mov dword [0x40cca0], edx
jmp case.0x401872.10
xor ecx, ecx
mov dword [0x40cc9c], ecx
mov dword [0x40cca0], 1
jmp case.0x401872.10
mov dword [0x40cc9c], 1
xor eax, eax
mov dword [0x40cca0], eax
jmp case.0x401872.10
cmp dword [esp + 4], 4
jne case.0x401872.10
lea eax, [esp + 0x1024]
xor edx, edx
call fcn.004023b8
jmp case.0x401872.10
cmp dword [esp + 4], 1
jne 0x401f61
lea ecx, [esp + 0xad00]
push ecx
push 0x400
call sub.KERNEL32.DLL_GetTempPathA
lea eax, [esp + 0xad00]
call fcn.004028e8
xor ebx, ebx
push ebx
push dword [0x40c040]
lea eax, [esp + 0xad08]
push eax
push str._s_s_d
lea edx, [esp + 0xb110]
push edx
call sub.USER32.DLL_wsprintfA
add esp, 0x14
lea ecx, [esp + 0xb100]
push ecx
call sub.KERNEL32.DLL_GetFileAttributesA
cmp eax, 0xffffffff
je 0x401e65
inc ebx
jmp 0x401e2c
lea eax, [esp + 0xb100]
push eax
push 0x65
push dword [esp + 8]
call sub.USER32.DLL_SetDlgItemTextA
cmp byte [esp + 0x1024], 0
je 0x401f61
cmp byte [0x40c05c], 0
jne 0x401f61
mov byte [esp + 0xb500], 0
lea eax, [esp + 0x1024]
mov edx, 0x2c
call fcn.00406a90
test eax, eax
jne 0x401ee9
xor ebx, ebx
jmp 0x401ede
and eax, 0xff
cmp eax, 0x40
jne 0x401edd
lea edx, [esp + 0x1025]
lea eax, [esp + 0xb500]
add edx, ebx
call fcn.00406b00
mov byte [esp + ebx + 0x1024], 0
jmp 0x401ee9
inc ebx
mov al, byte [esp + ebx + 0x1024]
test al, al
jne 0x401eb4
cmp byte [esp + 0xb500], 0
jne 0x401f19
lea edx, [esp + 0x2024]
lea eax, [esp + 0x1024]
call fcn.00406b00
lea edx, [esp + 0x3024]
lea eax, [esp + 0xb500]
call fcn.00406b00
lea eax, [esp + 0x1024]
call fcn.00402cac
push 0x24
lea edx, [esp + 0xb504]
push edx
lea ecx, [esp + 0x102c]
push ecx
push dword [esp + 0xc]
call sub.USER32.DLL_MessageBoxA
cmp eax, 6
je 0x401f61
push 1
mov byte [0x40c045], 1
push dword [esp + 4]
mov dword [0x40cc98], 1
call sub.USER32.DLL_EndDialog
cmp dword [esp + 4], 7
jne case.0x401872.10
cmp dword [0x40c058], 0
jne 0x401f7f
mov dword [0x40c058], 2
mov byte [0x40c044], 1
jmp case.0x401872.10
cmp dword [esp + 4], 3
jne 0x401fb9
cmp byte [esp + 0x1024], 0
je 0x401fad
lea eax, [esp + 0x1024]
push eax
push dword [esp + 4]
call sub.USER32.DLL_SetWindowTextA
mov eax, esi
call fcn.00402690
mov dword [0x40c050], eax
mov byte [0x40c05e], 1
jmp case.0x401872.10
cmp dword [esp + 4], 5
jne case.0x401872.10
lea eax, [esp + 0x1024]
mov dl, 1
call fcn.004023b8
jmp case.0x401872.10
cmp dword [esp + 4], 6
jne case.0x401872.10
lea ecx, [esp + 0x2024]
xor eax, eax
mov al, byte [ecx]
call fcn.00406878
sub eax, 0x50
je 0x402021
sub eax, 3
je 0x40200d
dec eax
je 0x402017
jmp 0x40202b
mov dword [esp + 0x1c], 0xb
jmp 0x402033
mov dword [esp + 0x1c], 7
jmp 0x402033
mov dword [esp + 0x1c], 2
jmp 0x402033
mov dword [esp + 0x1c], 0x10
mov byte [esp + 0xc300], 0
lea edx, [esp + 0x3024]
lea eax, [esp + 0xb700]
call fcn.00406b00
xor edx, edx
mov dl, byte [esp + 0xb700]
cmp edx, 0x22
jne 0x4020c1
lea edx, [esp + 0x3024]
lea eax, [esp + 0xb700]
inc edx
call fcn.00406b00
cmp byte [0x40ea84], 0
je 0x402091
lea edx, [esp + 0xb701]
mov eax, 0x40e984
mov ecx, 0x22
call fcn.004067c8
jmp 0x4020a2
lea eax, [esp + 0xb701]
mov edx, 0x22
call fcn.00406a90
test eax, eax
je 0x402171
mov byte [eax], 0
lea edx, [eax + 1]
lea eax, [esp + 0xc300]
call fcn.00406b00
jmp 0x402171
lea eax, [esp + 0xb700]
xor edx, edx
call fcn.00405cb0
test al, al
jne 0x402171
xor ecx, ecx
mov dword [esp + 0x20], ecx
lea ebp, [esp + 0xb700]
jmp 0x40215d
mov dl, byte [ebp]
xor eax, eax
mov al, dl
cmp eax, 0x20
je 0x4020f7
cmp eax, 0x2f
jne 0x40215c
mov ebx, edx
xor edx, edx
mov byte [ebp], 0
lea eax, [esp + 0xb700]
call fcn.00405cb0
test al, al
je 0x402159
mov dword [esp + 0x20], ebp
xor ecx, ecx
mov cl, bl
cmp ecx, 0x2f
jne 0x402135
mov byte [esp + 0xc300], 0x2f
lea edx, [ebp + 1]
lea eax, [esp + 0xc301]
call fcn.00406b00
jmp 0x402151
inc ebp
jmp 0x402139
inc ebp
xor ecx, ecx
mov cl, byte [ebp]
cmp ecx, 0x20
je 0x402138
lea eax, [esp + 0xc300]
mov edx, ebp
call fcn.00406b00
mov ecx, dword [esp + 0x20]
mov byte [ecx], bl
jmp 0x40215c
mov byte [ebp], bl
inc ebp
cmp byte [ebp], 0
jne 0x4020e6
cmp dword [esp + 0x20], 0
je 0x402171
mov eax, dword [esp + 0x20]
mov byte [eax], 0
lea edx, [esp + 0xbb00]
lea eax, [esp + 0xb700]
call fcn.00405d44
lea eax, [esp + 0xbf00]
mov edx, dword [esp + 0x1c]
call fcn.00402bc4
lea eax, [esp + 0xbf00]
call fcn.004028e8
lea edx, [esp + 0x4024]
cmp byte [edx], 0
je 0x4021cb
lea edx, [esp + 0x4024]
lea eax, [esp + 0xbf00]
call fcn.00406bd4
lea eax, [esp + 0xbf00]
call fcn.004028e8
lea edx, [esp + 0xbf00]
lea eax, [esp + 0xc700]
call fcn.00406b00
lea edx, [esp + 0x6024]
cmp byte [edx], 0
je 0x4021f3
lea eax, [esp + 0x6024]
jmp 0x4021fa
lea eax, [esp + 0x3024]
call fcn.004028c4
mov edx, eax
lea eax, [esp + 0xbf00]
call fcn.00406bd4
lea eax, [esp + 0xbf00]
call fcn.004057c4
test eax, eax
je 0x40222b
mov edx, str..lnk
call fcn.00406b88
test eax, eax
je 0x40223c
mov edx, str..lnk
lea eax, [esp + 0xbf00]
call fcn.00406bd4
lea eax, [esp + 0xbf00]
mov cl, 1
xor edx, edx
call fcn.00405b3c
lea eax, [esp + 0x7024]
cmp byte [eax], 0
je 0x402261
lea edx, [esp + 0x7024]
jmp 0x402263
xor edx, edx
push edx
cmp byte [esp + 0xc304], 0
je 0x402277
lea eax, [esp + 0xc304]
jmp 0x402279
xor eax, eax
push eax
lea edx, [esp + 0x502c]
cmp byte [edx], 0
je 0x40228f
lea ecx, [esp + 0x502c]
jmp 0x402291
xor ecx, ecx
lea edx, [esp + 0xbf08]
lea eax, [esp + 0xbb08]
call fcn.00402ab4
cmp byte [esp + 0xc700], 0
je case.0x401872.10
push 0
lea eax, [esp + 0xc704]
push eax
push 1
push 0x1000
call sub.SHELL32.DLL_SHChangeNotify
jmp case.0x401872.10
cmp dword [esp + 4], 7
jne case.0x401872.10
mov byte [0x40c05d], 1
lea edx, [esp + 8]
mov eax, esi
push edx
lea edx, [esp + 0x28]
lea ecx, [esp + 0x1028]
call fcn.00402300
mov esi, eax
test eax, eax
jne 0x401827
add esp, 0xcb00
pop ebp
pop edi
pop esi
pop ebx
ret