Function at 0x47d650
Capabilities:
Read file on windows
Resolve function by parsing pe exports

Disassembly:
push ebp
push ebx
push edi
push esi
sub esp, 0x46c
mov dword [esp + 0x18], 0
lea ebx, [esp + 0x18]
push 8
push ebx
push 0
call dword [sym.imp.USER32.dll_GetRawInputDeviceList]
mov edi, str.GetRawInputDeviceList_NULL__failed
test eax, eax
jne 0x47df55
mov eax, dword [esp + 0x18]
test eax, eax
je 0x47d6ba
shl eax, 3
push eax
call sym._malloc
add esp, 4
mov esi, eax
push 8
push ebx
push eax
call dword [sym.imp.USER32.dll_GetRawInputDeviceList]
mov dword [esp + 0x18], eax
cmp eax, 0xffffffff
je 0x47d6c4
test eax, eax
jne 0x47d6d6
xor edi, edi
test esi, esi
jne 0x47df4c
jmp 0x47df55
mov edi, str.No_HID_devices_found
jmp 0x47df55
mov edi, str.GetRawInputDeviceList_pRawInputDeviceList__failed
test esi, esi
jne 0x47df4c
jmp 0x47df55
xor ebp, ebp
mov dword [esp + 0x1c], esi
jmp 0x47d71d
push dword [esp + 0x40]
push dword [esp + 0x40]
push str.Unknown_gamepad__04X__04X
push esi
call dbg.ffStrbufSetF
add esp, 0x10
xor edi, edi
mov esi, ebx
lea eax, [edi + 1]
cmp eax, 2
jae 0x47d84a
nop word cs:[eax + eax]
mov eax, dword [esp + 0x18]
inc ebp
cmp ebp, eax
jae 0x47df4a
cmp dword [esi + ebp*8 + 4], 2
jne 0x47d714
mov edi, dword [esi + ebp*8]
mov dword [esp + 0x30], 0x20
lea eax, [esp + 0x30]
push eax
lea eax, [esp + 0x38]
push eax
push 0x2000000b
push edi
call dword [sym.imp.USER32.dll_GetRawInputDeviceInfoW]
cmp eax, 0xffffffff
je 0x47d710
cmp word [esp + 0x48], 1
jne 0x47d710
cmp word [esp + 0x4a], 5
jne 0x47d710
push 0x208
push 0
lea ebx, [esp + 0x26c]
push ebx
call sym._memset
add esp, 0xc
mov dword [esp + 0x2c], 0x104
lea eax, [esp + 0x2c]
push eax
push ebx
push 0x20000007
push edi
call dword [sym.imp.USER32.dll_GetRawInputDeviceInfoW]
cmp eax, 0xffffffff
je 0x47d710
mov edi, dword [esp + 0x480]
mov eax, dword [edi]
mov ecx, dword [edi + 8]
cmp ecx, dword [edi + 0xc]
jne 0x47d7c4
lea edx, [ecx + ecx]
test ecx, ecx
mov ecx, 0x10
cmove edx, ecx
mov dword [edi + 0xc], edx
imul edx, dword [edi + 4]
push edx
push eax
call sym._realloc
add esp, 8
mov dword [edi], eax
mov ecx, dword [edi + 8]
lea edx, [ecx + 1]
mov dword [edi + 8], edx
imul ecx, dword [edi + 4]
lea edx, [eax + ecx]
mov dword [esp], edx
mov dword [eax + ecx], 0
mov dword [eax + ecx + 4], 0
mov edx, dword [0x5052b0]
mov dword [eax + ecx + 8], edx
mov dword [eax + ecx + 0xc], 0
mov dword [eax + ecx + 0x10], 0
mov dword [eax + ecx + 0x14], edx
mov byte [eax + ecx + 0x18], 0
mov edi, dword [esp + 0x3c]
mov edx, dword [esp + 0x40]
cmp edi, 0x46d
je 0x47d856
cmp edi, 0x54c
je 0x47d877
cmp edi, 0x57e
jne case.0x47d839.8200
add edx, 0xffffdffa
cmp edx, 0x11
ja case.0x47d839.8200
jmp dword [edx*4 + 0x4fa7c0]
mov ebx, str.Nintendo_Switch_Joycon_L
jmp 0x47dad6
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x47d710
lea edi, [edx - 0xc216]
cmp edi, 0xa
jae case.0x47d839.8200
mov ebx, 0x38d
bt ebx, edi
jae case.0x47d839.8200
mov ebx, dword [edx*4 + 0x4c9f40]
jmp 0x47dad6
cmp edx, 0xb9f
jg 0x47d8a9
cmp edx, 0x268
je 0x47dabc
cmp edx, 0x5c4
je 0x47dac3
cmp edx, 0x9cc
jne case.0x47d839.8200
mov ebx, str.Sony_DualShock_4_Gen2
jmp 0x47dad6
cmp edx, 0xba0
je 0x47daca
cmp edx, 0xce6
je 0x47dad1
cmp edx, 0xdf2
jne case.0x47d839.8200
mov ebx, str.Sony_DualSense_Edge
jmp 0x47dad6
mov ebx, esi
lea esi, [eax + ecx]
add esi, 0xc
sub esp, 0x1c
movaps xmm0, xmmword [0x4fa560]
movups xmmword [esp + 4], xmm0
lea eax, [esp + 0x280]
mov dword [esp], eax
mov dword [esp + 0x18], 0
mov dword [esp + 0x14], 0x40000000
call dword [sym.imp.KERNEL32.dll_CreateFileW]
test eax, eax
je 0x47d6de
mov edi, eax
mov dword [esp + 0x10], esi
push 0xfc
lea eax, [esp + 0x6c]
push eax
push edi
call sym._HidD_GetProductString_12
test al, al
mov esi, ebx
je 0x47dcf3
push 0xfc
mov eax, edi
lea edi, [esp + 0x16c]
push edi
mov dword [esp + 0x10], eax
push eax
call sym._HidD_GetManufacturerString_12
test al, al
je 0x47d9b8
push edi
call sym._wcslen
add esp, 4
push edi
push eax
push dword [esp + 0x18]
call dbg.ffStrbufSetNWS
add esp, 0xc
lea edi, [esp + 0x68]
push edi
call sym._wcslen
add esp, 4
test eax, eax
je 0x47d9dc
mov ebx, eax
sub esp, 0x20
xorps xmm0, xmm0
movups xmmword [esp + 0x10], xmm0
mov dword [esp + 0xc], eax
mov dword [esp + 8], edi
mov dword [esp + 4], 0
mov dword [esp], 0xfde9
call dword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
mov dword [esp + 0xc], eax
inc eax
mov edi, dword [esp + 8]
mov dword [esp + 0x24], eax
jne 0x47da20
mov ecx, dword [0x5052b0]
jmp 0x47da2e
lea edi, [esp + 0x68]
push edi
call sym._wcslen
add esp, 4
push edi
push eax
push dword [esp + 0x18]
call dbg.ffStrbufSetNWS
add esp, 0xc
mov edi, dword [esp + 8]
jmp 0x47dcf3
mov dword [esp + 0xc], 0
mov ebx, dword [0x5052b0]
mov dword [esp + 0x24], 0
mov edi, dword [esp + 8]
jmp 0x47da54
mov ebx, str.Nintendo_Switch_Joycon_R
jmp 0x47dad6
mov ebx, str.Nintendo_Switch_Pro_Controller
jmp 0x47dad6
mov ebx, str.Nintendo_Switch_Charging_Grip
jmp 0x47dad6
mov ebx, str.Nintendo_Switch_SNES_Controller
jmp 0x47dad6
push eax
call sym._malloc
add esp, 4
mov ecx, eax
mov byte [eax], 0
push 0
push 0
push dword [esp + 0x14]
push ecx
push ebx
lea eax, [esp + 0x7c]
push eax
push 0
push 0xfde9
mov ebx, ecx
call dword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
mov ecx, dword [esp + 0xc]
mov byte [ebx + ecx], 0
mov dword [esp + 0x14], ebx
mov ecx, dword [esp]
mov eax, dword [ecx + 0xc]
mov ebx, dword [ecx + 0x10]
test eax, eax
je 0x47da6c
lea ecx, [ebx + 1]
cmp eax, ecx
jne 0x47dab1
cmp eax, 2
mov ecx, eax
mov edx, 0x20
cmovb ecx, edx
mov dword [esp + 4], ebx
lea edx, [ebx + 2]
mov ebx, ecx
add ecx, ecx
cmp edx, ebx
ja 0x47da80
test eax, eax
je 0x47db8e
push ebx
mov edi, esi
mov esi, dword [esp + 4]
push dword [esi + 0x14]
call sym._realloc
add esp, 8
mov edx, eax
mov dword [esi + 0x14], eax
mov ecx, dword [esi + 0x10]
mov esi, edi
jmp 0x47dbc6
mov eax, dword [esp]
mov eax, dword [eax + 0x14]
jmp 0x47dbd5
mov ebx, str.Sony_DualShock_3___Six_Axis
jmp 0x47dad6
mov ebx, str.Sony_DualShock_4_Gen1
jmp 0x47dad6
mov ebx, str.Sony_DualShock_4_USB_receiver
jmp 0x47dad6
mov ebx, str.Sony_DualSense
mov eax, dword [0x5052b0]
mov ecx, dword [esp]
mov dword [ecx + 0x14], eax
mov dword [ecx + 0x10], 0
push ebx
call sym._strlen
add esp, 4
test eax, eax
je 0x47db4e
mov edi, eax
mov dword [esp + 0x10], ebx
inc eax
mov ecx, 0x20
nop word cs:[eax + eax]
mov ebx, ecx
add ecx, ecx
cmp eax, ebx
ja 0x47db10
push ebx
call sym._malloc
add esp, 4
mov byte [eax], 0
mov esi, dword [esp]
mov dword [esi + 0x14], eax
mov dword [esi + 0xc], ebx
push edi
push dword [esp + 0x14]
push eax
call sym._memcpy
add esp, 0xc
mov eax, dword [esi + 0x10]
add eax, edi
mov dword [esi + 0x10], eax
mov ecx, dword [esi + 0x14]
mov byte [ecx + eax], 0
mov esi, dword [esp + 0x1c]
sub esp, 0x1c
movaps xmm0, xmmword [0x4fa560]
movups xmmword [esp + 4], xmm0
lea eax, [esp + 0x280]
mov dword [esp], eax
mov dword [esp + 0x18], 0
mov dword [esp + 0x14], 0x40000000
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov edi, eax
test eax, eax
jne 0x47dcf3
xor edi, edi
jmp 0x47d6f8
push ebx
call sym._malloc
add esp, 4
mov ecx, dword [esp + 4]
test ecx, ecx
je 0x47df1f
mov edi, eax
lea eax, [ecx + 1]
push eax
mov esi, dword [esp + 4]
push dword [esi + 0x14]
push edi
call sym._memcpy
mov ecx, dword [esp + 0x10]
add esp, 0xc
mov edx, edi
mov dword [esi + 0x14], edi
mov esi, dword [esp + 0x1c]
mov edi, dword [esp + 8]
mov eax, dword [esp + 0x10]
mov dword [eax], ebx
mov ebx, ecx
inc ecx
mov eax, edx
mov edx, dword [esp]
mov dword [edx + 0x10], ecx
mov byte [eax + ebx], 0x20
mov eax, dword [edx + 0x10]
mov ecx, dword [edx + 0x14]
mov byte [ecx + eax], 0
mov edx, dword [esp + 0x14]
test edx, edx
je 0x47dce3
cmp dword [esp + 0xc], 0
je 0x47dce3
mov ecx, dword [esp]
mov eax, dword [ecx + 0xc]
mov ebx, dword [ecx + 0x10]
test eax, eax
je 0x47dc19
mov ecx, ebx
not ecx
add ecx, eax
cmp ecx, dword [esp + 0xc]
jae 0x47dc6e
cmp eax, 2
mov ecx, eax
mov edx, 0x20
cmovb ecx, edx
mov edx, dword [esp + 0xc]
mov dword [esp + 4], ebx
add edx, ebx
inc edx
nop word cs:[eax + eax]
mov ebx, ecx
add ecx, ecx
cmp edx, ebx
ja 0x47dc40
test eax, eax
je 0x47dc76
push ebx
mov edi, esi
mov esi, dword [esp + 4]
push dword [esi + 0x14]
call sym._realloc
add esp, 8
mov ecx, eax
mov dword [esi + 0x14], eax
mov eax, dword [esi + 0x10]
mov dword [esp + 4], eax
mov esi, edi
jmp 0x47dcaa
mov eax, dword [esp]
mov ecx, dword [eax + 0x14]
jmp 0x47dcbc
push ebx
call sym._malloc
add esp, 4
mov ecx, eax
mov eax, dword [esp + 4]
test eax, eax
je 0x47df35
inc eax
push eax
mov esi, dword [esp + 4]
push dword [esi + 0x14]
push ecx
mov edi, ecx
call sym._memcpy
mov ecx, edi
add esp, 0xc
mov dword [esi + 0x14], edi
mov esi, dword [esp + 0x1c]
mov edi, dword [esp + 8]
mov edx, dword [esp + 0x14]
mov eax, dword [esp + 0x10]
mov dword [eax], ebx
mov ebx, dword [esp + 4]
add ebx, ecx
mov eax, ebx
mov ebx, dword [esp + 0xc]
push ebx
push edx
push eax
call sym._memcpy
mov edx, dword [esp + 0x20]
add esp, 0xc
mov eax, dword [esp]
add ebx, dword [eax + 0x10]
mov dword [eax + 0x10], ebx
mov eax, dword [eax + 0x14]
mov byte [eax + ebx], 0
cmp dword [esp + 0x24], 0
je 0x47dcf3
push edx
call sym._free
add esp, 4
mov dword [esp + 0x20], 0
lea eax, [esp + 0x20]
push eax
push edi
call sym._HidD_GetPreparsedData_8
test al, al
je 0x47d6f8
lea eax, [esp + 0x168]
push eax
push dword [esp + 0x24]
call sym._HidP_GetCaps_8
mov ebx, eax
push dword [esp + 0x20]
call sym._HidD_FreePreparsedData_4
test ebx, ebx
js 0x47d6f8
xorps xmm0, xmm0
movups xmmword [esp + 0x156], xmm0
movups xmmword [esp + 0x148], xmm0
movups xmmword [esp + 0x138], xmm0
movups xmmword [esp + 0x128], xmm0
movups xmmword [esp + 0x118], xmm0
movups xmmword [esp + 0x108], xmm0
movups xmmword [esp + 0xf8], xmm0
movups xmmword [esp + 0xe8], xmm0
movups xmmword [esp + 0xd8], xmm0
movups xmmword [esp + 0xc8], xmm0
movups xmmword [esp + 0xb8], xmm0
movups xmmword [esp + 0xa8], xmm0
movups xmmword [esp + 0x98], xmm0
movups xmmword [esp + 0x88], xmm0
movups xmmword [esp + 0x78], xmm0
movups xmmword [esp + 0x68], xmm0
push 0xfe
lea ebx, [esp + 0x6c]
push ebx
push edi
call sym._HidD_GetSerialNumberString_12
test al, al
je 0x47ddda
push ebx
call sym._wcslen
add esp, 4
push ebx
push eax
push dword [esp + 8]
call dbg.ffStrbufSetNWS
add esp, 0xc
mov eax, dword [esp + 0x3c]
cmp eax, 0x54c
jne 0x47ddfc
mov eax, dword [esp + 0x40]
cmp eax, 0x5c4
je 0x47de15
cmp eax, 0x9cc
je 0x47de15
jmp 0x47d6f8
cmp eax, 0x57e
jne 0x47d6f8
cmp dword [esp + 0x40], 0x2009
jne 0x47d6f8
movzx ebx, word [esp + 0x16c]
push ebx
call sym._malloc
add esp, 4
mov ecx, eax
xorps xmm0, xmm0
movups xmmword [esp + 0x54], xmm0
mov dword [esp + 0x64], 0
lea eax, [esp + 0x54]
push eax
lea eax, [esp + 0x2c]
push eax
push ebx
mov ebx, ecx
push ecx
push edi
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x47deaa
cmp dword [esp + 0x3c], 0x54c
mov eax, dword [esp + 0x28]
jne 0x47dec0
cmp eax, 0x20
jb 0x47deec
xor eax, eax
cmp word [esp + 0x16c], 0x40
setne al
movzx ecx, byte [ebx + eax*2 + 0x1e]
mov eax, ecx
and eax, 0xf
imul eax, eax, 0x64
xor edx, edx
test cl, 0x10
setne dl
lea ecx, [edx + edx*2]
add ecx, 8
xor edx, edx
div cx
cmp ax, 0x64
mov ecx, 0x64
cmovb ecx, eax
mov eax, dword [esp]
mov byte [eax + 0x18], cl
jmp 0x47def4
push 0x64
push edi
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
test eax, eax
je 0x47df02
push edi
call dword [sym.imp.KERNEL32.dll_CancelIo]
jmp 0x47deec
cmp eax, 4
jb 0x47deec
cmp byte [ebx], 0x30
jne 0x47def4
movzx eax, byte [ebx + 2]
shr eax, 4
and eax, 0xfffffffe
imul ecx, eax, 0x64
shr ecx, 3
mov edx, dword [esp]
mov byte [edx + 0x18], cl
test eax, eax
je 0x47df43
mov cl, 0x64
cmp al, 8
ja 0x47dea2
jmp 0x47def4
test ebx, ebx
je 0x47d6f8
push ebx
call sym._free
add esp, 4
jmp 0x47d6f8
push 0
lea eax, [esp + 0x2c]
push eax
lea eax, [esp + 0x5c]
push eax
push edi
call dword [sym.imp.KERNEL32.dll_GetOverlappedResult]
test eax, eax
jne 0x47de51
jmp 0x47deb7
mov byte [eax], 0
mov ecx, eax
mov eax, dword [esp]
mov edx, ecx
mov dword [eax + 0x14], ecx
mov ecx, dword [esp + 4]
jmp 0x47dbca
mov byte [ecx], 0
mov eax, dword [esp]
mov dword [eax + 0x14], ecx
jmp 0x47dcae
mov cl, 1
jmp 0x47dea2
xor edi, edi
push esi
call sym._free
add esp, 4
mov eax, edi
add esp, 0x46c
pop esi
pop edi
pop ebx
pop ebp
ret