Function at 0x406180
Capabilities:
Get common file path

Disassembly:
sub esp, 0x630
mov al, byte [0x421d68]
push ebx
push ebp
push esi
push edi
mov byte [esp + 0x158], al
mov ecx, 0x40
xor eax, eax
lea edi, [esp + 0x159]
xor ebp, ebp
rep stosd dword es:[edi], eax
mov cx, word [0x54e3a4]
push ebp
stosw word es:[edi], ax
stosb byte es:[edi], al
mov word [esp + 0x260], cx
mov ecx, 0x31
xor eax, eax
lea edi, [esp + 0x262]
rep stosd dword es:[edi], eax
push ebp
stosw word es:[edi], ax
call dword [sym.imp.SETUPAPI.dll_SetupDiCreateDeviceInfoList]
mov ebx, eax
cmp ebx, 0xffffffff
je 0x406367
mov eax, dword [esp + 0x644]
lea edx, [esp + 0x10]
push edx
push ebp
push ebp
push eax
push ebx
mov dword [esp + 0x24], 0x1c
call dword [sym.imp.SETUPAPI.dll_SetupDiOpenDeviceInfoA]
test eax, eax
je 0x406367
lea ecx, [esp + 0x10]
push ecx
push ebx
call dword [sym.imp.SETUPAPI.dll_SetupDiSetSelectedDevice]
test eax, eax
je 0x406367
lea edx, [esp + 0x30]
lea eax, [esp + 0x10]
push edx
push eax
push ebx
mov dword [esp + 0x3c], 0x128
call dword [sym.imp.SETUPAPI.dll_SetupDiGetDeviceInstallParamsA]
test eax, eax
je 0x406367
mov ecx, dword [esp + 0x34]
mov edi, dword [esp + 0x648]
or ecx, 0x10000
xor eax, eax
mov dword [esp + 0x34], ecx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
lea edx, [esp + 0x54]
mov eax, ecx
mov esi, edi
mov edi, edx
lea edx, [esp + 0x10]
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov eax, dword [esp + 0x38]
lea ecx, [esp + 0x30]
push ecx
or ah, 8
push edx
push ebx
mov dword [esp + 0x44], eax
call dword [sym.imp.SETUPAPI.dll_SetupDiSetDeviceInstallParamsA]
test eax, eax
je 0x406367
lea eax, [esp + 0x10]
push 2
push eax
push ebx
call dword [sym.imp.SETUPAPI.dll_SetupDiBuildDriverInfoList]
test eax, eax
je 0x406367
lea ecx, [esp + 0x10]
push ecx
push ebx
push 0x17
call dword [sym.imp.SETUPAPI.dll_SetupDiCallClassInstaller]
test eax, eax
je 0x406367
lea edx, [esp + 0x324]
lea eax, [esp + 0x10]
push edx
push eax
push ebx
mov dword [esp + 0x330], 0x31c
call dword [sym.imp.SETUPAPI.dll_SetupDiGetSelectedDriverA]
test eax, eax
je 0x406367
lea ecx, [esp + 0x158]
push 0x104
push ecx
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryA]
test eax, eax
je 0x406367
mov edi, str.NEWDEV.DLL
or ecx, 0xffffffff
xor eax, eax
lea edx, [esp + 0x158]
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov ebp, ecx
mov edi, edx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, ebp
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, ebp
lea eax, [esp + 0x158]
and ecx, 3
push eax
rep movsb byte es:[edi], byte [esi]
call dword [sym.imp.KERNEL32.dll_LoadLibraryA]
mov ebp, eax
test ebp, ebp
je 0x406367
push str.InstallSelectedDriver
push ebp
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
test eax, eax
je 0x406367
lea ecx, [esp + 0x2c]
lea edx, [esp + 0x25c]
push ecx
push 1
push edx
push ebx
push 0
call eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
mov eax, dword [esp + 0x64c]
lea ecx, [esp + 0x10]
push eax
push ecx
push ebx
call fcn.00404730
add esp, 0xc
test ebp, ebp
je 0x406390
push ebp
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
cmp ebx, 0xffffffff
je 0x40639c
push ebx
call dword [sym.imp.SETUPAPI.dll_SetupDiDestroyDeviceInfoList]
push esi
call dword [sym.imp.KERNEL32.dll_SetLastError]
xor eax, eax
pop edi
test esi, esi
pop esi
pop ebp
sete al
pop ebx
add esp, 0x630
ret