Function at 0x10003970
Capabilities:
Read file on windows

Disassembly:
push ebp
xor ecx, ecx
mov ebp, esp
xor edx, edx
push edi
xor edi, edi
push esi
xor esi, esi
push ebx
xor ebx, ebx
sub esp, 0x10c
xor eax, eax
mov dword [ebp - 0xd4], ecx
mov dword [ebp - 0xd8], ebx
mov dword [ebp - 0xdc], esi
mov dword [ebp - 0xe0], edi
mov dword [ebp + eax - 0x54], edx
mov dword [ebp + eax - 0x50], edx
add eax, 8
cmp eax, 0x18
jb 0x100039a0
mov dword [ebp - 0x5c], 0x20
xor edx, edx
xor eax, eax
mov dword [ebp - 0x58], 5
mov dword [ebp - 0x50], 0x6c53d5fd
mov dword [ebp - 0x4c], 0x440f6480
mov dword [ebp - 0x48], 0x674718b6
mov dword [ebp - 0x44], 0xa6e1c550
mov dword [ebp + eax - 0x38], edx
mov dword [ebp + eax - 0x34], edx
add eax, 8
cmp eax, 0x28
jb 0x100039de
mov dword [ebp + eax - 0x38], 0
mov eax, dword [0x1000c010]
mov edi, 0x102
mov dword [esp + 4], str.wine_xinput_hid_update
mov esi, 1
mov dword [esp], 0xfffffffe
mov dword [ebp - 0x3c], 0x30
mov dword [ebp - 0x34], sym._xinput_devnotify_wndproc_16
mov dword [ebp - 0x28], eax
mov dword [ebp - 0x14], str.__wine_xinput_devnotify
call dword [sym.imp.kernel32.dll_SetThreadDescription]
push eax
push eax
lea eax, [ebp - 0x3c]
mov dword [esp], eax
call dword [sym.imp.user32.dll_RegisterClassExW]
push eax
mov eax, dword [ebp - 0x14]
mov dword [esp + 0x2c], 0
mov dword [esp + 0x28], 0
mov dword [esp + 0x24], 0
mov dword [esp + 0x20], 0xfffffffd
mov dword [esp + 0x1c], 0
mov dword [esp + 0x18], 0
mov dword [esp + 0x14], 0
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp + 4], eax
mov dword [esp], 0
call dword [sym.imp.user32.dll_CreateWindowExW]
mov dword [ebp - 0xd0], eax
mov ecx, eax
sub esp, 0x30
mov dword [esp], ecx
lea eax, [ebp - 0x5c]
mov dword [esp + 8], 0
mov dword [esp + 4], eax
call dword [sym.imp.user32.dll_RegisterDeviceNotificationW]
mov dword [ebp - 0xe4], eax
sub esp, 0xc
call sym._update_controller_list
mov eax, dword [0x1000c00c]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_SetEvent]
push edx
lea esi, [esi]
lea edi, [edi]
cmp edi, 0x102
je 0x10003bbf
dec esi
cmp esi, edi
ja 0x10003bd2
mov edi, 0x100060a0
xor ebx, ebx
mov eax, dword [edi + 0x4c]
lea esi, [ebx + 1]
test eax, eax
je 0x10003b53
mov dword [esp], edi
call dword [sym.imp.kernel32.dll_EnterCriticalSection]
mov eax, dword [edi + 0x258]
sub esp, 4
test eax, eax
je 0x10003b47
mov dword [ebp + ebx*4 - 0xb8], edi
mov eax, dword [edi + 0x450]
mov dword [ebp + ebx*4 - 0xa4], eax
lea eax, [ebx + 2]
mov ebx, esi
mov esi, eax
mov dword [esp], edi
call dword [sym.imp.kernel32.dll_LeaveCriticalSection]
sub esp, 4
add edi, 0x508
cmp edi, 0x100074c0
jne 0x10003b0c
mov eax, dword [0x1000c008]
mov edx, 0x1cff
mov ecx, 0x7d0
mov dword [esp + 0xc], edx
mov dword [esp + 8], ecx
mov dword [esp], esi
mov dword [ebp + ebx*4 - 0xa4], eax
mov eax, 2
mov dword [esp + 0x10], eax
lea eax, [ebp - 0xa4]
mov dword [esp + 4], eax
call dword [sym.imp.user32.dll_MsgWaitForMultipleObjectsEx]
sub esp, 0x14
cmp eax, esi
mov edi, eax
jbe 0x10003c90
cmp eax, 0x102
jne 0x10004120
cmp esi, 0x102
je 0x10003c96
call sym._update_controller_list
mov edi, 0x102
dec esi
cmp esi, edi
jbe 0x10003b05
mov ebx, dword [ebp + edi*4 - 0xb8]
mov edi, 1
mov eax, dword [ebx + 0x468]
movzx esi, word [ebx + 0x264]
mov dword [esp + 0xc], edi
mov dword [ebp - 0xc8], eax
lea eax, [ebx + 0x454]
mov dword [ebp - 0xcc], eax
mov ecx, eax
mov dword [esp + 4], ecx
lea eax, [ebp - 0xc4]
mov dword [esp + 8], eax
mov eax, dword [ebx + 0x4c]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_GetOverlappedResult]
sub esp, 0x10
test eax, eax
jne 0x10003cf0
mov eax, dword fs:[0x18]
cmp dword [eax + 0x34], 0x3e3
je 0x10003b05
cmp dword [eax + 0x34], 5
je 0x10004110
cmp dword [eax + 0x34], 6
je 0x10004110
test byte [0x100074c0], 2
je 0x10003b05
mov eax, dword [eax + 0x34]
mov dword [esp + 0xc], str.Failed_to_read_input_report__GetOverlappedResult_failed_with_error__lu_n
mov dword [esp + 8], str.read_controller_state
mov dword [esp + 4], 0x100074c0
mov dword [esp + 0x10], eax
mov dword [esp], 1
call sym._wine_dbg_log.constprop.0
jmp 0x10003b05
jne 0x10003af0
mov dword [ebp - 0xc8], esi
lea ebx, [ebp - 0x78]
mov edi, esi
mov esi, dword [ebp - 0xd0]
jmp 0x10003cbc
mov dword [esp], ebx
call dword [sym.imp.user32.dll_DispatchMessageW]
sub esp, 4
mov dword [esp + 4], esi
mov eax, 1
mov dword [esp + 0x10], eax
xor eax, eax
mov dword [esp + 0xc], eax
xor eax, eax
mov dword [esp + 8], eax
mov dword [esp], ebx
call dword [sym.imp.user32.dll_PeekMessageW]
sub esp, 0x14
test eax, eax
jne 0x10003cb0
mov esi, dword [ebp - 0xc8]
jmp 0x10003af0
mov dword [esp + 0x1c], esi
mov eax, 0xb
mov edx, 9
mov dword [ebp - 0xc0], eax
mov eax, dword [ebp - 0xc8]
lea edi, [ebp - 0x8e]
mov dword [esp + 0x18], eax
mov eax, dword [ebx + 0x25c]
mov dword [esp + 0xc], edi
mov dword [esp + 4], edx
mov dword [esp], 0
mov dword [esp + 0x14], eax
lea eax, [ebp - 0xc0]
mov dword [esp + 0x10], eax
xor eax, eax
mov dword [esp + 8], eax
call sym._HidP_GetUsages_32
sub esp, 0x20
cmp eax, 0x110000
je 0x10003d59
test byte [0x100074c0], 4
jne 0x10004384
mov edx, dword [ebp - 0xc0]
test edx, edx
je 0x100044dd
lea ecx, [edi + edx*2]
mov eax, edi
xor edi, edi
nop
movzx edx, word [eax]
cmp edx, 0xb
ja case.0x10003d78.0
jmp dword [edx*4 + 0x10009988]
or edi, 0x400
lea esi, [esi]
lea edi, [edi]
add eax, 2
cmp eax, ecx
jne 0x10003d70
mov dword [esp + 0x1c], esi
mov eax, dword [ebp - 0xc8]
mov dword [esp + 0x18], eax
mov eax, dword [ebx + 0x25c]
mov dword [esp], 0
mov dword [esp + 0x14], eax
lea eax, [ebp - 0xbc]
mov dword [esp + 0x10], eax
mov eax, 0x39
mov dword [esp + 0xc], eax
xor eax, eax
mov dword [esp + 8], eax
mov eax, 1
mov dword [esp + 4], eax
call sym._HidP_GetUsageValue_32
sub esp, 0x20
cmp eax, 0x110000
je 0x1000417b
test byte [0x100074c0], 4
jne 0x10004357
mov eax, dword [ebp - 0xc8]
xor edx, edx
mov ecx, 1
mov dword [esp + 0x1c], esi
mov dword [esp + 0x18], eax
mov eax, dword [ebx + 0x25c]
mov dword [esp + 8], edx
mov dword [esp + 4], ecx
mov dword [esp], 0
mov dword [esp + 0x14], eax
lea eax, [ebp - 0xbc]
mov dword [esp + 0x10], eax
mov eax, 0x30
mov dword [esp + 0xc], eax
call sym._HidP_GetUsageValue_32
sub esp, 0x20
cmp eax, 0x110000
je 0x100043b1
test byte [0x100074c0], 4
jne 0x100042a3
mov dword [esp + 0x1c], esi
mov eax, dword [ebp - 0xc8]
mov dword [esp + 0x18], eax
mov eax, dword [ebx + 0x25c]
mov dword [esp], 0
mov dword [esp + 0x14], eax
lea eax, [ebp - 0xbc]
mov dword [esp + 0x10], eax
mov eax, 0x31
mov dword [esp + 0xc], eax
xor eax, eax
mov dword [esp + 8], eax
mov eax, 1
mov dword [esp + 4], eax
call sym._HidP_GetUsageValue_32
sub esp, 0x20
cmp eax, 0x110000
je 0x10004478
test byte [0x100074c0], 4
jne 0x10004276
mov eax, dword [ebp - 0xc8]
xor ecx, ecx
mov edx, 0x33
mov dword [esp + 0x1c], esi
mov dword [esp + 0x18], eax
mov eax, dword [ebx + 0x25c]
mov dword [esp + 0xc], edx
mov dword [esp + 8], ecx
mov dword [esp], 0
mov dword [esp + 0x14], eax
lea eax, [ebp - 0xbc]
mov dword [esp + 0x10], eax
mov eax, 1
mov dword [esp + 4], eax
call sym._HidP_GetUsageValue_32
sub esp, 0x20
cmp eax, 0x110000
je 0x1000444f
test byte [0x100074c0], 4
jne 0x10004249
mov dword [esp + 0x1c], esi
mov eax, dword [ebp - 0xc8]
mov dword [esp + 0x18], eax
mov eax, dword [ebx + 0x25c]
mov dword [esp], 0
mov dword [esp + 0x14], eax
lea eax, [ebp - 0xbc]
mov dword [esp + 0x10], eax
mov eax, 0x34
mov dword [esp + 0xc], eax
xor eax, eax
mov dword [esp + 8], eax
mov eax, 1
mov dword [esp + 4], eax
call sym._HidP_GetUsageValue_32
sub esp, 0x20
cmp eax, 0x110000
je 0x10004424
test byte [0x100074c0], 4
jne 0x1000432a
mov dword [esp + 0x1c], esi
mov eax, dword [ebp - 0xc8]
mov ecx, 0x35
mov dword [esp + 0x18], eax
mov eax, dword [ebx + 0x25c]
mov dword [esp + 0xc], ecx
mov dword [esp], 0
mov dword [esp + 0x14], eax
lea eax, [ebp - 0xbc]
mov dword [esp + 0x10], eax
xor eax, eax
mov dword [esp + 8], eax
mov eax, 1
mov dword [esp + 4], eax
call sym._HidP_GetUsageValue_32
sub esp, 0x20
cmp eax, 0x110000
je 0x100043ff
test byte [0x100074c0], 4
jne 0x100042fd
mov dword [esp + 0x1c], esi
mov eax, dword [ebp - 0xc8]
mov edx, 1
mov dword [esp + 0x18], eax
mov eax, dword [ebx + 0x25c]
mov dword [esp + 4], edx
mov dword [esp], 0
mov dword [esp + 0x14], eax
lea eax, [ebp - 0xbc]
mov dword [esp + 0x10], eax
mov eax, 0x32
mov dword [esp + 0xc], eax
xor eax, eax
mov dword [esp + 8], eax
call sym._HidP_GetUsageValue_32
sub esp, 0x20
cmp eax, 0x110000
je 0x100043da
test byte [0x100074c0], 4
jne 0x100042d0
mov dword [esp], ebx
call dword [sym.imp.kernel32.dll_EnterCriticalSection]
mov eax, dword [ebx + 0x258]
sub esp, 4
test eax, eax
jne 0x10004195
mov dword [esp], ebx
call dword [sym.imp.kernel32.dll_LeaveCriticalSection]
sub esp, 4
jmp 0x10003b05
or edi, 0x80
jmp case.0x10003d78.0
or edi, 0x40
jmp case.0x10003d78.0
or edi, 0x10
jmp case.0x10003d78.0
or edi, 0x20
jmp case.0x10003d78.0
or edi, 0x200
jmp case.0x10003d78.0
or edi, 0x100
jmp case.0x10003d78.0
or edi, 0x8000
jmp case.0x10003d78.0
or edi, 0x1000
jmp case.0x10003d78.0
or edi, 0x4000
jmp case.0x10003d78.0
or edi, 0x2000
jmp case.0x10003d78.0
mov eax, ebx
call sym._controller_destroy.constprop.0
jmp 0x10003b05
test byte [0x100074c0], 2
jne 0x100044a3
mov eax, dword [ebp - 0xe4]
mov dword [esp], eax
call dword [sym.imp.user32.dll_UnregisterDeviceNotification]
mov eax, dword [ebp - 0xd0]
sub esp, 4
mov dword [esp], eax
call dword [sym.imp.user32.dll_DestroyWindow]
mov eax, dword [0x1000c010]
sub esp, 4
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x14]
mov dword [esp], eax
call dword [sym.imp.user32.dll_UnregisterClassW]
mov eax, dword [0x1000c010]
sub esp, 8
mov dword [esp + 4], edi
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_FreeLibraryAndExitThread]
cmp dword [ebp - 0xbc], 8
ja case.0x1000418e.0
mov eax, dword [ebp - 0xbc]
jmp dword [eax*4 + 0x100099b8]
mov word [ebx + 0x30], di
movzx eax, byte [ebp - 0xe5]
mov ecx, 4
mov edi, dword [ebp - 0xcc]
inc dword [ebx + 0x2c]
mov byte [ebx + 0x32], al
movzx eax, byte [ebp - 0xe6]
mov byte [ebx + 0x33], al
mov eax, dword [ebp - 0xd4]
mov word [ebx + 0x34], ax
mov eax, dword [ebp - 0xd8]
mov word [ebx + 0x36], ax
mov eax, dword [ebp - 0xdc]
mov word [ebx + 0x38], ax
mov eax, dword [ebp - 0xe0]
mov word [ebx + 0x3a], ax
xor eax, eax
rep stosd dword es:[edi], eax
mov edi, dword [ebp - 0xcc]
mov eax, dword [ebx + 0x450]
mov dword [ebx + 0x464], eax
mov eax, dword [ebp - 0xc8]
mov dword [esp + 0x10], edi
mov dword [esp + 0xc], 0
mov dword [esp + 8], esi
mov dword [esp + 4], eax
mov eax, dword [ebx + 0x4c]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_ReadFile]
sub esp, 0x14
test eax, eax
jne 0x10004058
mov eax, dword fs:[0x18]
cmp dword [eax + 0x34], 0x3e5
je 0x10004058
mov eax, ebx
call sym._controller_destroy.constprop.0
jmp 0x10004058
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], str.HidP_GetUsageValue_HID_USAGE_PAGE_GENERIC___HID_USAGE_GENERIC_RX_returned__lx_n
mov dword [esp + 8], str.read_controller_state
mov dword [esp + 4], 0x100074c0
mov dword [esp], 2
call sym._wine_dbg_log.constprop.0
jmp 0x10003f1b
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], str.HidP_GetUsageValue_HID_USAGE_PAGE_GENERIC___HID_USAGE_GENERIC_Y_returned__lx_n
mov dword [esp + 8], str.read_controller_state
mov dword [esp + 4], 0x100074c0
mov dword [esp], 2
call sym._wine_dbg_log.constprop.0
jmp 0x10003eba
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], str.HidP_GetUsageValue_HID_USAGE_PAGE_GENERIC___HID_USAGE_GENERIC_X_returned__lx_n
mov dword [esp + 8], str.read_controller_state
mov dword [esp + 4], 0x100074c0
mov dword [esp], 2
call sym._wine_dbg_log.constprop.0
jmp 0x10003e59
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], str.HidP_GetUsageValue_HID_USAGE_PAGE_GENERIC___HID_USAGE_GENERIC_Z_returned__lx_n
mov dword [esp + 8], str.read_controller_state
mov dword [esp + 4], 0x100074c0
mov dword [esp], 2
call sym._wine_dbg_log.constprop.0
jmp 0x1000403e
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], str.HidP_GetUsageValue_HID_USAGE_PAGE_GENERIC___HID_USAGE_GENERIC_RZ_returned__lx_n
mov dword [esp + 8], str.read_controller_state
mov dword [esp + 4], 0x100074c0
mov dword [esp], 2
call sym._wine_dbg_log.constprop.0
jmp 0x10003fdd
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], str.HidP_GetUsageValue_HID_USAGE_PAGE_GENERIC___HID_USAGE_GENERIC_RY_returned__lx_n
mov dword [esp + 8], str.read_controller_state
mov dword [esp + 4], 0x100074c0
mov dword [esp], 2
call sym._wine_dbg_log.constprop.0
jmp 0x10003f7c
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], str.HidP_GetUsageValue_HID_USAGE_PAGE_GENERIC___HID_USAGE_GENERIC_HATSWITCH_returned__lx_n
mov dword [esp + 8], str.read_controller_state
mov dword [esp + 4], 0x100074c0
mov dword [esp], 2
call sym._wine_dbg_log.constprop.0
jmp case.0x1000418e.0
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], str.HidP_GetUsages_HID_USAGE_PAGE_BUTTON_returned__lx_n
mov dword [esp + 8], str.read_controller_state
mov dword [esp + 4], 0x100074c0
mov dword [esp], 2
call sym._wine_dbg_log.constprop.0
jmp 0x10003d59
mov eax, dword [ebp - 0xbc]
lea edx, [ebx + 0x2a0]
mov ecx, 0xffff8000
mov dword [esp], 0x7fff
call sym._scale_value
cwde
mov dword [ebp - 0xd4], eax
jmp 0x10003e59
mov eax, dword [ebp - 0xbc]
lea edx, [ebx + 0x330]
xor ecx, ecx
mov dword [esp], 0xff
call sym._scale_value
mov byte [ebp - 0xe5], al
jmp 0x1000403e
mov eax, dword [ebp - 0xbc]
lea edx, [ebx + 0x408]
xor ecx, ecx
mov dword [esp], 0xff
call sym._scale_value
mov byte [ebp - 0xe6], al
jmp 0x10003fdd
mov eax, dword [ebp - 0xbc]
lea edx, [ebx + 0x3c0]
mov ecx, 0xffff8000
mov dword [esp], 0x7fff
call sym._scale_value
not eax
cwde
mov dword [ebp - 0xe0], eax
jmp 0x10003f7c
mov eax, dword [ebp - 0xbc]
lea edx, [ebx + 0x378]
mov ecx, 0xffff8000
mov dword [esp], 0x7fff
call sym._scale_value
cwde
mov dword [ebp - 0xdc], eax
jmp 0x10003f1b
mov eax, dword [ebp - 0xbc]
lea edx, [ebx + 0x2e8]
mov ecx, 0xffff8000
mov dword [esp], 0x7fff
call sym._scale_value
not eax
cwde
mov dword [ebp - 0xd8], eax
jmp 0x10003eba
mov eax, dword fs:[0x18]
mov eax, dword [eax + 0x34]
mov dword [esp + 0x10], edi
mov dword [esp + 0xc], str.wait_failed_in_the_update_thread__ret__lu__error__lu_n
mov dword [esp + 8], str.hid_update_thread_proc
mov dword [esp + 0x14], eax
mov dword [esp + 4], 0x100074c0
mov dword [esp], 1
call sym._wine_dbg_log.constprop.0
jmp 0x1000412d
xor edi, edi
jmp 0x10003d97
or edi, 1
jmp case.0x1000418e.0
or edi, 9
nop
jmp case.0x1000418e.0
or edi, 8
jmp case.0x1000418e.0
or edi, 0xa
jmp case.0x1000418e.0
or edi, 2
jmp case.0x1000418e.0
or edi, 6
jmp case.0x1000418e.0
or edi, 4
jmp case.0x1000418e.0
or edi, 5
jmp case.0x1000418e.0