Function at 0x4e0310
Capabilities:
Check if file exists

Disassembly:
push ebp
push ebx
push edi
push esi
sub esp, 0x78
mov edi, dword [esp + 0x90]
cmp byte [0x5c510c], 1
mov esi, 0xfffffffd
mov eax, dword [edi + 0x10]
mov ecx, dword [eax + 8]
mov dword [esp + 4], 0
mov dword [esp], ecx
jne 0x4e07dc
cmp dword [eax + 0x354], 0
je 0x4e0684
mov esi, dword [esp]
lea ebp, [eax + 0x54]
xor ebx, ebx
mov dword [esp + 8], eax
mov dword [esp + 0xc], 0xffffffff
nop word cs:[eax + eax]
nop dword [eax]
mov eax, dword [ebp]
test eax, eax
je 0x4e03e6
mov ecx, dword [ebp + 4]
cmp byte [ecx], 4
jne 0x4e03e6
push 0
push 0x40000080
push 3
push 0
push 3
push 0xc0000000
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
cmp eax, 0xffffffff
jne 0x4e03de
push str.could_not_open_HID_device_in_R_W_mode__keyboard_or_mouse_____trying_without
push str.hid_open
push 2
push esi
call fcn.004d3fa0
add esp, 0x10
push 0
push 0x40000080
push 3
push 0
push 3
push 0
push dword [ebp]
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov ecx, eax
cmp eax, 0xffffffff
je 0x4e06fa
mov eax, ecx
mov dword [ebp + 0x14], 1
mov dword [esp + 0xc], eax
mov dword [edi + ebx*8 + 0x20], eax
inc ebx
add ebp, 0x18
cmp ebx, 0x20
jb 0x4e0370
lea eax, [esp + 0x2c]
mov dword [esp + 0x2c], 0xa
push eax
mov ebp, dword [esp + 0x10]
push ebp
call dword [0x5c50d0]
test eax, eax
je 0x4e06a6
mov ebx, dword [esp + 8]
movzx eax, word [esp + 0x30]
mov ecx, dword [ebx + 0x354]
mov word [ecx], ax
movzx eax, word [esp + 0x32]
mov ecx, dword [ebx + 0x354]
mov word [ecx + 2], ax
mov ecx, 0x20
nop word cs:[eax + eax]
nop
mov esi, ecx
push ecx
push ebp
call dword [0x5c50ec]
lea ecx, [esi + esi]
test eax, eax
jne 0x4e0440
shr esi, 1
push esi
push str.set_maximum_input_buffer_size_to__d
push str.hid_open
push 4
push 0
call fcn.004d3fa0
add esp, 0x14
lea eax, [esp + 4]
push eax
push ebp
call dword [0x5c50d4]
test eax, eax
je 0x4e06c0
mov eax, dword [esp + 4]
test eax, eax
je 0x4e06c0
lea ecx, [esp + 0x38]
push ecx
push eax
call dword [0x5c50e8]
cmp eax, 0x110000
jne 0x4e06dd
movzx eax, word [esp + 0x68]
movzx ecx, word [esp + 0x6e]
movzx edx, word [esp + 0x74]
xor edi, edi
mov dword [esp + 0x20], eax
mov dword [esp + 0x24], ecx
mov dword [esp + 0x28], edx
jmp 0x4e04c6
mov eax, dword [esp + edi*4 + 0x24]
mov edi, ecx
mov ecx, dword [edi*4 + 0x5a1884]
mov dword [esp + 0x14], ecx
push ecx
push eax
push str._u_HID__s_report_value_s__found
push str.hid_open
push 4
push 0
call fcn.004d3fa0
add esp, 0x18
mov eax, dword [ebx + 0x354]
mov dword [eax + edi*4 + 8], 0
mov eax, dword [esp + edi*4 + 0x20]
test eax, eax
je 0x4e0611
push 0x48
push eax
call sub.msvcrt.dll_calloc
add esp, 8
mov ecx, eax
test eax, eax
mov dword [esp + 0x10], edi
mov dword [esp + 0x18], eax
je 0x4e05e0
lea esi, [esp + edi*4 + 0x20]
push dword [esp + 4]
push esi
push ecx
push edi
call dword [0x5c5108]
mov ecx, dword [esp + 0x18]
cmp eax, 0x110000
jne 0x4e05e0
mov eax, dword [esi]
test eax, eax
je 0x4e05e0
jle 0x4e0608
mov eax, esi
lea esi, [ecx + 2]
xor edi, edi
xor ebp, ebp
xor ebx, ebx
mov dword [esp + 0x1c], eax
nop
movzx eax, byte [esi]
push eax
push str.__Report_ID:_0x_02X
push str.hid_open
push 4
push 0
call fcn.004d3fa0
add esp, 0x14
xor eax, eax
xor ecx, ecx
cmp byte [esi], 0
setne cl
sete al
inc ebx
add esi, 0x48
add ebp, ecx
mov ecx, dword [esp + 0x1c]
add edi, eax
cmp ebx, dword [ecx]
jl 0x4e0560
test ebp, ebp
mov ebx, dword [esp + 8]
mov ebp, dword [esp + 0xc]
je 0x4e05fc
test edi, edi
je 0x4e05c3
push dword [esp + 0x14]
push str.program_assertion_failed:_zero_and_nonzero_report_IDs_used_for__s
push str.hid_open
push 2
push dword [esp + 0x10]
call fcn.004d3fa0
add esp, 0x14
mov eax, dword [ebx + 0x354]
mov ecx, dword [esp + 0x10]
mov dword [eax + ecx*4 + 8], 1
jmp 0x4e05fc
push dword [esp + 0x14]
push str.__could_not_process__s_report_IDs
push str.hid_open
push 2
push dword [esp + 0x10]
call fcn.004d3fa0
add esp, 0x14
mov ecx, dword [esp + 0x18]
mov edi, dword [esp + 0x10]
test ecx, ecx
je 0x4e0611
push ecx
call fcn.00506b00
add esp, 4
lea ecx, [edi + 1]
cmp ecx, 3
jne 0x4e04c0
movzx eax, word [esp + 0x3c]
mov ecx, dword [ebx + 0x354]
mov word [ecx + 0x14], ax
movzx eax, word [esp + 0x3e]
mov ecx, dword [ebx + 0x354]
mov word [ecx + 0x16], ax
movzx eax, word [esp + 0x40]
mov ecx, dword [ebx + 0x354]
mov word [ecx + 0x18], ax
mov al, byte [ebx + 0x366]
mov ecx, dword [ebx + 0x354]
mov byte [ecx + 0x31a], al
mov eax, dword [ebx + 0x354]
cmp byte [eax + 0x31a], 0
je 0x4e0749
add eax, 0x1a
push 0x100
push eax
push ebp
call dword [0x5c50dc]
jmp 0x4e074f
push str.program_assertion_failed___private_HID_structure_is_unitialized
push str.hid_open
push 1
push dword [esp + 0xc]
call fcn.004d3fa0
add esp, 0x10
mov esi, 0xfffffffb
jmp 0x4e07dc
push str.could_not_gain_access_to_HID_top_collection__HidD_GetAttributes_
push str.hid_open
push 1
push esi
call fcn.004d3fa0
add esp, 0x10
jmp 0x4e07cb
push str.could_not_read_HID_preparsed_data__HidD_GetPreparsedData_
push str.hid_open
push 1
push dword [esp + 0xc]
call fcn.004d3fa0
add esp, 0x10
jmp 0x4e07cb
push str.could_not_parse_HID_capabilities__HidP_GetCaps_
push str.hid_open
push 1
push dword [esp + 0xc]
call fcn.004d3fa0
add esp, 0x10
jmp 0x4e07cb
mov eax, dword [esp + 8]
mov edi, esi
mov esi, dword [eax + 0x4c]
push 0
call fcn.004e2040
add esp, 4
push eax
push ebx
push esi
push str.could_not_open_device__s__interface__d_:__s
push str.hid_open
push 1
push edi
call fcn.004d3fa0
add esp, 0x1c
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 5
mov esi, 0xfffffffc
setne cl
add cl, cl
movzx ecx, cl
or ecx, 0xfffffffd
cmp eax, 2
cmovne esi, ecx
jmp 0x4e07dc
mov word [eax + 0x1a], 0
mov al, byte [ebx + 0x367]
mov ecx, dword [ebx + 0x354]
mov byte [ecx + 0x31b], al
mov eax, dword [ebx + 0x354]
cmp byte [eax + 0x31b], 0
je 0x4e0784
add eax, 0x11a
push 0x100
push eax
push ebp
call dword [0x5c50e0]
jmp 0x4e078d
mov word [eax + 0x11a], 0
mov al, byte [ebx + 0x368]
mov ecx, dword [ebx + 0x354]
mov byte [ecx + 0x31c], al
mov eax, dword [ebx + 0x354]
cmp byte [eax + 0x31c], 0
je 0x4e07c2
add eax, 0x21a
push 0x100
push eax
push ebp
call dword [0x5c50e4]
jmp 0x4e07cb
mov word [eax + 0x21a], 0
mov eax, dword [esp + 4]
xor esi, esi
test eax, eax
je 0x4e07dc
push eax
call dword [0x5c50d8]
mov eax, esi
add esp, 0x78
pop esi
pop edi
pop ebx
pop ebp
ret