Function at 0x406e70
Capabilities:
Link many functions at runtime

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x43ee58
mov eax, dword fs:[0]
push eax
sub esp, 0x20
push ebx
push esi
push edi
mov eax, dword [0x455ac0]
xor eax, ebp
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov dword [ebp - 0x10], esp
mov esi, ecx
push str.winusb.dll
call dword [sym.imp.KERNEL32.dll_LoadLibraryA]
test eax, eax
mov dword [esi + 4], eax
je 0x4070d9
mov edi, dword [sym.imp.KERNEL32.dll_GetProcAddress]
push str.WinUsb_Initialize
push eax
call edi
mov dword [0x457298], eax
mov eax, dword [esi + 4]
push str.WinUsb_QueryInterfaceSettings
push eax
call edi
mov dword [0x45729c], eax
mov ecx, dword [esi + 4]
push str.WinUsb_QueryPipe
push ecx
call edi
mov dword [0x4572a0], eax
mov edx, dword [esi + 4]
push str.WinUsb_Free
push edx
call edi
mov dword [0x4572a4], eax
mov eax, dword [esi + 4]
push str.WinUsb_ReadPipe
push eax
call edi
mov dword [0x4572a8], eax
mov ecx, dword [esi + 4]
push str.WinUsb_WritePipe
push ecx
call edi
mov dword [0x4572ac], eax
mov edx, dword [esi + 4]
push str.WinUsb_ControlTransfer
push edx
call edi
cmp dword [0x457298], 0
mov dword [0x4572b0], eax
je 0x4070d9
cmp dword [0x45729c], 0
je 0x4070d9
cmp dword [0x4572a0], 0
je 0x4070d9
cmp dword [0x4572a4], 0
je 0x4070d9
cmp dword [0x4572a8], 0
je 0x4070d9
cmp dword [0x4572ac], 0
je 0x4070d9
test eax, eax
je 0x4070d9
lea ecx, [ebp - 0x14]
call fcn.00401d70
lea eax, [ebp - 0x14]
push eax
mov dword [ebp - 4], 0
call fcn.00406d10
mov ecx, dword [ebp - 0x14]
add esp, 4
push 0
push 0x40000080
push 3
push 0
push 0
push 0xc0000000
push ecx
call dword [sym.imp.KERNEL32.dll_CreateFileA]
cmp eax, 0xffffffff
mov dword [esi + 8], eax
je 0x4070d1
lea ebx, [esi + 0x4c]
push ebx
push eax
call dword [0x457298]
test eax, eax
je 0x4070d1
xor eax, eax
lea edx, [ebp - 0x20]
push edx
push eax
mov dword [ebp - 0x1f], eax
mov dword [ebp - 0x1b], eax
mov eax, dword [ebx]
push eax
mov byte [ebp - 0x20], 0
call dword [0x45729c]
test eax, eax
je 0x4070d1
xor edi, edi
cmp byte [ebp - 0x1c], 0
jbe 0x407050
lea esp, [esp]
mov edx, dword [ebx]
lea ecx, [ebp - 0x2c]
push ecx
xor eax, eax
push edi
push eax
push edx
mov dword [ebp - 0x2c], eax
mov dword [ebp - 0x28], eax
mov dword [ebp - 0x24], eax
call dword [0x4572a0]
test eax, eax
je 0x4070d1
cmp dword [ebp - 0x2c], 2
jne 0x407045
mov al, byte [ebp - 0x28]
test al, al
js 0x40703b
mov byte [esi + 0x50], al
movzx eax, word [ebp - 0x26]
mov dword [esi + 0x54], eax
jmp 0x407045
movzx ecx, word [ebp - 0x26]
mov byte [esi + 0x58], al
mov dword [esi + 0x5c], ecx
movzx edx, byte [ebp - 0x1c]
add edi, 1
cmp edi, edx
jl 0x407000
cmp byte [esi + 0x50], 0
je 0x4070d1
cmp byte [esi + 0x58], 0
je 0x4070d1
mov edi, dword [sym.imp.KERNEL32.dll_CreateEventW]
push 0
push 0
push 1
push 0
call edi
test eax, eax
mov dword [esi + 0x1c], eax
je 0x4070d1
push 0
push 0
push 1
push 0
call edi
test eax, eax
mov dword [esi + 0x30], eax
je 0x4070d1
push 0
push 0
push 1
push 0
call edi
test eax, eax
mov dword [esi + 0x44], eax
je 0x4070d1
push 2
mov ecx, esi
mov byte [ebp - 4], 1
call fcn.00406ab0
push 3
mov ecx, esi
call fcn.00406ab0
lea ecx, [ebp - 0x14]
mov byte [esi + 0x68], 0
call fcn.00401da0
mov al, 1
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
lea ecx, [ebp - 0x14]
call fcn.00401da0
xor al, al
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret