Function at 0x401791
Capabilities:
Check if file exists
Delete file
Get common file path
Get file attributes
Move file
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 0x40179b
mov eax, dword [esp + 0xc000]
add esp, 0xfffff988
mov esi, edx
mov edi, 0x412064
mov dword [esp + 4], ecx
mov dword [esp], eax
test esi, esi
je 0x4021c4
jmp case.0x401818.10
lea eax, [esp + 0x1024]
xor ebx, ebx
mov edx, ebx
shl edx, 0xc
lea ecx, [esp + 0x2024]
add edx, ecx
call fcn.004028a8
inc ebx
cmp ebx, 6
jl 0x4017d6
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 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 + 0x8024]
push eax
push 0x400
call sub.KERNEL32.DLL_GetCurrentDirectoryA
lea edx, [esp + 0x8024]
lea eax, [esp + 0x8424]
call fcn.0040d908
lea eax, [esp + 0x8424]
call fcn.0040279c
lea edx, [esp + 0x1024]
lea eax, [esp + 0x8424]
call fcn.0040d9dc
lea eax, [esp + 0x8824]
call fcn.00404ff8
lea edx, [esp + 0x8424]
lea eax, [esp + 0x8824]
call fcn.0040504c
jmp 0x401a2b
push 0
lea edx, [esp + 0x9430]
push edx
call sub.KERNEL32.DLL_SetFileAttributesA
cmp dword [esp + 0xa03c], 0
je 0x4019a0
call fcn.00404e60
cmp eax, 4
je 0x4019a0
lea edx, [esp + 0xa05c]
lea eax, [esp + 0x8024]
call fcn.00405b84
lea eax, [esp + 0xa05c]
call fcn.0040279c
lea eax, [esp + 0x8024]
call fcn.0040d888
mov ebx, eax
cmp ebx, 4
jl 0x401933
lea eax, [esp + 0xa05c]
call fcn.0040d888
cmp eax, ebx
jb 0x401949
lea eax, [esp + 0x1024]
xor edx, edx
call fcn.00405834
test al, al
jne 0x401a48
lea eax, [esp + 0x942c]
call fcn.0040d888
mov byte [esp + eax + 0x942d], 0
lea eax, [esp + 0xa45c]
mov ecx, 0x1e
xor edx, edx
call fcn.0040d808
mov dword [esp + 0xa460], 3
mov word [esp + 0xa46c], 0x14
lea eax, [esp + 0x942c]
mov dword [esp + 0xa464], eax
lea edx, [esp + 0xa45c]
push edx
call sub.SHELL32.DLL_SHFileOperationA
lea ecx, [esp + 0x942c]
push ecx
call sub.KERNEL32.DLL_GetFileAttributesA
cmp eax, 0xffffffff
je 0x401a2b
lea eax, [esp + 0x942c]
push eax
call sub.KERNEL32.DLL_DeleteFileA
test eax, eax
jne 0x401a2b
xor ebx, ebx
push ebx
lea eax, [esp + 0x9430]
push eax
push str._s._d.tmp
lea edx, [esp + 0xa488]
push edx
call sub.USER32.DLL_wsprintfA
add esp, 0x10
lea ecx, [esp + 0xa47c]
push ecx
call sub.KERNEL32.DLL_GetFileAttributesA
cmp eax, 0xffffffff
je 0x4019f8
inc ebx
jmp 0x4019c5
lea eax, [esp + 0xa47c]
push eax
lea edx, [esp + 0x9430]
push edx
call sub.KERNEL32.DLL_MoveFileA
test eax, eax
je 0x401a2b
call fcn.00404e60
test eax, eax
je 0x401a2b
push 4
push 0
lea ecx, [esp + 0xa484]
push ecx
call sub.KERNEL32.DLL_MoveFileExA
lea edx, [esp + 0x942c]
lea eax, [esp + 0x8824]
xor ecx, ecx
call fcn.00405084
test al, al
jne 0x4018c6
lea eax, [esp + 0x8824]
mov edx, 2
call fcn.0040501c
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 0x401a84
mov edx, 0x41218c
call fcn.0040d9dc
cmp byte [esp + 8], 0
je 0x401a94
lea ebp, [esp + 0x1024]
jmp 0x401a9d
mov eax, esi
call fcn.00402563
mov ebp, eax
test bl, bl
je 0x401aa5
xor eax, eax
jmp 0x401aaf
mov eax, dword [0x41204c]
call fcn.0040d888
mov dword [esp + 0xc], eax
mov eax, ebp
call fcn.0040d888
mov edx, eax
mov eax, dword [0x41204c]
add edx, dword [esp + 0xc]
add edx, 5
call fcn.0040d7a4
mov dword [0x41204c], eax
test bl, bl
je 0x401adf
mov edx, dword [0x41204c]
mov byte [edx], 0
mov edx, ebp
mov eax, dword [0x41204c]
call fcn.0040d9dc
cmp byte [esp + 8], 0
jne case.0x401818.10
mov eax, ebp
call fcn.0040d78c
jmp case.0x401818.10
cmp dword [esp + 4], 0
jne case.0x401818.10
lea edx, [esp + 0x1024]
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 + 0xa87c], 0
xor ecx, ecx
mov cl, byte [esp + 0x1024]
cmp ecx, 0x2e
jne 0x401b6a
xor eax, eax
mov al, byte [esp + 0x1025]
cmp eax, 0x5c
jne 0x401b6a
lea edx, [esp + 0x1026]
lea eax, [esp + 0xa87c]
call fcn.0040d908
jmp 0x401c3f
xor edx, edx
mov dl, byte [esp + 0x1024]
cmp edx, 0x5c
je 0x401b90
cmp byte [esp + 0x1024], 0
je 0x401ba8
xor ecx, ecx
mov cl, byte [esp + 0x1025]
cmp ecx, 0x3a
jne 0x401ba8
lea edx, [esp + 0x1024]
lea eax, [esp + 0xa87c]
call fcn.0040d908
jmp 0x401c3f
lea ecx, [esp + 0x10]
push ecx
push 1
push 0
push str.SoftwareMicrosoftWindowsCurrentVersion
push 0x80000002
call sub.ADVAPI32.DLL_RegOpenKeyExA
test eax, eax
jne 0x401bf7
mov dword [esp + 0x18], 0x400
lea eax, [esp + 0x18]
push eax
lea edx, [esp + 0xa880]
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 + 0xa87c], 0
je 0x401c2c
lea eax, [esp + 0xa87c]
call fcn.0040d888
xor edx, edx
mov dl, byte [esp + eax + 0xa87b]
cmp edx, 0x5c
je 0x401c2c
mov edx, 0x412098
lea eax, [esp + 0xa87c]
call fcn.0040d9dc
lea edx, [esp + 0x1024]
lea eax, [esp + 0xa87c]
call fcn.0040d9dc
lea edx, [esp + 0xa87c]
mov eax, 0x4138c8
call fcn.0040d908
lea eax, [esp + 0xa87c]
call fcn.00402696
push 0x65
push dword [esp + 4]
call sub.USER32.DLL_GetDlgItem
mov ebx, eax
lea eax, [esp + 0xa87c]
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 + 0xa87c]
mov eax, 0x4138c8
call fcn.0040d934
test eax, eax
je case.0x401818.10
lea edx, [esp + 0xa87c]
push edx
push 0
push 0x143
push ebx
call sub.USER32.DLL_SendMessageA
jmp case.0x401818.10
xor eax, eax
mov al, byte [esp + 0x1024]
call fcn.0040da20
test eax, eax
je 0x401ce5
xor edx, edx
mov dl, byte [esp + 0x1024]
add edx, 0xffffffd0
mov dword [0x412058], edx
jmp case.0x401818.10
mov dword [0x412058], 2
jmp case.0x401818.10
mov cl, byte [esp + 0x1024]
sub cl, 1
jb 0x401d26
sub cl, 0x2f
je 0x401d12
dec cl
je 0x401d26
dec cl
je 0x401d3d
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 + 0x1024]
xor edx, edx
call fcn.0040229c
jmp case.0x401818.10
cmp dword [esp + 4], 1
jne case.0x401818.10
lea ecx, [esp + 0xac7c]
push ecx
push 0x400
call sub.KERNEL32.DLL_GetTempPathA
lea eax, [esp + 0xac7c]
call fcn.0040279c
xor ebx, ebx
push ebx
lea eax, [esp + 0xac80]
push eax
push str._sRarSFX_d
lea edx, [esp + 0xb088]
push edx
call sub.USER32.DLL_wsprintfA
add esp, 0x10
lea ecx, [esp + 0xb07c]
push ecx
call sub.KERNEL32.DLL_GetFileAttributesA
cmp eax, 0xffffffff
je 0x401dcf
inc ebx
jmp 0x401d9c
lea eax, [esp + 0xb07c]
push eax
push 0x65
push dword [esp + 8]
call sub.USER32.DLL_SetDlgItemTextA
cmp byte [esp + 0x1024], 0
je 0x401e96
mov byte [esp + 0xb47c], 0
xor ebx, ebx
jmp 0x401e26
and eax, 0xff
cmp eax, 0x40
jne 0x401e25
lea edx, [esp + 0x1025]
lea eax, [esp + 0xb47c]
add edx, ebx
call fcn.0040d908
mov byte [esp + ebx + 0x1024], 0
jmp 0x401e31
inc ebx
mov al, byte [esp + ebx + 0x1024]
test al, al
jne 0x401dfc
cmp byte [esp + 0xb47c], 0
jne 0x401e61
lea edx, [esp + 0x2024]
lea eax, [esp + 0x1024]
call fcn.0040d908
lea edx, [esp + 0x3024]
lea eax, [esp + 0xb47c]
call fcn.0040d908
push 0x24
lea edx, [esp + 0xb480]
push edx
lea ecx, [esp + 0x102c]
push ecx
push dword [esp + 0xc]
call sub.USER32.DLL_MessageBoxA
cmp eax, 6
je 0x401e96
mov dword [0x412818], 1
push 1
push dword [esp + 4]
call sub.USER32.DLL_EndDialog
cmp dword [0x412058], 0
jne 0x401ea9
mov dword [0x412058], 2
mov byte [0x412045], 1
jmp case.0x401818.10
cmp dword [esp + 4], 3
jne case.0x401818.10
cmp byte [esp + 0x1024], 0
je 0x401edb
lea eax, [esp + 0x1024]
push eax
push dword [esp + 4]
call sub.USER32.DLL_SetWindowTextA
mov eax, esi
call fcn.00402563
mov dword [0x412050], eax
jmp case.0x401818.10
cmp dword [esp + 4], 5
jne case.0x401818.10
lea eax, [esp + 0x1024]
mov dl, 1
call fcn.0040229c
jmp case.0x401818.10
cmp dword [esp + 4], 6
jne case.0x401818.10
lea ecx, [esp + 0x2024]
xor eax, eax
mov al, byte [ecx]
call fcn.0040d7cc
sub eax, 0x50
je 0x401f48
sub eax, 3
je 0x401f34
dec eax
je 0x401f3e
jmp 0x401f52
mov dword [esp + 0x1c], 0xb
jmp 0x401f5a
mov dword [esp + 0x1c], 7
jmp 0x401f5a
mov dword [esp + 0x1c], 2
jmp 0x401f5a
mov dword [esp + 0x1c], 0x10
mov byte [esp + 0xc27c], 0
lea edx, [esp + 0x3024]
lea eax, [esp + 0xb67c]
call fcn.0040d908
xor edx, edx
mov dl, byte [esp + 0xb67c]
cmp edx, 0x22
jne 0x401fe8
lea edx, [esp + 0x3024]
lea eax, [esp + 0xb67c]
inc edx
call fcn.0040d908
cmp byte [0x418144], 0
je 0x401fb8
lea edx, [esp + 0xb67d]
mov eax, 0x418044
mov ecx, 0x22
call fcn.0040e100
jmp 0x401fc9
lea eax, [esp + 0xb67d]
mov edx, 0x22
call fcn.0040d898
test eax, eax
je 0x402098
mov byte [eax], 0
lea edx, [eax + 1]
lea eax, [esp + 0xc27c]
call fcn.0040d908
jmp 0x402098
lea eax, [esp + 0xb67c]
xor edx, edx
call fcn.00405e88
test al, al
jne 0x402098
xor ecx, ecx
mov dword [esp + 0x20], ecx
lea ebp, [esp + 0xb67c]
jmp 0x402084
mov dl, byte [ebp]
xor eax, eax
mov al, dl
cmp eax, 0x20
je 0x40201e
cmp eax, 0x2f
jne 0x402083
mov ebx, edx
xor edx, edx
mov byte [ebp], 0
lea eax, [esp + 0xb67c]
call fcn.00405e88
test al, al
je 0x402080
mov dword [esp + 0x20], ebp
xor ecx, ecx
mov cl, bl
cmp ecx, 0x2f
jne 0x40205c
mov byte [esp + 0xc27c], 0x2f
lea edx, [ebp + 1]
lea eax, [esp + 0xc27d]
call fcn.0040d908
jmp 0x402078
inc ebp
jmp 0x402060
inc ebp
xor ecx, ecx
mov cl, byte [ebp]
cmp ecx, 0x20
je 0x40205f
lea eax, [esp + 0xc27c]
mov edx, ebp
call fcn.0040d908
mov ecx, dword [esp + 0x20]
mov byte [ecx], bl
jmp 0x402083
mov byte [ebp], bl
inc ebp
cmp byte [ebp], 0
jne 0x40200d
cmp dword [esp + 0x20], 0
je 0x402098
mov eax, dword [esp + 0x20]
mov byte [eax], 0
lea edx, [esp + 0xba7c]
lea eax, [esp + 0xb67c]
call fcn.00405f28
lea eax, [esp + 0xbe7c]
mov edx, dword [esp + 0x1c]
call fcn.00402a78
lea eax, [esp + 0xbe7c]
call fcn.0040279c
lea edx, [esp + 0x4024]
cmp byte [edx], 0
je 0x4020f2
lea edx, [esp + 0x4024]
lea eax, [esp + 0xbe7c]
call fcn.0040d9dc
lea eax, [esp + 0xbe7c]
call fcn.0040279c
lea edx, [esp + 0x6024]
cmp byte [edx], 0
je 0x402107
lea eax, [esp + 0x6024]
jmp 0x40210e
lea eax, [esp + 0x3024]
call fcn.00402778
mov edx, eax
lea eax, [esp + 0xbe7c]
call fcn.0040d9dc
mov edx, 0x4121d6
lea eax, [esp + 0xbe7c]
call fcn.0040578c
lea eax, [esp + 0xbe7c]
mov cl, 1
xor edx, edx
call fcn.00405d24
lea eax, [esp + 0x7024]
cmp byte [eax], 0
je 0x402157
lea edx, [esp + 0x7024]
jmp 0x402159
xor edx, edx
push edx
cmp byte [esp + 0xc280], 0
je 0x40216d
lea eax, [esp + 0xc280]
jmp 0x40216f
xor eax, eax
push eax
lea edx, [esp + 0x502c]
cmp byte [edx], 0
je 0x402185
lea ecx, [esp + 0x502c]
jmp 0x402187
xor ecx, ecx
lea edx, [esp + 0xbe84]
lea eax, [esp + 0xba84]
call fcn.00402968
jmp case.0x401818.10
mov byte [0x41205c], 1
lea eax, [esp + 8]
push eax
lea ecx, [esp + 0x1028]
lea edx, [esp + 0x28]
mov eax, esi
call fcn.004021cf
mov esi, eax
test eax, eax
jne 0x4017cd
add esp, 0xc67c
pop ebp
pop edi
pop esi
pop ebx
ret