Function at 0x47d420
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 0x47dd25
mov eax, dword [esp + 0x18]
test eax, eax
je 0x47d48a
shl eax, 3
push eax
call sub.api_ms_win_crt_heap_l1_1_0.dll_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 0x47d494
test eax, eax
jne 0x47d4a6
xor edi, edi
test esi, esi
jne 0x47dd1c
jmp 0x47dd25
mov edi, str.No_HID_devices_found
jmp 0x47dd25
mov edi, str.GetRawInputDeviceList_pRawInputDeviceList__failed
test esi, esi
jne 0x47dd1c
jmp 0x47dd25
xor ebp, ebp
mov dword [esp + 0x1c], esi
jmp 0x47d4ed
push dword [esp + 0x40]
push dword [esp + 0x40]
push str.Unknown_gamepad__04X__04X
push esi
call fcn.00472810
add esp, 0x10
xor edi, edi
mov esi, ebx
lea eax, [edi + 1]
cmp eax, 2
jae 0x47d61a
nop word cs:[eax + eax]
mov eax, dword [esp + 0x18]
inc ebp
cmp ebp, eax
jae 0x47dd1a
cmp dword [esi + ebp*8 + 4], 2
jne 0x47d4e4
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 0x47d4e0
cmp word [esp + 0x48], 1
jne 0x47d4e0
cmp word [esp + 0x4a], 5
jne 0x47d4e0
push 0x208
push 0
lea ebx, [esp + 0x26c]
push ebx
call sub.api_ms_win_crt_string_l1_1_0.dll_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 0x47d4e0
mov edi, dword [esp + 0x480]
mov eax, dword [edi]
mov ecx, dword [edi + 8]
cmp ecx, dword [edi + 0xc]
jne 0x47d594
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 sub.api_ms_win_crt_heap_l1_1_0.dll_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 0x47d626
cmp edi, 0x54c
je 0x47d647
cmp edi, 0x57e
jne case.0x47d609.8200
add edx, 0xffffdffa
cmp edx, 0x11
ja case.0x47d609.8200
jmp dword [edx*4 + 0x4fa6e0]
mov ebx, str.Nintendo_Switch_Joycon_L
jmp 0x47d8a6
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x47d4e0
lea edi, [edx - 0xc216]
cmp edi, 0xa
jae case.0x47d609.8200
mov ebx, 0x38d
bt ebx, edi
jae case.0x47d609.8200
mov ebx, dword [edx*4 + 0x4c9e60]
jmp 0x47d8a6
cmp edx, 0xb9f
jg 0x47d679
cmp edx, 0x268
je 0x47d88c
cmp edx, 0x5c4
je 0x47d893
cmp edx, 0x9cc
jne case.0x47d609.8200
mov ebx, str.Sony_DualShock_4_Gen2
jmp 0x47d8a6
cmp edx, 0xba0
je 0x47d89a
cmp edx, 0xce6
je 0x47d8a1
cmp edx, 0xdf2
jne case.0x47d609.8200
mov ebx, str.Sony_DualSense_Edge
jmp 0x47d8a6
mov ebx, esi
lea esi, [eax + ecx]
add esi, 0xc
sub esp, 0x1c
movaps xmm0, xmmword [0x4fa480]
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 0x47d4ae
mov edi, eax
mov dword [esp + 0x10], esi
push 0xfc
lea eax, [esp + 0x6c]
push eax
push edi
call sub.hid.dll_HidD_GetProductString
test al, al
mov esi, ebx
je 0x47dac3
push 0xfc
mov eax, edi
lea edi, [esp + 0x16c]
push edi
mov dword [esp + 0x10], eax
push eax
call sub.hid.dll_HidD_GetManufacturerString
test al, al
je 0x47d788
push edi
call sub.api_ms_win_crt_string_l1_1_0.dll_wcslen
add esp, 4
push edi
push eax
push dword [esp + 0x18]
call fcn.00485cd0
add esp, 0xc
lea edi, [esp + 0x68]
push edi
call sub.api_ms_win_crt_string_l1_1_0.dll_wcslen
add esp, 4
test eax, eax
je 0x47d7ac
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 0x47d7f0
mov ecx, dword [0x5052b0]
jmp 0x47d7fe
lea edi, [esp + 0x68]
push edi
call sub.api_ms_win_crt_string_l1_1_0.dll_wcslen
add esp, 4
push edi
push eax
push dword [esp + 0x18]
call fcn.00485cd0
add esp, 0xc
mov edi, dword [esp + 8]
jmp 0x47dac3
mov dword [esp + 0xc], 0
mov ebx, dword [0x5052b0]
mov dword [esp + 0x24], 0
mov edi, dword [esp + 8]
jmp 0x47d824
mov ebx, str.Nintendo_Switch_Joycon_R
jmp 0x47d8a6
mov ebx, str.Nintendo_Switch_Pro_Controller
jmp 0x47d8a6
mov ebx, str.Nintendo_Switch_Charging_Grip
jmp 0x47d8a6
mov ebx, str.Nintendo_Switch_SNES_Controller
jmp 0x47d8a6
push eax
call sub.api_ms_win_crt_heap_l1_1_0.dll_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 0x47d83c
lea ecx, [ebx + 1]
cmp eax, ecx
jne 0x47d881
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 0x47d850
test eax, eax
je 0x47d95e
push ebx
mov edi, esi
mov esi, dword [esp + 4]
push dword [esi + 0x14]
call sub.api_ms_win_crt_heap_l1_1_0.dll_realloc
add esp, 8
mov edx, eax
mov dword [esi + 0x14], eax
mov ecx, dword [esi + 0x10]
mov esi, edi
jmp 0x47d996
mov eax, dword [esp]
mov eax, dword [eax + 0x14]
jmp 0x47d9a5
mov ebx, str.Sony_DualShock_3___Six_Axis
jmp 0x47d8a6
mov ebx, str.Sony_DualShock_4_Gen1
jmp 0x47d8a6
mov ebx, str.Sony_DualShock_4_USB_receiver
jmp 0x47d8a6
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 sub.api_ms_win_crt_string_l1_1_0.dll_strlen
add esp, 4
test eax, eax
je 0x47d91e
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 0x47d8e0
push ebx
call sub.api_ms_win_crt_heap_l1_1_0.dll_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 sub.api_ms_win_crt_private_l1_1_0.dll_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 [0x4fa480]
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 0x47dac3
xor edi, edi
jmp 0x47d4c8
push ebx
call sub.api_ms_win_crt_heap_l1_1_0.dll_malloc
add esp, 4
mov ecx, dword [esp + 4]
test ecx, ecx
je 0x47dcef
mov edi, eax
lea eax, [ecx + 1]
push eax
mov esi, dword [esp + 4]
push dword [esi + 0x14]
push edi
call sub.api_ms_win_crt_private_l1_1_0.dll_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 0x47dab3
cmp dword [esp + 0xc], 0
je 0x47dab3
mov ecx, dword [esp]
mov eax, dword [ecx + 0xc]
mov ebx, dword [ecx + 0x10]
test eax, eax
je 0x47d9e9
mov ecx, ebx
not ecx
add ecx, eax
cmp ecx, dword [esp + 0xc]
jae 0x47da3e
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 0x47da10
test eax, eax
je 0x47da46
push ebx
mov edi, esi
mov esi, dword [esp + 4]
push dword [esi + 0x14]
call sub.api_ms_win_crt_heap_l1_1_0.dll_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 0x47da7a
mov eax, dword [esp]
mov ecx, dword [eax + 0x14]
jmp 0x47da8c
push ebx
call sub.api_ms_win_crt_heap_l1_1_0.dll_malloc
add esp, 4
mov ecx, eax
mov eax, dword [esp + 4]
test eax, eax
je 0x47dd05
inc eax
push eax
mov esi, dword [esp + 4]
push dword [esi + 0x14]
push ecx
mov edi, ecx
call sub.api_ms_win_crt_private_l1_1_0.dll_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 sub.api_ms_win_crt_private_l1_1_0.dll_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 0x47dac3
push edx
call sub.api_ms_win_crt_heap_l1_1_0.dll_free
add esp, 4
mov dword [esp + 0x20], 0
lea eax, [esp + 0x20]
push eax
push edi
call sub.hid.dll_HidD_GetPreparsedData
test al, al
je 0x47d4c8
lea eax, [esp + 0x168]
push eax
push dword [esp + 0x24]
call sub.hid.dll_HidP_GetCaps
mov ebx, eax
push dword [esp + 0x20]
call sub.hid.dll_HidD_FreePreparsedData
test ebx, ebx
js 0x47d4c8
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 sub.hid.dll_HidD_GetSerialNumberString
test al, al
je 0x47dbaa
push ebx
call sub.api_ms_win_crt_string_l1_1_0.dll_wcslen
add esp, 4
push ebx
push eax
push dword [esp + 8]
call fcn.00485cd0
add esp, 0xc
mov eax, dword [esp + 0x3c]
cmp eax, 0x54c
jne 0x47dbcc
mov eax, dword [esp + 0x40]
cmp eax, 0x5c4
je 0x47dbe5
cmp eax, 0x9cc
je 0x47dbe5
jmp 0x47d4c8
cmp eax, 0x57e
jne 0x47d4c8
cmp dword [esp + 0x40], 0x2009
jne 0x47d4c8
movzx ebx, word [esp + 0x16c]
push ebx
call sub.api_ms_win_crt_heap_l1_1_0.dll_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 0x47dc7a
cmp dword [esp + 0x3c], 0x54c
mov eax, dword [esp + 0x28]
jne 0x47dc90
cmp eax, 0x20
jb 0x47dcbc
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 0x47dcc4
push 0x64
push edi
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
test eax, eax
je 0x47dcd2
push edi
call dword [sym.imp.KERNEL32.dll_CancelIo]
jmp 0x47dcbc
cmp eax, 4
jb 0x47dcbc
cmp byte [ebx], 0x30
jne 0x47dcc4
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 0x47dd13
mov cl, 0x64
cmp al, 8
ja 0x47dc72
jmp 0x47dcc4
test ebx, ebx
je 0x47d4c8
push ebx
call sub.api_ms_win_crt_heap_l1_1_0.dll_free
add esp, 4
jmp 0x47d4c8
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 0x47dc21
jmp 0x47dc87
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 0x47d99a
mov byte [ecx], 0
mov eax, dword [esp]
mov dword [eax + 0x14], ecx
jmp 0x47da7e
mov cl, 1
jmp 0x47dc72
xor edi, edi
push esi
call sub.api_ms_win_crt_heap_l1_1_0.dll_free
add esp, 4
mov eax, edi
add esp, 0x46c
pop esi
pop edi
pop ebx
pop ebp
ret