Function at 0x404140
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, 0xe74
mov eax, dword [0x43f194]
push ebx
push esi
push edi
mov dword [esp + 0xe7c], eax
push 0x104
lea eax, [esp + 0x65c]
push eax
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryW]
lea ecx, [esp + 0x658]
push ecx
call fcn.0041156a
mov esi, 0x5c
add esp, 4
cmp word [esp + eax*2 + 0x656], si
je 0x4041a2
lea edx, [esp + 0x658]
push 0x4301a0
push edx
call fcn.004115bd
add esp, 8
lea eax, [esp + 0xc70]
push eax
call fcn.00402850
add esp, 4
lea ecx, [esp + 0x450]
push ecx
push 0x104
call dword [sym.imp.KERNEL32.dll_GetCurrentDirectoryW]
lea edx, [esp + 0x450]
push edx
call fcn.0041156a
add esp, 4
cmp word [esp + eax*2 + 0x44e], si
je 0x4041f4
lea eax, [esp + 0x450]
push 0x4301a0
push eax
call fcn.004115bd
add esp, 8
lea ecx, [esp + 0x450]
push 0x440ae0
push ecx
call fcn.004115bd
add esp, 8
push 0
push 2
push 0
lea edx, [esp + 0x45c]
push edx
call dword [sym.imp.SETUPAPI.dll_SetupOpenInfFileW]
mov edi, eax
cmp edi, 0xffffffff
mov dword [esp + 0x18], edi
jne 0x4042a6
push 0x320
call fcn.00420e21
push 0x320
mov esi, eax
call fcn.00420e21
add esp, 8
push str.failed_to_open_printer_inf_file..uninstall_will_abort_r_n
mov ecx, 0x442370
mov edi, eax
call fcn.00402000
mov eax, dword [0x4404c4]
mov ebx, dword [sym.imp.USER32.dll_LoadStringW]
push 0x190
push esi
push 0x13f1
push eax
call ebx
push esi
push edi
call fcn.004115e7
mov ecx, dword [0x4404c4]
add esp, 8
push 0x190
push esi
push 0x13fd
push ecx
call ebx
push esi
push edi
call fcn.004115bd
add esp, 8
push 0x43869c
lea edx, [esp + 0x14]
push edx
mov dword [esp + 0x18], edi
call fcn.0041229d
lea eax, [esp + 0x30]
push eax
push str.CopyFiles
push 0x4406d0
push edi
call dword [sym.imp.SETUPAPI.dll_SetupFindFirstLineW]
lea ecx, [esp + 0x30]
push ecx
call dword [sym.imp.SETUPAPI.dll_SetupGetFieldCount]
cmp eax, 1
mov dword [esp + 0x1c], eax
mov dword [esp + 0x14], 1
jb 0x40450a
mov ebx, dword [sym.imp.KERNEL32.dll_SetFileAttributesW]
mov eax, dword [esp + 0x14]
push 0
push 0x104
lea edx, [esp + 0xa70]
push edx
push eax
lea ecx, [esp + 0x40]
push ecx
call dword [sym.imp.SETUPAPI.dll_SetupGetStringFieldW]
lea edx, [esp + 0xa68]
push edx
push edi
call dword [sym.imp.SETUPAPI.dll_SetupGetLineCountW]
mov esi, eax
test esi, esi
jle 0x4044f5
lea eax, [esp + 0x20]
push eax
push 0
lea ecx, [esp + 0xa70]
push ecx
push edi
call dword [sym.imp.SETUPAPI.dll_SetupFindFirstLineW]
test esi, esi
jle 0x4044f5
mov dword [esp + 0x10], esi
lea esp, [esp]
push 0
push 0x104
lea edx, [esp + 0x868]
push edx
push 1
lea eax, [esp + 0x30]
push eax
call dword [sym.imp.SETUPAPI.dll_SetupGetStringFieldW]
xor eax, eax
mov ecx, 0x41
lea edi, [esp + 0x40]
rep stosd dword es:[edi], eax
lea ecx, [esp + 0xc70]
push ecx
lea edx, [esp + 0x44]
push edx
call fcn.004115e7
lea eax, [esp + 0x868]
push eax
lea ecx, [esp + 0x4c]
push ecx
call fcn.004115bd
add esp, 0x10
lea edx, [esp + 0x40]
push edx
mov ecx, 0x442370
call fcn.00402000
push 0x430218
mov ecx, 0x442370
call fcn.00402000
push 0x80
lea eax, [esp + 0x44]
push eax
call ebx
mov esi, dword [sym.imp.KERNEL32.dll_DeleteFileW]
lea ecx, [esp + 0x40]
push ecx
call esi
test eax, eax
jne 0x404404
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 2
je 0x404413
cmp eax, 3
je 0x404413
push 4
push 0
lea edx, [esp + 0x48]
push edx
call dword [sym.imp.KERNEL32.dll_MoveFileExW]
test eax, eax
mov dword [0x442358], 1
mov ecx, 0x442370
jne 0x404409
push str._:_failed_to_delete_file_r_n
jmp 0x40440e
mov ecx, 0x442370
push str._:_File_deleted_r_n
call fcn.00402000
xor eax, eax
mov ecx, 0x41
lea edi, [esp + 0x248]
rep stosd dword es:[edi], eax
lea eax, [esp + 0x658]
push eax
lea ecx, [esp + 0x24c]
push ecx
call fcn.004115e7
lea edx, [esp + 0x868]
push edx
lea eax, [esp + 0x254]
push eax
call fcn.004115bd
add esp, 0x10
lea ecx, [esp + 0x248]
push ecx
mov ecx, 0x442370
call fcn.00402000
push 0x430218
mov ecx, 0x442370
call fcn.00402000
push 0x80
lea edx, [esp + 0x24c]
push edx
call ebx
lea eax, [esp + 0x248]
push eax
call esi
test eax, eax
jne 0x4044ca
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 2
je 0x4044d9
cmp eax, 3
je 0x4044d9
push 4
push 0
lea ecx, [esp + 0x250]
push ecx
call dword [sym.imp.KERNEL32.dll_MoveFileExW]
test eax, eax
mov dword [0x442358], 1
mov ecx, 0x442370
jne 0x4044cf
push str._:_failed_to_delete_file_r_n
jmp 0x4044d4
mov ecx, 0x442370
push str._:_File_deleted_r_n
call fcn.00402000
lea edx, [esp + 0x20]
push edx
mov eax, edx
push eax
call dword [sym.imp.SETUPAPI.dll_SetupFindNextLine]
dec dword [esp + 0x10]
jne 0x404340
mov edi, dword [esp + 0x18]
mov eax, dword [esp + 0x14]
mov ecx, dword [esp + 0x1c]
inc eax
cmp eax, ecx
mov dword [esp + 0x14], eax
jbe 0x4042e2
mov ecx, dword [esp + 0xe7c]
mov eax, 1
call fcn.00411bef
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret