Function at 0x404790
Capabilities:
Check if file exists
Delete file
Get common file path
Move file
Set file attributes

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0xd94
mov eax, dword [0x43f194]
push ebx
push esi
push edi
mov ebx, ecx
xor esi, esi
push str.ready_to_delete_scanner_files_r_n
mov ecx, 0x442370
mov dword [esp + 0xda0], eax
mov dword [esp + 0x18], ebx
mov dword [esp + 0x14], esi
mov dword [esp + 0x2c], esi
mov dword [esp + 0x20], 0x2c
call fcn.00402000
lea eax, [esp + 0x678]
push eax
push 0x104
call dword [sym.imp.KERNEL32.dll_GetCurrentDirectoryW]
lea ecx, [esp + 0x678]
push ecx
call fcn.0041156a
add esp, 4
cmp word [esp + eax*2 + 0x676], 0x5c
je 0x404815
lea edx, [esp + 0x678]
push 0x4301a0
push edx
call fcn.004115bd
add esp, 8
lea eax, [esp + 0x678]
push 0x440ce8
push eax
call fcn.004115bd
add esp, 8
push esi
push 2
push esi
lea ecx, [esp + 0x684]
push ecx
call dword [sym.imp.SETUPAPI.dll_SetupOpenInfFileW]
mov esi, eax
cmp esi, 0xffffffff
mov dword [esp + 0x18], esi
jne 0x4048c5
push 0x320
call fcn.00420e21
push 0x320
mov esi, eax
call fcn.00420e21
add esp, 8
push str.failed_to_open_scanner_inf_file..uninstall_will_abort_r_n
mov ecx, 0x442370
mov edi, eax
call fcn.00402000
mov edx, dword [0x4404c4]
mov ebx, dword [sym.imp.USER32.dll_LoadStringW]
push 0x190
push esi
push 0x13f1
push edx
call ebx
push esi
push edi
call fcn.004115e7
mov eax, dword [0x4404c4]
add esp, 8
push 0x190
push esi
push 0x13fd
push eax
call ebx
push esi
push edi
call fcn.004115bd
add esp, 8
push 0x43869c
lea ecx, [esp + 0x18]
push ecx
mov dword [esp + 0x1c], edi
call fcn.0041229d
lea edx, [esp + 0x50]
push edx
push str.CopyFiles
push 0x440060
push esi
call dword [sym.imp.SETUPAPI.dll_SetupFindFirstLineW]
lea eax, [esp + 0x50]
push eax
call dword [sym.imp.SETUPAPI.dll_SetupGetFieldCount]
mov ecx, 1
cmp eax, ecx
mov dword [esp + 0x2c], eax
mov dword [esp + 0x24], ecx
jb 0x404c32
jmp 0x404900
push 0
push 0x104
lea edx, [esp + 0x478]
push edx
push ecx
lea eax, [esp + 0x60]
push eax
call dword [sym.imp.SETUPAPI.dll_SetupGetStringFieldW]
lea ecx, [esp + 0x470]
push 0x4309f4
push ecx
call fcn.00411f9f
add esp, 8
test eax, eax
jne 0x404c19
lea edx, [esp + 0x470]
push str.Support
push edx
call fcn.00411f9f
add esp, 8
test eax, eax
jne 0x404c19
lea eax, [esp + 0x470]
push eax
push esi
call dword [sym.imp.SETUPAPI.dll_SetupGetLineCountW]
mov ebx, eax
test ebx, ebx
jle 0x404c19
xor eax, eax
mov ecx, 0x41
lea edi, [esp + 0x268]
rep stosd dword es:[edi], eax
mov edi, dword [sym.imp.SETUPAPI.dll_SetupFindFirstLineW]
lea ecx, [esp + 0x30]
push ecx
lea edx, [esp + 0x474]
push edx
push str.DestinationDirs
push esi
call edi
test eax, eax
lea ecx, [esp + 0x30]
je 0x4049c8
lea eax, [esp + 0x20]
push eax
push 1
push ecx
call dword [sym.imp.SETUPAPI.dll_SetupGetIntField]
push 0
push 0x104
lea edx, [esp + 0x990]
push edx
lea eax, [esp + 0x47c]
push eax
jmp 0x404a00
push ecx
push str.DefaultDestDir
push str.DestinationDirs
push esi
call edi
test eax, eax
je 0x404a1c
lea edx, [esp + 0x20]
push edx
push 1
lea eax, [esp + 0x38]
push eax
call dword [sym.imp.SETUPAPI.dll_SetupGetIntField]
push 0
push 0x104
lea ecx, [esp + 0x990]
push ecx
push str.DefaultDestDir
push str.DestinationDirs
push esi
push 0
call dword [sym.imp.SETUPAPI.dll_SetupGetLineTextW]
test eax, eax
jne 0x404a1c
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [esp + 0x10], eax
mov eax, dword [esp + 0x20]
sub eax, 0xa
je 0x404a87
dec eax
je 0x404a75
sub eax, 0x101c5
je 0x404a41
push 0x104
lea edx, [esp + 0x64]
push edx
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryW]
jmp 0x404a97
lea eax, [esp + 0x28]
push eax
push 0x104
lea ecx, [esp + 0x888]
push ecx
push 1
push 0
push 0
call sub.WINSPOOL.DRV_GetPrinterDriverDirectoryW
lea edx, [esp + 0x880]
push edx
lea eax, [esp + 0x64]
push eax
call fcn.004115e7
add esp, 8
jmp 0x404a97
push 0x104
lea ecx, [esp + 0x64]
push ecx
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryW]
jmp 0x404a97
push 0x104
lea edx, [esp + 0x64]
push edx
call dword [sym.imp.KERNEL32.dll_GetWindowsDirectoryW]
lea eax, [esp + 0x1c]
push eax
lea ecx, [esp + 0x98c]
push ecx
call fcn.00411c72
lea edx, [esp + 0x24]
push edx
push 0
call fcn.00411c72
mov esi, eax
add esp, 0x10
test esi, esi
je 0x404aee
lea eax, [esp + 0x60]
push 0x4301a0
push eax
call fcn.004115bd
lea ecx, [esp + 0x68]
push esi
push ecx
call fcn.004115bd
mov ecx, dword [esp + 0x24]
add esp, 0x10
lea edx, [esp + 0x60]
push edx
call fcn.004033f0
jmp 0x404c15
mov edx, dword [esp + 0x18]
lea eax, [esp + 0x40]
push eax
push 0
lea ecx, [esp + 0x478]
push ecx
push edx
call dword [sym.imp.SETUPAPI.dll_SetupFindFirstLineW]
test ebx, ebx
jle 0x404c15
push 0
push 0x104
lea eax, [esp + 0xb98]
push eax
push 1
lea ecx, [esp + 0x50]
push ecx
call dword [sym.imp.SETUPAPI.dll_SetupGetStringFieldW]
xor eax, eax
mov ecx, 0x41
lea edi, [esp + 0x268]
lea edx, [esp + 0x60]
rep stosd dword es:[edi], eax
push edx
lea eax, [esp + 0x26c]
push eax
call fcn.004115e7
lea ecx, [esp + 0x270]
push 0x4301a0
push ecx
call fcn.004115bd
lea edx, [esp + 0xba0]
push edx
lea eax, [esp + 0x27c]
push eax
call fcn.004115bd
add esp, 0x18
lea ecx, [esp + 0xb90]
push ecx
mov ecx, 0x442370
call fcn.00402000
push 0x80
lea edx, [esp + 0x26c]
push edx
call dword [sym.imp.KERNEL32.dll_SetFileAttributesW]
lea eax, [esp + 0x268]
push eax
call dword [sym.imp.KERNEL32.dll_DeleteFileW]
test eax, eax
jne 0x404bf1
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 2
mov dword [esp + 0x10], eax
je 0x404bea
cmp eax, 3
je 0x404bea
push 4
push 0
lea ecx, [esp + 0x270]
push ecx
call dword [sym.imp.KERNEL32.dll_MoveFileExW]
test eax, eax
mov dword [0x442358], 1
jne 0x404c00
push str._:_failed_to_delete_file_r_n
jmp 0x404bf6
push str._:_file_not_found_r_n
jmp 0x404bf6
push str._:_file_deleted_r_n
mov ecx, 0x442370
call fcn.00402000
lea edx, [esp + 0x40]
push edx
mov eax, edx
push eax
call dword [sym.imp.SETUPAPI.dll_SetupFindNextLine]
dec ebx
jne 0x404b10
mov esi, dword [esp + 0x18]
mov ecx, dword [esp + 0x24]
mov eax, dword [esp + 0x2c]
inc ecx
cmp ecx, eax
mov dword [esp + 0x24], ecx
jbe 0x404900
mov ebx, dword [esp + 0x14]
xor eax, eax
mov ecx, 0x41
lea edi, [esp + 0x60]
rep stosd dword es:[edi], eax
lea ecx, [esp + 0x60]
push 0x441300
push ecx
call fcn.004115e7
lea edx, [esp + 0x68]
push str.HPScan_To
push edx
call fcn.004115bd
add esp, 0x10
lea eax, [esp + 0x60]
push eax
mov ecx, ebx
call fcn.004033f0
push str.SOFTWAREHewlett_Packardhp_LaserJet_Scan
push SysReAllocStringLen
mov ecx, ebx
call fcn.00402e50
mov ecx, dword [esp + 0xd9c]
mov eax, dword [esp + 0x10]
call fcn.00411bef
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret