Function at 0x40bef0
Capabilities:
Get common file path
Link many functions at runtime

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x104
lea eax, [ebp - 0x104]
push ebx
push esi
push edi
push 0x104
push eax
mov edi, ecx
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryA]
test eax, eax
je 0x40c3b2
cmp eax, 0x104
jae 0x40c3b2
lea ecx, [eax + 0xe]
cmp ecx, 0x104
jb 0x40bf38
push str.program_assertion_failed___library_path_buffer_overflow
jmp 0x40c3b7
push str.Cfgmgr32
lea ecx, [ebp - 0x104]
add eax, ecx
push str._s.dll
push eax
call fcn.0040a7d0
add esp, 0xc
lea eax, [ebp - 0x104]
push eax
call dword [sym.imp.KERNEL32.dll_LoadLibraryA]
mov ebx, eax
mov dword [0x421758], ebx
test ebx, ebx
je 0x40c3d1
mov esi, dword [sym.imp.KERNEL32.dll_GetProcAddress]
push str.CM_Get_Parent
push ebx
call esi
mov dword [0x42186c], eax
test eax, eax
jne 0x40bfad
push str.CM_Get_ParentA
push ebx
call esi
mov dword [0x42186c], eax
test eax, eax
jne 0x40bfad
push str.CM_Get_ParentW
push ebx
call esi
mov dword [0x42186c], eax
test eax, eax
je 0x40c3d1
mov ebx, dword [0x421758]
push str.CM_Get_Child
push ebx
call esi
mov dword [0x421848], eax
test eax, eax
jne 0x40bfea
push str.CM_Get_ChildA
push ebx
call esi
mov dword [0x421848], eax
test eax, eax
jne 0x40bfea
push str.CM_Get_ChildW
push ebx
call esi
mov dword [0x421848], eax
test eax, eax
je 0x40c3d1
push 0x104
lea eax, [ebp - 0x104]
push eax
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryA]
test eax, eax
je 0x40c3a8
cmp eax, 0x104
jae 0x40c3a8
lea ecx, [eax + 0xe]
cmp ecx, 0x104
jb 0x40c042
push str.program_assertion_failed___library_path_buffer_overflow
push str.load_system_library
push 1
push edi
call fcn.004078c0
add esp, 0x10
mov dword [0x42175c], 0
xor al, al
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
push str.AdvAPI32
lea ecx, [ebp - 0x104]
add eax, ecx
push str._s.dll
push eax
call fcn.0040a7d0
add esp, 0xc
lea eax, [ebp - 0x104]
push eax
call dword [sym.imp.KERNEL32.dll_LoadLibraryA]
mov ebx, eax
mov dword [0x42175c], ebx
test ebx, ebx
je 0x40c3d1
push str.RegQueryValueExA
push ebx
call esi
mov dword [0x421750], eax
test eax, eax
jne 0x40c0b1
push str.RegQueryValueExAA
push ebx
call esi
mov dword [0x421750], eax
test eax, eax
jne 0x40c0b1
push str.RegQueryValueExAW
push ebx
call esi
mov dword [0x421750], eax
test eax, eax
je 0x40c3d1
mov ebx, dword [0x42175c]
push str.RegCloseKey
push ebx
call esi
mov dword [0x421724], eax
test eax, eax
jne 0x40c0ee
push str.RegCloseKeyA
push ebx
call esi
mov dword [0x421724], eax
test eax, eax
jne 0x40c0ee
push str.RegCloseKeyW
push ebx
call esi
mov dword [0x421724], eax
test eax, eax
je 0x40c3d1
push 0x104
lea eax, [ebp - 0x104]
push eax
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryA]
test eax, eax
je 0x40c39e
cmp eax, 0x104
jae 0x40c39e
lea ecx, [eax + 0xe]
cmp ecx, 0x104
jb 0x40c146
push str.program_assertion_failed___library_path_buffer_overflow
push str.load_system_library
push 1
push edi
call fcn.004078c0
add esp, 0x10
mov dword [0x421704], 0
xor al, al
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
push str.SetupAPI
lea ecx, [ebp - 0x104]
add eax, ecx
push str._s.dll
push eax
call fcn.0040a7d0
add esp, 0xc
lea eax, [ebp - 0x104]
push eax
call dword [sym.imp.KERNEL32.dll_LoadLibraryA]
mov edi, eax
mov dword [0x421704], edi
test edi, edi
je 0x40c3d1
push str.SetupDiGetClassDevsA
push edi
call esi
mov dword [0x421744], eax
test eax, eax
jne 0x40c1b5
push str.SetupDiGetClassDevsAA
push edi
call esi
mov dword [0x421744], eax
test eax, eax
jne 0x40c1b5
push str.SetupDiGetClassDevsAW
push edi
call esi
mov dword [0x421744], eax
test eax, eax
je 0x40c3d1
mov edi, dword [0x421704]
push str.SetupDiEnumDeviceInfo
push edi
call esi
mov dword [0x421734], eax
test eax, eax
jne 0x40c1f2
push str.SetupDiEnumDeviceInfoA
push edi
call esi
mov dword [0x421734], eax
test eax, eax
jne 0x40c1f2
push str.SetupDiEnumDeviceInfoW
push edi
call esi
mov dword [0x421734], eax
test eax, eax
je 0x40c3d1
mov edi, dword [0x421704]
push str.SetupDiEnumDeviceInterfaces
push edi
call esi
mov dword [0x421764], eax
test eax, eax
jne 0x40c22f
push str.SetupDiEnumDeviceInterfacesA
push edi
call esi
mov dword [0x421764], eax
test eax, eax
jne 0x40c22f
push str.SetupDiEnumDeviceInterfacesW
push edi
call esi
mov dword [0x421764], eax
test eax, eax
je 0x40c3d1
mov edi, dword [0x421704]
push str.SetupDiGetDeviceInstanceIdA
push edi
call esi
mov dword [0x42174c], eax
test eax, eax
jne 0x40c26c
push str.SetupDiGetDeviceInstanceIdAA
push edi
call esi
mov dword [0x42174c], eax
test eax, eax
jne 0x40c26c
push str.SetupDiGetDeviceInstanceIdAW
push edi
call esi
mov dword [0x42174c], eax
test eax, eax
je 0x40c3d1
mov edi, dword [0x421704]
push str.SetupDiGetDeviceInterfaceDetailA
push edi
call esi
mov dword [0x421720], eax
test eax, eax
jne 0x40c2a9
push str.SetupDiGetDeviceInterfaceDetailAA
push edi
call esi
mov dword [0x421720], eax
test eax, eax
jne 0x40c2a9
push str.SetupDiGetDeviceInterfaceDetailAW
push edi
call esi
mov dword [0x421720], eax
test eax, eax
je 0x40c3d1
mov edi, dword [0x421704]
push str.SetupDiGetDeviceRegistryPropertyA
push edi
call esi
mov dword [0x421738], eax
test eax, eax
jne 0x40c2e6
push str.SetupDiGetDeviceRegistryPropertyAA
push edi
call esi
mov dword [0x421738], eax
test eax, eax
jne 0x40c2e6
push str.SetupDiGetDeviceRegistryPropertyAW
push edi
call esi
mov dword [0x421738], eax
test eax, eax
je 0x40c3d1
mov edi, dword [0x421704]
push str.SetupDiDestroyDeviceInfoList
push edi
call esi
mov dword [0x42184c], eax
test eax, eax
jne 0x40c323
push str.SetupDiDestroyDeviceInfoListA
push edi
call esi
mov dword [0x42184c], eax
test eax, eax
jne 0x40c323
push str.SetupDiDestroyDeviceInfoListW
push edi
call esi
mov dword [0x42184c], eax
test eax, eax
je 0x40c3d1
mov edi, dword [0x421704]
push str.SetupDiOpenDevRegKey
push edi
call esi
mov dword [0x42173c], eax
test eax, eax
jne 0x40c35c
push str.SetupDiOpenDevRegKeyA
push edi
call esi
mov dword [0x42173c], eax
test eax, eax
jne 0x40c35c
push str.SetupDiOpenDevRegKeyW
push edi
call esi
mov dword [0x42173c], eax
test eax, eax
je 0x40c3d1
mov edi, dword [0x421704]
push str.SetupDiOpenDeviceInterfaceRegKey
push edi
call esi
mov dword [0x421714], eax
test eax, eax
jne 0x40c395
push str.SetupDiOpenDeviceInterfaceRegKeyA
push edi
call esi
mov dword [0x421714], eax
test eax, eax
jne 0x40c395
push str.SetupDiOpenDeviceInterfaceRegKeyW
push edi
call esi
mov dword [0x421714], eax
test eax, eax
je 0x40c3d1
pop edi
pop esi
mov al, 1
pop ebx
mov esp, ebp
pop ebp
ret
push str.program_assertion_failed___could_not_get_system_directory
jmp 0x40c123
push str.program_assertion_failed___could_not_get_system_directory
jmp 0x40c01f
push str.program_assertion_failed___could_not_get_system_directory
push str.load_system_library
push 1
push edi
call fcn.004078c0
mov dword [0x421758], 0
add esp, 0x10
pop edi
pop esi
xor al, al
pop ebx
mov esp, ebp
pop ebp
ret