Function at 0x4016e0
Capabilities:
Check if file exists
Print debug messages

Disassembly:
push 0xffffffffffffffff
push 0x417c2d
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0xc08
push ebx
push ebp
push esi
push edi
mov dword [esp + 0xc20], 0
mov edx, dword [esp + 0xc28]
push 0
lea eax, [esp + 0x81c]
push 0x400
lea ecx, [esp + 0x24]
push eax
push ecx
push edx
call dword [sym.imp.SETUPAPI.dll_SetupDiGetINFClassA]
test eax, eax
jne 0x401776
mov eax, dword [0x41f710]
mov dword [esp + 0x10], eax
mov byte [esp + 0xc20], 2
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
lea ecx, [esp + 0x14]
push str.SetupDiGetINFClass_failed_error_code___d_n
push ecx
call fcn.0040f8a3
mov edx, dword [esp + 0x1c]
add esp, 0xc
push edx
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
mov byte [esp + 0xc20], 1
lea ecx, [esp + 0x10]
jmp 0x401ad8
lea eax, [esp + 0x1c]
push 0
push eax
call dword [sym.imp.SETUPAPI.dll_SetupDiCreateDeviceInfoList]
mov ebp, eax
cmp ebp, 0xffffffff
jne 0x4017d1
mov ecx, dword [0x41f710]
mov dword [esp + 0x10], ecx
mov byte [esp + 0xc20], 3
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
lea edx, [esp + 0x14]
push str.SetupDiCreateDeviceInfoList_failed_error_code___d_n
push edx
call fcn.0040f8a3
mov eax, dword [esp + 0x1c]
add esp, 0xc
push eax
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
mov byte [esp + 0xc20], 1
lea ecx, [esp + 0x10]
jmp 0x401ad8
lea ecx, [esp + 0x2c]
lea edx, [esp + 0x1c]
push ecx
push 1
push 0
push 0
lea eax, [esp + 0x828]
push edx
push eax
push ebp
mov dword [esp + 0x48], 0x1c
call dword [sym.imp.SETUPAPI.dll_SetupDiCreateDeviceInfoA]
mov ebx, dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jne 0x4018aa
mov ecx, dword [0x41f710]
mov dword [esp + 0x10], ecx
mov byte [esp + 0xc20], 4
call ebx
push eax
lea edx, [esp + 0x14]
push str.SetupDiCreateDeviceInfo_failed_error_code___d_n
push edx
call fcn.0040f8a3
mov eax, dword [esp + 0x1c]
add esp, 0xc
push eax
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
mov byte [esp + 0xc20], 1
lea ecx, [esp + 0x10]
call fcn.0041055d
call ebx
push ebp
mov esi, eax
call dword [sym.imp.SETUPAPI.dll_SetupDiDestroyDeviceInfoList]
push esi
call dword [sym.imp.KERNEL32.dll_SetLastError]
xor edx, edx
lea ecx, [esp + 0xc28]
test esi, esi
sete dl
mov esi, edx
mov byte [esp + 0xc20], 0
call fcn.0041055d
lea ecx, [esp + 0xc2c]
mov dword [esp + 0xc20], 0xffffffff
call fcn.0041055d
mov eax, esi
mov ecx, dword [esp + 0xc18]
pop edi
pop esi
pop ebp
pop ebx
mov dword fs:[0], ecx
add esp, 0xc14
ret
mov ecx, 0x1f4
xor eax, eax
lea edi, [esp + 0x48]
lea edx, [esp + 0x48]
rep stosd dword es:[edi], eax
mov edi, dword [esp + 0xc2c]
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov eax, ecx
mov esi, edi
mov edi, edx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
lea ecx, [esp + 0x48]
push ecx
call dword [sym.imp.KERNEL32.dll_lstrlenA]
add eax, 2
lea edx, [esp + 0x48]
push eax
push edx
lea eax, [esp + 0x34]
push 1
push eax
push ebp
call dword [sym.imp.SETUPAPI.dll_SetupDiSetDeviceRegistryPropertyA]
test eax, eax
jne 0x401946
mov ecx, dword [0x41f710]
mov dword [esp + 0x10], ecx
mov byte [esp + 0xc20], 5
call ebx
push eax
lea edx, [esp + 0x14]
push str.SetupDiSetDeviceRegistryProperty_failed_error_code___d_n
push edx
call fcn.0040f8a3
mov eax, dword [esp + 0x1c]
add esp, 0xc
push eax
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
mov byte [esp + 0xc20], 1
lea ecx, [esp + 0x10]
jmp 0x401844
mov edi, dword [sym.imp.SETUPAPI.dll_SetupDiCallClassInstaller]
lea ecx, [esp + 0x2c]
push ecx
push ebp
push 0x19
call edi
test eax, eax
jne 0x40199d
mov edx, dword [0x41f710]
mov dword [esp + 0x10], edx
mov byte [esp + 0xc20], 6
call ebx
push eax
lea eax, [esp + 0x14]
push str.SetupDiCallClassInstaller_failed_error_code___d_n
push eax
call fcn.0040f8a3
mov ecx, dword [esp + 0x1c]
add esp, 0xc
push ecx
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
mov byte [esp + 0xc20], 1
lea ecx, [esp + 0x10]
jmp 0x401844
mov edx, dword [esp + 0xc30]
mov eax, dword [esp + 0xc28]
mov ecx, dword [esp + 0xc2c]
push edx
push 1
push eax
push ecx
push 0
call sub.newdev.dll_UpdateDriverForPlugAndPlayDevicesA
test eax, eax
jne 0x401849
mov ebx, dword [sym.imp.KERNEL32.dll_GetLastError]
call ebx
mov edx, dword [0x41f710]
mov dword [esp + 0x14], edx
cmp eax, 2
mov byte [esp + 0xc20], 7
jne 0x4019f9
push str.UpdateDriverForPlugAndPlayDevices_failed_error_code__ERROR_FILE_NOT_FOUND_n
lea eax, [esp + 0x18]
push eax
call fcn.0040f8a3
add esp, 8
jmp 0x401a6b
cmp eax, 0xe0000235
jne 0x401a14
lea ecx, [esp + 0x14]
push str.UpdateDriverForPlugAndPlayDevices_failed_error_code__ERROR_IN_WOW64_n
push ecx
call fcn.0040f8a3
add esp, 8
jmp 0x401a6b
cmp eax, 0x3ec
jne 0x401a2f
lea edx, [esp + 0x14]
push str.UpdateDriverForPlugAndPlayDevices_failed_error_code__ERROR_INVALID_FLAGS_n
push edx
call fcn.0040f8a3
add esp, 8
jmp 0x401a6b
cmp eax, 0xe000020b
jne 0x401a3d
push str.UpdateDriverForPlugAndPlayDevices_failed_error_code__ERROR_NO_SUCH_DEVINST_n
jmp 0x4019ea
cmp eax, 0x103
jne 0x401a58
lea ecx, [esp + 0x14]
push str.UpdateDriverForPlugAndPlayDevices_failed_error_code__ERROR_NO_MORE_ITEMS_n
push ecx
call fcn.0040f8a3
add esp, 8
jmp 0x401a6b
push eax
lea edx, [esp + 0x18]
push str.UpdateDriverForPlugAndPlayDevices_failed_error_code___u_n
push edx
call fcn.0040f8a3
add esp, 0xc
mov eax, dword [esp + 0x14]
mov esi, dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
push eax
call esi
lea ecx, [esp + 0x2c]
push ecx
push ebp
push 5
call edi
test eax, eax
jne 0x401ac5
mov edx, dword [0x41f710]
mov dword [esp + 0x18], edx
mov byte [esp + 0xc20], 8
call ebx
push eax
lea eax, [esp + 0x1c]
push str.SetupDiCallClassInstaller_DIF_REMOVE_failed_error_code___u_n
push eax
call fcn.0040f8a3
mov ecx, dword [esp + 0x24]
add esp, 0xc
push ecx
call esi
lea ecx, [esp + 0x18]
mov byte [esp + 0xc20], 7
call fcn.0041055d
push ebp
call dword [sym.imp.SETUPAPI.dll_SetupDiDestroyDeviceInfoList]
mov byte [esp + 0xc20], 1
lea ecx, [esp + 0x14]
call fcn.0041055d
lea ecx, [esp + 0xc28]
mov byte [esp + 0xc20], 0
call fcn.0041055d
lea ecx, [esp + 0xc2c]
mov dword [esp + 0xc20], 0xffffffff
call fcn.0041055d
xor eax, eax
jmp 0x401891