Function at 0x402070
Capabilities:
Link many functions at runtime

Disassembly:
sub esp, 0x13c
mov eax, dword [esp + 0x144]
push ebx
push ebp
push esi
push edi
push eax
lea ecx, [esp + 0x4c]
push str.USB_s
push ecx
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0xc
push str.setupapi
call dword [sym.imp.KERNEL32.dll_LoadLibraryA]
mov ebp, eax
test ebp, ebp
mov dword [esp + 0x20], ebp
je 0x402273
mov esi, dword [sym.imp.KERNEL32.dll_GetProcAddress]
push str.SetupDiGetClassDevsW
push ebp
call esi
push str.SetupDiEnumDeviceInfo
push ebp
mov edi, eax
call esi
push str.SetupDiGetDeviceRegistryPropertyA
push ebp
mov dword [esp + 0x1c], eax
call esi
push str.SetupDiCallClassInstaller
push ebp
mov ebx, eax
call esi
push str.SetupDiDestroyDeviceInfoList
push ebp
mov dword [esp + 0x20], eax
call esi
test edi, edi
mov dword [esp + 0x28], eax
je 0x402119
mov ecx, dword [esp + 0x14]
test ecx, ecx
je 0x402119
test ebx, ebx
je 0x402119
mov ecx, dword [esp + 0x18]
test ecx, ecx
je 0x402119
test eax, eax
je 0x402119
push 4
push 0
push 0
push 0
call edi
mov ebp, eax
cmp ebp, 0xffffffff
jne 0x402129
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
add esp, 0x13c
ret
lea edx, [esp + 0x2c]
mov dword [esp + 0x2c], 0x1c
push edx
push 0
push ebp
mov dword [esp + 0x28], 0
call dword [esp + 0x20]
test eax, eax
je 0x402237
lea eax, [esp + 0x10]
xor esi, esi
push eax
push esi
lea ecx, [esp + 0x2c]
push esi
push ecx
lea edx, [esp + 0x3c]
push 1
push edx
push ebp
mov dword [esp + 0x2c], esi
call ebx
test eax, eax
jne 0x4021bf
mov edi, dword [sym.imp.KERNEL32.dll_GetLastError]
call edi
cmp eax, 0xd
je 0x4021c5
call edi
cmp eax, 0x7a
jne 0x40224d
test esi, esi
je 0x402190
push esi
call dword [sym.imp.KERNEL32.dll_LocalFree]
mov eax, dword [esp + 0x10]
push eax
push 0x40
call dword [sym.imp.KERNEL32.dll_LocalAlloc]
mov edx, dword [esp + 0x10]
lea ecx, [esp + 0x10]
mov esi, eax
push ecx
push edx
lea eax, [esp + 0x2c]
push esi
push eax
lea ecx, [esp + 0x3c]
push 1
push ecx
push ebp
call ebx
test eax, eax
je 0x40216d
jmp 0x4021c5
mov edi, dword [sym.imp.KERNEL32.dll_GetLastError]
call edi
cmp eax, 0xd
je 0x40221b
mov al, byte [esi]
mov edi, esi
test al, al
je 0x402210
mov edx, dword [esp + 0x10]
add edx, esi
cmp edi, edx
jae 0x402210
push 0x15
lea eax, [esp + 0x4c]
push edi
push eax
call fcn.00403e6c
add esp, 0xc
test eax, eax
je 0x402204
push edi
call dword [sym.imp.KERNEL32.dll_lstrlenA]
lea edi, [edi + eax + 1]
cmp byte [edi], 0
jne 0x4021d4
jmp 0x402210
lea ecx, [esp + 0x2c]
push ecx
push ebp
push 5
call dword [esp + 0x24]
test esi, esi
je 0x40221b
push esi
call dword [sym.imp.KERNEL32.dll_LocalFree]
mov eax, dword [esp + 0x1c]
lea edx, [esp + 0x2c]
inc eax
push edx
push eax
push ebp
mov dword [esp + 0x28], eax
call dword [esp + 0x20]
test eax, eax
jne 0x40214d
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
je 0x402247
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edi, dword [sym.imp.KERNEL32.dll_GetLastError]
call edi
push ebp
mov esi, eax
call dword [esp + 0x2c]
mov eax, dword [esp + 0x20]
push eax
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
xor eax, eax
pop edi
test esi, esi
pop esi
pop ebp
setne al
pop ebx
add esp, 0x13c
ret
mov esi, dword [esp + 0x20]
xor eax, eax
test esi, esi
pop edi
pop esi
pop ebp
pop ebx
setne al
add esp, 0x13c
ret