Function at 0x6b812910
Capabilities:
Read file on windows
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x4c
mov esi, dword [ebp + 0xc]
mov eax, dword [ebp + 0xc]
mov edx, dword [0x6b820318]
mov esi, dword [esi + 0x48]
mov eax, dword [eax + 0x44]
test edx, edx
mov edi, dword [esi + 0x24]
mov dword [ebp - 0x20], eax
mov dword [ebp - 0x24], edi
je 0x6b812c39
mov edi, eax
mov dword [eax + 0x20], 0
mov eax, dword [eax + 0x1c]
test eax, eax
je 0x6b81295b
mov dword [esp], eax
call sym._free
mov dword [edi + 0x1c], 0
mov eax, dword [ebp + 0xc]
xor edi, edi
movzx ecx, byte [eax + 0x4d]
mov eax, dword [ebp - 0x24]
add eax, 0x74
mov dword [ebp - 0x1c], eax
mov eax, dword [esi + edi*8 + 0x34]
sub eax, 1
cmp eax, 0xfffffffd
ja 0x6b81299e
mov eax, dword [ebp - 0x1c]
mov edx, dword [eax]
test edx, edx
je 0x6b81299e
movsx ebx, byte [eax - 4]
test ebx, ebx
jle 0x6b81299e
cmp cl, byte [edx]
je 0x6b8129e3
xor eax, eax
jmp 0x6b812997
cmp cl, byte [edx + eax]
je 0x6b8129e3
add eax, 1
cmp eax, ebx
jne 0x6b812992
add edi, 1
add dword [ebp - 0x1c], 0x1c
cmp edi, 0x20
jne 0x6b81296d
mov eax, dword [ebp + 0xc]
mov dword [esp + 0xc], str.unable_to_match_endpoint_to_an_open_interface___cancelling_transfer
mov dword [esp + 8], str.hid_submit_bulk_transfer
mov dword [esp + 4], 1
mov eax, dword [eax + 0x48]
mov eax, dword [eax + 0x24]
mov eax, dword [eax + 0x1c]
mov dword [esp], eax
call sym.libusb_1.0.dll_usbi_log
lea esp, [ebp - 0xc]
mov eax, 0xfffffffb
pop ebx
pop esi
pop edi
pop ebp
ret
mov dword [esp + 0x14], edi
mov dword [esp + 0x10], ecx
mov dword [esp + 0xc], str.matched_endpoint__02X_with_interface__d
mov dword [esp + 8], str.hid_submit_bulk_transfer
mov dword [esp + 4], 4
mov dword [esp], 0
call sym.libusb_1.0.dll_usbi_log
mov eax, dword [esi + edi*8 + 0x34]
mov esi, eax
mov dword [ebp - 0x1c], eax
mov eax, dword [ebp + 0xc]
mov eax, dword [eax + 0x44]
mov dword [eax + 0x14], esi
mov eax, dword [ebp + 0xc]
mov eax, dword [eax + 0x44]
mov dword [ebp - 0x28], eax
mov eax, dword [ebp + 0xc]
movzx edx, byte [eax + 0x4d]
test dl, dl
js 0x6b812b30
mov eax, dword [ebp - 0x24]
mov eax, dword [eax + 0x3e4]
cmp byte [eax + 7], 0
je 0x6b812b43
mov eax, dword [ebp + 0xc]
mov esi, dword [eax + 0x58]
lea ebx, [esi + 1]
mov dword [esp], 1
mov byte [ebp - 0x2c], dl
mov dword [esp + 4], ebx
call sym._calloc
mov ecx, dword [ebp - 0x20]
test eax, eax
mov dword [ecx + 0x1c], eax
je 0x6b812c2f
movzx edx, byte [ebp - 0x2c]
mov dword [ecx + 0x24], esi
test dl, dl
js 0x6b812bcd
mov ebx, dword [ebp - 0x24]
mov edx, dword [ebx + 0x3e4]
cmp byte [edx + 7], 0
je 0x6b812b25
mov ebx, dword [ebp + 0xc]
mov ecx, dword [ebx + 0x68]
mov edx, dword [ebx + 0x58]
mov dword [esp], eax
mov dword [esp + 8], edx
mov dword [esp + 4], ecx
call sym._memcpy
mov ebx, dword [ebp - 0x20]
mov eax, dword [ebx + 0x1c]
movzx eax, byte [eax]
mov dword [esp + 0x10], esi
mov dword [esp + 0xc], str.writing__d_bytes__report_ID:_0x_02X_
mov dword [esp + 8], str.hid_submit_bulk_transfer
mov dword [esp + 4], 4
mov dword [esp], 0
mov dword [esp + 0x14], eax
call sym.libusb_1.0.dll_usbi_log
mov eax, dword [ebp - 0x28]
mov dword [esp + 0xc], 0
mov dword [esp + 8], esi
mov dword [esp + 0x10], eax
mov eax, dword [ebx + 0x1c]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x1c]
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
sub esp, 0x14
test eax, eax
je 0x6b812b54
mov esi, dword [ebp - 0x20]
mov eax, edi
mov byte [esi + 0x18], al
xor eax, eax
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
add eax, 1
jmp 0x6b812a98
mov eax, dword [ebp - 0x24]
mov eax, dword [eax + 0x3e4]
cmp byte [eax + 6], 0
jne 0x6b812a4c
mov eax, dword [ebp + 0xc]
mov eax, dword [eax + 0x58]
mov dword [ebp - 0x2c], eax
lea esi, [eax + 1]
jmp 0x6b812a52
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x3e5
je 0x6b812b13
mov dword [esp], 0
call sym._windows_error_str
mov dword [esp + 0x10], eax
mov eax, dword [ebp + 0xc]
mov dword [esp + 0xc], str.HID_transfer_failed:__s
mov dword [esp + 8], str.hid_submit_bulk_transfer
mov dword [esp + 4], 1
mov eax, dword [eax + 0x48]
mov eax, dword [eax + 0x24]
mov eax, dword [eax + 0x1c]
mov dword [esp], eax
call sym.libusb_1.0.dll_usbi_log
mov edi, dword [ebp - 0x20]
mov eax, 0xffffffff
mov edx, dword [edi + 0x1c]
test edx, edx
je 0x6b812b1d
mov dword [esp], edx
mov dword [ebp - 0x1c], eax
call sym._free
mov dword [edi + 0x1c], 0
mov eax, dword [ebp - 0x1c]
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
mov eax, dword [ebp + 0xc]
mov eax, dword [eax + 0x68]
mov dword [ecx + 0x20], eax
mov dword [esp + 0x10], esi
mov dword [esp + 0xc], str.reading__d_bytes__report_ID:_0x00_
mov dword [esp + 8], str.hid_submit_bulk_transfer
mov dword [esp + 4], 4
mov dword [esp], 0
call sym.libusb_1.0.dll_usbi_log
mov eax, dword [ebp - 0x28]
mov edx, dword [ebp - 0x20]
mov dword [esp + 0xc], 0
mov dword [esp + 8], ebx
mov dword [esp + 0x10], eax
mov eax, dword [edx + 0x1c]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x1c]
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_ReadFile]
sub esp, 0x14
jmp 0x6b812b0f
mov eax, 0xfffffff5
jmp 0x6b812b1d
mov eax, 0xfffffffd
jmp 0x6b812b1d