Function at 0x40174a
Capabilities:
Check if file exists
Delete file
Get common file path
Get file attributes
Move file
Query or enumerate registry value
Set file attributes

Disassembly:
push ebp
mov ebp, esp
push eax
mov eax, 0xb
add esp, 0xfffff004
push eax
dec eax
jne 0x401753
mov eax, dword [ebp - 4]
add esp, 0xfffff990
push ebx
push esi
push edi
mov dword [ebp - 0xc34], ecx
mov esi, edx
mov dword [ebp - 0xc30], eax
mov eax, 0x412348
call fcn.0040c6bc
test esi, esi
jne case.0x4017ec.10
mov edx, dword [ebp - 0xc2c]
mov dword fs:[0], edx
mov eax, edx
jmp 0x401ec1
lea eax, [ebp - 0x2c44]
xor ebx, ebx
mov edx, ebx
shl edx, 0xc
lea ecx, [ebp - 0x8c44]
add edx, ecx
call fcn.00402428
inc ebx
cmp ebx, 6
jl 0x4017a5
or edi, 0xffffffff
xor ebx, ebx
push dword [ebx*4 + 0x412054]
lea eax, [ebp - 0x1c44]
push eax
call sub.KERNEL32.DLL_lstrcmpiA
test eax, eax
jne 0x4017dd
mov edi, ebx
jmp 0x4017e3
inc ebx
cmp ebx, 0xc
jl 0x4017c2
cmp edi, 0xb
ja case.0x4017ec.10
jmp dword [edi*4 + 0x4017f3]
cmp dword [ebp - 0xc34], 1
jne case.0x4017ec.10
lea eax, [ebp - 0x9044]
push eax
push 0x400
call sub.KERNEL32.DLL_GetCurrentDirectoryA
lea eax, [ebp - 0x9044]
call fcn.0040231c
lea edx, [ebp - 0x2c44]
lea eax, [ebp - 0x9044]
call fcn.0040c664
mov word [ebp - 0xc1c], 8
lea eax, [ebp - 0xc08]
call fcn.00404934
inc dword [ebp - 0xc10]
lea edx, [ebp - 0x9044]
mov word [ebp - 0xc1c], 0x14
lea eax, [ebp - 0xc08]
call fcn.00404988
jmp 0x401930
push 0
lea edx, [ebp - 0x9c74]
push edx
call sub.KERNEL32.DLL_SetFileAttributesA
lea ecx, [ebp - 0x9c74]
push ecx
call sub.KERNEL32.DLL_GetFileAttributesA
cmp eax, 0xffffffff
je 0x401930
lea eax, [ebp - 0x9c74]
push eax
call sub.KERNEL32.DLL_DeleteFileA
test eax, eax
jne 0x401930
mov word [ebp - 0xc1c], 0x14
xor ebx, ebx
push ebx
lea eax, [ebp - 0x9c74]
push eax
push str._s._d.tmp
lea edx, [ebp - 0xa074]
push edx
call sub.USER32.DLL_wsprintfA
add esp, 0x10
lea ecx, [ebp - 0xa074]
push ecx
call sub.KERNEL32.DLL_GetFileAttributesA
cmp eax, 0xffffffff
je 0x401900
inc ebx
jmp 0x4018d0
lea eax, [ebp - 0xa074]
push eax
lea edx, [ebp - 0x9c74]
push edx
call sub.KERNEL32.DLL_MoveFileA
test eax, eax
je 0x401930
call fcn.00404764
test eax, eax
je 0x401930
push 4
push 0
lea ecx, [ebp - 0xa074]
push ecx
call sub.KERNEL32.DLL_MoveFileExA
lea edx, [ebp - 0x9c74]
lea eax, [ebp - 0xc08]
xor ecx, ecx
call fcn.004049c0
test al, al
jne 0x401896
dec dword [ebp - 0xc10]
lea eax, [ebp - 0xc08]
mov edx, 2
call fcn.00404958
mov word [ebp - 0xc1c], 0
jmp case.0x4017ec.10
cmp dword [ebp - 0xc34], 0
jne case.0x4017ec.10
cmp byte [ebp - 0xc35], 0
je 0x401997
lea edx, [ebp - 0x2c44]
mov al, 1
call fcn.004026ec
jmp case.0x4017ec.10
mov eax, esi
call fcn.0040220c
mov ebx, eax
mov al, 1
mov edx, ebx
call fcn.004026ec
mov eax, ebx
call fcn.0040c414
jmp case.0x4017ec.10
cmp dword [ebp - 0xc34], 0
jne case.0x4017ec.10
lea edx, [ebp - 0x2c44]
push edx
push dword [ebp - 0xc30]
call sub.USER32.DLL_SetWindowTextA
jmp case.0x4017ec.10
cmp dword [ebp - 0xc34], 0
jne case.0x4017ec.10
mov byte [ebp - 0xa474], 0
xor ecx, ecx
mov cl, byte [ebp - 0x2c44]
cmp ecx, 0x2e
jne 0x401a1d
xor eax, eax
mov al, byte [ebp - 0x2c43]
cmp eax, 0x5c
jne 0x401a1d
lea edx, [ebp - 0x2c42]
lea eax, [ebp - 0xa474]
call fcn.0040c590
jmp 0x401af3
xor edx, edx
mov dl, byte [ebp - 0x2c44]
cmp edx, 0x5c
je 0x401a40
cmp byte [ebp - 0x2c44], 0
je 0x401a56
xor ecx, ecx
mov cl, byte [ebp - 0x2c43]
cmp ecx, 0x3a
jne 0x401a56
lea edx, [ebp - 0x2c44]
lea eax, [ebp - 0xa474]
call fcn.0040c590
jmp 0x401af3
lea ecx, [ebp - 0xc3c]
push ecx
push 1
push 0
push str.SoftwareMicrosoftWindowsCurrentVersion
push 0x80000002
call sub.ADVAPI32.DLL_RegOpenKeyExA
test eax, eax
jne 0x401ab0
mov dword [ebp - 0xc44], 0x400
lea eax, [ebp - 0xc44]
push eax
lea edx, [ebp - 0xa474]
push edx
lea ecx, [ebp - 0xc40]
push ecx
push 0
push str.ProgramFilesDir
push dword [ebp - 0xc3c]
call sub.ADVAPI32.DLL_RegQueryValueExA
push dword [ebp - 0xc3c]
call sub.ADVAPI32.DLL_RegCloseKey
cmp byte [ebp - 0xa474], 0
je 0x401ae2
lea eax, [ebp - 0xa474]
call fcn.0040c510
xor edx, edx
mov dl, byte [ebp + eax - 0xa475]
cmp edx, 0x5c
je 0x401ae2
mov edx, 0x412084
lea eax, [ebp - 0xa474]
call fcn.0040c664
lea edx, [ebp - 0x2c44]
lea eax, [ebp - 0xa474]
call fcn.0040c664
lea ecx, [ebp - 0xa474]
push ecx
push 0x65
push dword [ebp - 0xc30]
call sub.USER32.DLL_SetDlgItemTextA
jmp case.0x4017ec.10
xor eax, eax
mov al, byte [ebp - 0x2c44]
call fcn.0040c6a8
test eax, eax
je 0x401b33
xor edx, edx
mov dl, byte [ebp - 0x2c44]
add edx, 0xffffffd0
mov dword [0x41204c], edx
jmp case.0x4017ec.10
mov dword [0x41204c], 2
jmp case.0x4017ec.10
mov cl, byte [ebp - 0x2c44]
sub cl, 1
jb 0x401b73
sub cl, 0x2f
je 0x401b5f
dec cl
je 0x401b73
dec cl
je 0x401b8a
jmp case.0x4017ec.10
xor eax, eax
mov dword [0x4126cc], eax
xor edx, edx
mov dword [0x4126d0], edx
jmp case.0x4017ec.10
xor ecx, ecx
mov dword [0x4126cc], ecx
mov dword [0x4126d0], 1
jmp case.0x4017ec.10
mov dword [0x4126cc], 1
xor eax, eax
mov dword [0x4126d0], eax
jmp case.0x4017ec.10
cmp dword [ebp - 0xc34], 3
jne case.0x4017ec.10
lea eax, [ebp - 0x2c44]
xor edx, edx
call fcn.00401f7c
jmp case.0x4017ec.10
cmp dword [ebp - 0xc34], 0
jne case.0x4017ec.10
lea ecx, [ebp - 0xa874]
push ecx
push 0x400
call sub.KERNEL32.DLL_GetTempPathA
lea eax, [ebp - 0xa874]
call fcn.0040231c
xor ebx, ebx
push ebx
lea eax, [ebp - 0xa874]
push eax
push str._sRarSFX_d
lea edx, [ebp - 0xac74]
push edx
call sub.USER32.DLL_wsprintfA
add esp, 0x10
lea ecx, [ebp - 0xac74]
push ecx
call sub.KERNEL32.DLL_GetFileAttributesA
cmp eax, 0xffffffff
je 0x401c1a
inc ebx
jmp 0x401bea
lea eax, [ebp - 0xac74]
push eax
push 0x65
push dword [ebp - 0xc30]
call sub.USER32.DLL_SetDlgItemTextA
cmp byte [ebp - 0x2c44], 0
je 0x401cdb
mov byte [ebp - 0xae74], 0
xor ebx, ebx
jmp 0x401c6e
and eax, 0xff
cmp eax, 0x40
jne 0x401c6d
lea edx, [ebp - 0x2c43]
lea eax, [ebp - 0xae74]
add edx, ebx
call fcn.0040c590
mov byte [ebp + ebx - 0x2c44], 0
jmp 0x401c79
inc ebx
mov al, byte [ebp + ebx - 0x2c44]
test al, al
jne 0x401c46
cmp byte [ebp - 0xae74], 0
jne 0x401ca4
lea edx, [ebp - 0x8c44]
lea eax, [ebp - 0x2c44]
call fcn.0040c590
lea edx, [ebp - 0x7c44]
lea eax, [ebp - 0xae74]
call fcn.0040c590
push 0x24
lea edx, [ebp - 0xae74]
push edx
lea ecx, [ebp - 0x2c44]
push ecx
push dword [ebp - 0xc30]
call sub.USER32.DLL_MessageBoxA
cmp eax, 6
je 0x401cdb
mov dword [0x4126c8], 1
push 1
push dword [ebp - 0xc30]
call sub.USER32.DLL_EndDialog
cmp dword [0x41204c], 0
jne 0x401cee
mov dword [0x41204c], 1
mov byte [0x412041], 1
jmp case.0x4017ec.10
cmp dword [ebp - 0xc34], 2
jne case.0x4017ec.10
cmp byte [ebp - 0x2c44], 0
je 0x401d22
lea eax, [ebp - 0x2c44]
push eax
push dword [ebp - 0xc30]
call sub.USER32.DLL_SetWindowTextA
mov eax, esi
call fcn.0040220c
mov ebx, eax
push 0x65
push dword [ebp - 0xc30]
call sub.USER32.DLL_GetDlgItem
mov cl, 1
mov edx, ebx
call fcn.004038fc
mov eax, ebx
call fcn.0040c414
jmp case.0x4017ec.10
cmp dword [ebp - 0xc34], 4
jne case.0x4017ec.10
lea eax, [ebp - 0x2c44]
mov dl, 1
call fcn.00401f7c
jmp case.0x4017ec.10
cmp dword [ebp - 0xc34], 5
jne case.0x4017ec.10
lea ecx, [ebp - 0x8c44]
xor eax, eax
mov al, byte [ecx]
call fcn.0040c454
sub eax, 0x50
je 0x401da5
sub eax, 3
je 0x401d97
dec eax
je 0x401d9e
jmp 0x401dac
mov ebx, 0xb
jmp 0x401db1
mov ebx, 7
jmp 0x401db1
mov ebx, 2
jmp 0x401db1
mov ebx, 0x10
lea edx, [ebp - 0xb274]
lea eax, [ebp - 0x7c44]
call fcn.00405684
lea eax, [ebp - 0xb674]
mov edx, ebx
call fcn.004025d4
lea eax, [ebp - 0xb674]
call fcn.0040231c
lea edx, [ebp - 0x6c44]
cmp byte [edx], 0
je 0x401e01
lea edx, [ebp - 0x6c44]
lea eax, [ebp - 0xb674]
call fcn.0040c664
lea eax, [ebp - 0xb674]
call fcn.0040231c
lea edx, [ebp - 0x4c44]
cmp byte [edx], 0
je 0x401e14
lea eax, [ebp - 0x4c44]
jmp 0x401e1a
lea eax, [ebp - 0x7c44]
call fcn.004022f8
mov edx, eax
lea eax, [ebp - 0xb674]
call fcn.0040c664
mov edx, 0x4121d9
lea eax, [ebp - 0xb674]
call fcn.004050a0
lea eax, [ebp - 0xb674]
mov cl, 1
xor edx, edx
call fcn.00405470
lea eax, [ebp - 0x3c44]
cmp byte [eax], 0
je 0x401e5e
lea edx, [ebp - 0x3c44]
jmp 0x401e60
xor edx, edx
lea eax, [ebp - 0x5c44]
push edx
push 0
cmp byte [eax], 0
je 0x401e76
lea ecx, [ebp - 0x5c44]
jmp 0x401e78
xor ecx, ecx
lea edx, [ebp - 0xb674]
lea eax, [ebp - 0xb274]
call fcn.004024c4
lea eax, [ebp - 0xc35]
lea ecx, [ebp - 0x2c44]
push eax
mov eax, esi
lea edx, [ebp - 0x1c44]
call fcn.00401ec8
mov esi, eax
test eax, eax
jne 0x40179d
mov byte [0x41201d], 0
mov edx, dword [ebp - 0xc2c]
mov dword fs:[0], edx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret