Function at 0x4d9640
Capabilities:
Check if file exists

Disassembly:
push ebp
push ebx
push edi
push esi
sub esp, 0x78
mov edi, dword [esp + 0x90]
cmp byte [0x5d9fdc], 1
mov esi, 0xfffffffd
mov eax, dword [edi + 0x10]
mov ecx, dword [eax + 8]
mov dword [esp + 4], 0
mov dword [esp], ecx
jne 0x4d9a12
cmp dword [eax + 0x354], 0
je 0x4d99b4
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 0x4d9714
mov ecx, dword [ebp + 4]
cmp byte [ecx], 4
jne 0x4d9714
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 0x4d970c
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.004cd4b0
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]
cmp eax, 0xffffffff
je 0x4d9a1c
mov ecx, eax
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 0x4d96a0
lea eax, [esp + 0x2c]
mov dword [esp + 0x2c], 0xa
push eax
mov ebp, dword [esp + 0x10]
push ebp
call dword [0x5d9fa0]
test eax, eax
je 0x4d99d3
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 dword [eax]
mov esi, ecx
push ecx
push ebp
call dword [0x5d9fbc]
lea ecx, [esi + esi]
test eax, eax
jne 0x4d9770
shr esi, 1
push esi
push str.set_maximum_input_buffer_size_to__d
push str.hid_open
push 4
push 0
call fcn.004cd4b0
add esp, 0x14
lea eax, [esp + 4]
push eax
push ebp
call dword [0x5d9fa4]
test eax, eax
je 0x4d99e2
mov eax, dword [esp + 4]
test eax, eax
je 0x4d99e2
lea ecx, [esp + 0x38]
push ecx
push eax
call dword [0x5d9fb8]
cmp eax, 0x110000
jne 0x4d99e9
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 0x4d97f6
mov eax, dword [esp + edi*4 + 0x24]
mov edi, ecx
mov ecx, dword [edi*4 + 0x5b3850]
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.004cd4b0
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 0x4d9941
push 0x48
push eax
call sub.msvcrt.dll_calloc
add esp, 8
test eax, eax
mov dword [esp + 0x10], edi
mov dword [esp + 0x18], eax
je 0x4d9910
lea esi, [esp + edi*4 + 0x20]
push dword [esp + 4]
push esi
push eax
push edi
call dword [0x5d9fd8]
mov ecx, dword [esp + 0x18]
cmp eax, 0x110000
jne 0x4d9910
mov eax, dword [esi]
test eax, eax
je 0x4d9910
jle 0x4d9938
mov eax, esi
lea esi, [ecx + 2]
xor edi, edi
xor ebp, ebp
xor ebx, ebx
mov dword [esp + 0x1c], eax
nop dword [eax]
movzx eax, byte [esi]
push eax
push str.__Report_ID:_0x_02X
push str.hid_open
push 4
push 0
call fcn.004cd4b0
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 0x4d9890
test ebp, ebp
mov ebx, dword [esp + 8]
mov ebp, dword [esp + 0xc]
je 0x4d992c
test edi, edi
je 0x4d98f3
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.004cd4b0
add esp, 0x14
mov eax, dword [ebx + 0x354]
mov ecx, dword [esp + 0x10]
mov dword [eax + ecx*4 + 8], 1
jmp 0x4d992c
push dword [esp + 0x14]
push str.__could_not_process__s_report_IDs
push str.hid_open
push 2
push dword [esp + 0x10]
call fcn.004cd4b0
add esp, 0x14
mov ecx, dword [esp + 0x18]
mov edi, dword [esp + 0x10]
test ecx, ecx
je 0x4d9941
push ecx
call fcn.00537860
add esp, 4
lea ecx, [edi + 1]
cmp ecx, 3
jne 0x4d97f0
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 0x4d9a68
add eax, 0x1a
push 0x100
push eax
push ebp
call dword [0x5d9fac]
jmp 0x4d9a6e
push str.program_assertion_failed___private_HID_structure_is_unitialized
push str.hid_open
push 1
push dword [esp + 0xc]
call fcn.004cd4b0
add esp, 0x10
mov esi, 0xfffffffb
jmp 0x4d9a12
push str.could_not_gain_access_to_HID_top_collection__HidD_GetAttributes_
push str.hid_open
push 1
push esi
jmp 0x4d99f9
push str.could_not_read_HID_preparsed_data__HidD_GetPreparsedData_
jmp 0x4d99ee
push str.could_not_parse_HID_capabilities__HidP_GetCaps_
push str.hid_open
push 1
push dword [esp + 0xc]
call fcn.004cd4b0
add esp, 0x10
mov eax, dword [esp + 4]
xor esi, esi
test eax, eax
je 0x4d9a12
push eax
call dword [0x5d9fa8]
mov eax, esi
add esp, 0x78
pop esi
pop edi
pop ebx
pop ebp
ret
mov eax, dword [esp + 8]
mov edi, esi
mov esi, dword [eax + 0x4c]
push 0
call fcn.004db2c0
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.004cd4b0
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 0x4d9a12
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 0x4d9aa3
add eax, 0x11a
push 0x100
push eax
push ebp
call dword [0x5d9fb0]
jmp 0x4d9aac
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 0x4d9ae4
add eax, 0x21a
push 0x100
push eax
push ebp
call dword [0x5d9fb4]
jmp 0x4d9a01
mov word [eax + 0x21a], 0
jmp 0x4d9a01