Function at 0x4030e0
Capabilities:
Print debug messages

Disassembly:
sub esp, 0x78
push ebx
push ebp
push esi
push edi
xor eax, eax
mov ecx, 0xf
lea edi, [esp + 0x4c]
mov dword [esp + 0x14], eax
rep stosd dword es:[edi], eax
xor ecx, ecx
mov dword [esp + 0x18], eax
mov dword [esp + 0x1c], eax
mov dword [esp + 0x34], eax
mov dword [esp + 0x40], ecx
mov dword [esp + 0x38], eax
mov dword [esp + 0x44], ecx
mov dword [esp + 0x3c], eax
mov dword [esp + 0x48], ecx
call dword [sym.imp.utpapi.dll_GetExistControllers]
mov byte [esp + 0x12], al
call fcn.00402c70
mov ebx, dword [sym.imp.KERNEL32.dll_Sleep]
push 0x3e8
mov dword [esp + 0x34], eax
call ebx
mov al, byte [esp + 0x12]
mov byte [esp + 0x24], 1
cmp al, 1
jb 0x403354
mov edi, dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
mov ebp, dword [sym.imp.KERNEL32.dll_DeviceIoControl]
mov esi, dword [esp + 0x30]
mov eax, dword [esp + 0x24]
lea edx, [esp + 0x4c]
push 0x3c
push edx
push eax
call dword [sym.imp.utpapi.dll_GetControllerName]
lea ecx, [esp + 0x56]
push ecx
call fcn.00403557
add esp, 4
lea edx, [esp + 0x4c]
mov byte [esp + 0x13], al
push edx
call dword [sym.imp.utpapi.dll_OpenController]
push eax
mov dword [esp + 0x2c], eax
call dword [sym.imp.utpapi.dll_GetReportMode]
mov ecx, dword [esp + 0x28]
mov byte [esp + 0x2c], al
mov eax, dword [esp + 0x2c]
push eax
push ecx
call dword [sym.imp.utpapi.dll_SetReportMode]
mov edx, dword [esp + 0x28]
push edx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [esp + 0x30]
cmp eax, 0x7d6
je 0x4031c9
cmp eax, 0x7d7
jne 0x403337
push 0xa
lea eax, [esp + 0x50]
push str.USB_DEVICE
push eax
call fcn.00403570
add esp, 0xc
test eax, eax
jne 0x403337
push eax
push eax
push 3
push eax
push 3
push 0xc0000000
push str..UtcUsbMgr
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov esi, eax
mov eax, dword [esp + 0x14]
cmp eax, 0xa
jae 0x403337
push 0x3e8
call ebx
mov cl, byte [esp + 0x13]
push str.RESET_PIPE
mov byte [esp + 0x38], cl
call edi
mov edx, dword [esp + 0x14]
push 0
inc edx
lea eax, [esp + 0x44]
mov dword [esp + 0x18], edx
lea edx, [esp + 0x24]
push edx
push 2
push eax
lea ecx, [esp + 0x44]
push 1
push ecx
push 0x220008
push esi
call ebp
test eax, eax
jne 0x4032ed
cmp dword [esp + 0x18], 5
jae 0x403323
push 0x1f4
call ebx
push str.RESET_DEVICE
call edi
lea edx, [esp + 0x20]
push 0
push edx
lea eax, [esp + 0x48]
push 2
push eax
lea ecx, [esp + 0x44]
push 1
push ecx
push 0x220004
push esi
call ebp
test eax, eax
jne 0x40329d
mov eax, dword [esp + 0x18]
inc eax
cmp eax, 5
mov dword [esp + 0x18], eax
jae 0x403323
jmp 0x40325a
mov eax, dword [esp + 0x1c]
mov dword [esp + 0x18], 6
cmp eax, 5
jae 0x403323
push 0x1f4
call ebx
push str.RESET_PIPE
call edi
lea edx, [esp + 0x20]
push 0
push edx
lea eax, [esp + 0x48]
push 2
push eax
lea ecx, [esp + 0x44]
push 1
push ecx
push 0x220008
push esi
call ebp
test eax, eax
jne 0x403323
mov eax, dword [esp + 0x1c]
inc eax
cmp eax, 5
mov dword [esp + 0x1c], eax
jb 0x4032ae
jmp 0x403323
push 0x1f4
call ebx
push str.BUILD_URB
call edi
lea edx, [esp + 0x20]
push 0
push edx
lea eax, [esp + 0x48]
push 2
push eax
lea ecx, [esp + 0x44]
push 1
push ecx
push 0x2200e8
push esi
call ebp
test eax, eax
jne 0x40332f
cmp dword [esp + 0x14], 9
jae 0x403361
cmp dword [esp + 0x14], 0xa
jae 0x403337
jmp 0x40320b
mov dword [esp + 0x14], 0xb
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov al, byte [esp + 0x24]
mov cl, byte [esp + 0x12]
inc al
cmp al, cl
mov byte [esp + 0x24], al
jbe 0x40315b
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
add esp, 0x78
ret
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x78
ret