Function at 0x401791
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 ebx
push esi
push edi
push ebp
push eax
mov eax, 0xb
add esp, 0xfffff004
push eax
dec eax
jne 0x40179b
mov eax, dword [esp + 0xb000]
add esp, 0xfffff1ac
mov esi, edx
mov edi, 0x412064
mov dword [esp + 4], ecx
mov dword [esp], eax
test esi, esi
je 0x402049
jmp case.0x401818.10
lea eax, [esp + 0x1020]
xor ebx, ebx
mov edx, ebx
shl edx, 0xc
lea ecx, [esp + 0x2020]
add edx, ecx
call fcn.0040272c
inc ebx
cmp ebx, 6
jl 0x4017d6
or ebp, 0xffffffff
xor ebx, ebx
push dword [edi + ebx*4]
lea eax, [esp + 0x24]
push eax
call sub.KERNEL32.DLL_lstrcmpiA
test eax, eax
jne 0x401809
mov ebp, ebx
jmp 0x40180f
inc ebx
cmp ebx, 0xd
jl 0x4017f4
cmp ebp, 0xc
ja case.0x401818.10
jmp dword [ebp*4 + 0x40181f]
cmp dword [esp + 4], 2
jne case.0x401818.10
lea eax, [esp + 0x8020]
push eax
push 0x400
call sub.KERNEL32.DLL_GetCurrentDirectoryA
lea eax, [esp + 0x8020]
call fcn.00402620
lea edx, [esp + 0x1020]
lea eax, [esp + 0x8020]
call fcn.0040d674
lea eax, [esp + 0x8420]
call fcn.00404ee0
lea edx, [esp + 0x8020]
lea eax, [esp + 0x8420]
call fcn.00404f34
jmp 0x40194d
push 0
lea edx, [esp + 0x902c]
push edx
call sub.KERNEL32.DLL_SetFileAttributesA
lea ecx, [esp + 0x9028]
push ecx
call sub.KERNEL32.DLL_GetFileAttributesA
cmp eax, 0xffffffff
je 0x40194d
lea eax, [esp + 0x9028]
push eax
call sub.KERNEL32.DLL_DeleteFileA
test eax, eax
jne 0x40194d
xor ebx, ebx
push ebx
lea eax, [esp + 0x902c]
push eax
push str._s._d.tmp
lea edx, [esp + 0x9c64]
push edx
call sub.USER32.DLL_wsprintfA
add esp, 0x10
lea ecx, [esp + 0x9c58]
push ecx
call sub.KERNEL32.DLL_GetFileAttributesA
cmp eax, 0xffffffff
je 0x40191a
inc ebx
jmp 0x4018e7
lea eax, [esp + 0x9c58]
push eax
lea edx, [esp + 0x902c]
push edx
call sub.KERNEL32.DLL_MoveFileA
test eax, eax
je 0x40194d
call fcn.00404d48
test eax, eax
je 0x40194d
push 4
push 0
lea ecx, [esp + 0x9c60]
push ecx
call sub.KERNEL32.DLL_MoveFileExA
lea edx, [esp + 0x9028]
lea eax, [esp + 0x8420]
xor ecx, ecx
call fcn.00404f6c
test al, al
jne 0x4018b3
lea eax, [esp + 0x8420]
mov edx, 2
call fcn.00404f04
jmp case.0x401818.10
cmp dword [esp + 4], 0
jne case.0x401818.10
mov eax, dword [0x41204c]
test eax, eax
sete bl
and ebx, 1
test bl, bl
jne 0x4019a6
mov edx, 0x41218c
call fcn.0040d674
cmp byte [esp + 8], 0
je 0x4019b6
lea ebp, [esp + 0x1020]
jmp 0x4019bf
mov eax, esi
call fcn.004023e8
mov ebp, eax
test bl, bl
je 0x4019c7
xor eax, eax
jmp 0x4019d1
mov eax, dword [0x41204c]
call fcn.0040d520
mov dword [esp + 0xc], eax
mov eax, ebp
call fcn.0040d520
mov edx, eax
mov eax, dword [0x41204c]
add edx, dword [esp + 0xc]
add edx, 5
call fcn.0040d43c
mov dword [0x41204c], eax
test bl, bl
je 0x401a01
mov edx, dword [0x41204c]
mov byte [edx], 0
mov edx, ebp
mov eax, dword [0x41204c]
call fcn.0040d674
cmp byte [esp + 8], 0
jne case.0x401818.10
mov eax, ebp
call fcn.0040d424
jmp case.0x401818.10
cmp dword [esp + 4], 0
jne case.0x401818.10
lea edx, [esp + 0x1020]
push edx
push dword [esp + 4]
call sub.USER32.DLL_SetWindowTextA
jmp case.0x401818.10
cmp dword [esp + 4], 0
jne case.0x401818.10
mov byte [esp + 0xa058], 0
xor ecx, ecx
mov cl, byte [esp + 0x1020]
cmp ecx, 0x2e
jne 0x401a8c
xor eax, eax
mov al, byte [esp + 0x1021]
cmp eax, 0x5c
jne 0x401a8c
lea edx, [esp + 0x1022]
lea eax, [esp + 0xa058]
call fcn.0040d5a0
jmp 0x401b61
xor edx, edx
mov dl, byte [esp + 0x1020]
cmp edx, 0x5c
je 0x401ab2
cmp byte [esp + 0x1020], 0
je 0x401aca
xor ecx, ecx
mov cl, byte [esp + 0x1021]
cmp ecx, 0x3a
jne 0x401aca
lea edx, [esp + 0x1020]
lea eax, [esp + 0xa058]
call fcn.0040d5a0
jmp 0x401b61
lea ecx, [esp + 0x10]
push ecx
push 1
push 0
push str.SoftwareMicrosoftWindowsCurrentVersion
push 0x80000002
call sub.ADVAPI32.DLL_RegOpenKeyExA
test eax, eax
jne 0x401b19
mov dword [esp + 0x18], 0x400
lea eax, [esp + 0x18]
push eax
lea edx, [esp + 0xa05c]
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 + 0xa058], 0
je 0x401b4e
lea eax, [esp + 0xa058]
call fcn.0040d520
xor edx, edx
mov dl, byte [esp + eax + 0xa057]
cmp edx, 0x5c
je 0x401b4e
mov edx, 0x412098
lea eax, [esp + 0xa058]
call fcn.0040d674
lea edx, [esp + 0x1020]
lea eax, [esp + 0xa058]
call fcn.0040d674
lea edx, [esp + 0xa058]
mov eax, 0x4138c8
call fcn.0040d5a0
lea eax, [esp + 0xa058]
call fcn.0040251b
push 0x65
push dword [esp + 4]
call sub.USER32.DLL_GetDlgItem
mov ebx, eax
lea eax, [esp + 0xa058]
push eax
push ebx
call sub.USER32.DLL_SetWindowTextA
push 0x4138c8
push 0
push 0x143
push ebx
call sub.USER32.DLL_SendMessageA
lea edx, [esp + 0xa058]
mov eax, 0x4138c8
call fcn.0040d5cc
test eax, eax
je case.0x401818.10
lea edx, [esp + 0xa058]
push edx
push 0
push 0x143
push ebx
call sub.USER32.DLL_SendMessageA
jmp case.0x401818.10
xor eax, eax
mov al, byte [esp + 0x1020]
call fcn.0040d6b8
test eax, eax
je 0x401c07
xor edx, edx
mov dl, byte [esp + 0x1020]
add edx, 0xffffffd0
mov dword [0x412058], edx
jmp case.0x401818.10
mov dword [0x412058], 2
jmp case.0x401818.10
mov cl, byte [esp + 0x1020]
sub cl, 1
jb 0x401c48
sub cl, 0x2f
je 0x401c34
dec cl
je 0x401c48
dec cl
je 0x401c5f
jmp case.0x401818.10
xor eax, eax
mov dword [0x41281c], eax
xor edx, edx
mov dword [0x412820], edx
jmp case.0x401818.10
xor ecx, ecx
mov dword [0x41281c], ecx
mov dword [0x412820], 1
jmp case.0x401818.10
mov dword [0x41281c], 1
xor eax, eax
mov dword [0x412820], eax
jmp case.0x401818.10
cmp dword [esp + 4], 4
jne case.0x401818.10
lea eax, [esp + 0x1020]
xor edx, edx
call fcn.00402121
jmp case.0x401818.10
cmp dword [esp + 4], 1
jne case.0x401818.10
lea ecx, [esp + 0xa458]
push ecx
push 0x400
call sub.KERNEL32.DLL_GetTempPathA
lea eax, [esp + 0xa458]
call fcn.00402620
xor ebx, ebx
push ebx
lea eax, [esp + 0xa45c]
push eax
push str._sRarSFX_d
lea edx, [esp + 0xa864]
push edx
call sub.USER32.DLL_wsprintfA
add esp, 0x10
lea ecx, [esp + 0xa858]
push ecx
call sub.KERNEL32.DLL_GetFileAttributesA
cmp eax, 0xffffffff
je 0x401cf1
inc ebx
jmp 0x401cbe
lea eax, [esp + 0xa858]
push eax
push 0x65
push dword [esp + 8]
call sub.USER32.DLL_SetDlgItemTextA
cmp byte [esp + 0x1020], 0
je 0x401db8
mov byte [esp + 0xac58], 0
xor ebx, ebx
jmp 0x401d48
and eax, 0xff
cmp eax, 0x40
jne 0x401d47
lea edx, [esp + 0x1021]
lea eax, [esp + 0xac58]
add edx, ebx
call fcn.0040d5a0
mov byte [esp + ebx + 0x1020], 0
jmp 0x401d53
inc ebx
mov al, byte [esp + ebx + 0x1020]
test al, al
jne 0x401d1e
cmp byte [esp + 0xac58], 0
jne 0x401d83
lea edx, [esp + 0x2020]
lea eax, [esp + 0x1020]
call fcn.0040d5a0
lea edx, [esp + 0x3020]
lea eax, [esp + 0xac58]
call fcn.0040d5a0
push 0x24
lea edx, [esp + 0xac5c]
push edx
lea ecx, [esp + 0x1028]
push ecx
push dword [esp + 0xc]
call sub.USER32.DLL_MessageBoxA
cmp eax, 6
je 0x401db8
mov dword [0x412818], 1
push 1
push dword [esp + 4]
call sub.USER32.DLL_EndDialog
cmp dword [0x412058], 0
jne 0x401dcb
mov dword [0x412058], 2
mov byte [0x412045], 1
jmp case.0x401818.10
cmp dword [esp + 4], 3
jne case.0x401818.10
cmp byte [esp + 0x1020], 0
je 0x401dfd
lea eax, [esp + 0x1020]
push eax
push dword [esp + 4]
call sub.USER32.DLL_SetWindowTextA
mov eax, esi
call fcn.004023e8
mov dword [0x412050], eax
jmp case.0x401818.10
cmp dword [esp + 4], 5
jne case.0x401818.10
lea eax, [esp + 0x1020]
mov dl, 1
call fcn.00402121
jmp case.0x401818.10
cmp dword [esp + 4], 6
jne case.0x401818.10
lea ecx, [esp + 0x2020]
xor eax, eax
mov al, byte [ecx]
call fcn.0040d464
sub eax, 0x50
je 0x401e6a
sub eax, 3
je 0x401e56
dec eax
je 0x401e60
jmp 0x401e74
mov dword [esp + 0x1c], 0xb
jmp 0x401e7c
mov dword [esp + 0x1c], 7
jmp 0x401e7c
mov dword [esp + 0x1c], 2
jmp 0x401e7c
mov dword [esp + 0x1c], 0x10
lea edx, [esp + 0x3020]
lea eax, [esp + 0xae58]
call fcn.0040d5a0
lea eax, [esp + 0xae58]
xor edx, edx
call fcn.00405c2c
test al, al
jne 0x401f1d
lea ebp, [esp + 0xae58]
jmp 0x401f17
mov dl, byte [ebp]
xor eax, eax
mov al, dl
cmp eax, 0x20
je 0x401ebb
cmp eax, 0x2f
jne 0x401f16
mov ebx, edx
xor edx, edx
mov byte [ebp], 0
lea eax, [esp + 0xae58]
call fcn.00405c2c
test al, al
je 0x401f13
xor ecx, ecx
mov cl, bl
cmp ecx, 0x2f
jne 0x401ef5
mov byte [esp + 0xba58], 0x2f
lea edx, [ebp + 1]
lea eax, [esp + 0xba59]
call fcn.0040d5a0
jmp 0x401f16
inc ebp
jmp 0x401ef9
inc ebp
xor ecx, ecx
mov cl, byte [ebp]
cmp ecx, 0x20
je 0x401ef8
lea eax, [esp + 0xba58]
mov edx, ebp
call fcn.0040d5a0
jmp 0x401f16
mov byte [ebp], bl
inc ebp
cmp byte [ebp], 0
jne 0x401eaa
lea edx, [esp + 0xb258]
lea eax, [esp + 0xae58]
call fcn.00405ccc
lea eax, [esp + 0xb658]
mov edx, dword [esp + 0x1c]
call fcn.004028d8
lea eax, [esp + 0xb658]
call fcn.00402620
lea edx, [esp + 0x4020]
cmp byte [edx], 0
je 0x401f77
lea edx, [esp + 0x4020]
lea eax, [esp + 0xb658]
call fcn.0040d674
lea eax, [esp + 0xb658]
call fcn.00402620
lea edx, [esp + 0x6020]
cmp byte [edx], 0
je 0x401f8c
lea eax, [esp + 0x6020]
jmp 0x401f93
lea eax, [esp + 0x3020]
call fcn.004025fc
mov edx, eax
lea eax, [esp + 0xb658]
call fcn.0040d674
mov edx, 0x4121d6
lea eax, [esp + 0xb658]
call fcn.00405688
lea eax, [esp + 0xb658]
mov cl, 1
xor edx, edx
call fcn.00405ac8
lea eax, [esp + 0x7020]
cmp byte [eax], 0
je 0x401fdc
lea edx, [esp + 0x7020]
jmp 0x401fde
xor edx, edx
push edx
cmp byte [esp + 0xba5c], 0
je 0x401ff2
lea eax, [esp + 0xba5c]
jmp 0x401ff4
xor eax, eax
push eax
lea edx, [esp + 0x5028]
cmp byte [edx], 0
je 0x40200a
lea ecx, [esp + 0x5028]
jmp 0x40200c
xor ecx, ecx
lea edx, [esp + 0xb660]
lea eax, [esp + 0xb260]
call fcn.004027c8
jmp case.0x401818.10
mov byte [0x41205c], 1
lea eax, [esp + 8]
push eax
lea ecx, [esp + 0x1024]
lea edx, [esp + 0x24]
mov eax, esi
call fcn.00402054
mov esi, eax
test eax, eax
jne 0x4017cd
add esp, 0xbe58
pop ebp
pop edi
pop esi
pop ebx
ret