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

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x7c
mov eax, dword [ebp + 0xc]
mov edi, dword [ebp + 0xc]
mov eax, dword [eax]
mov esi, dword [edi + 0x2c]
lea eax, [eax + eax*2]
lea ebx, [edi + eax*4 + 0x54]
mov eax, dword [esi + 0x10]
lea edx, [esi + 0x18]
mov edi, dword [eax + 8]
mov dword [ebp - 0x60], eax
add eax, 0x40
mov dword [ebp - 0x68], edi
mov edi, dword [0x5bd228]
test edi, edi
je 0x4caed0
mov ecx, dword [0x5951bc]
mov dword [ebx + 0x20], 0
mov dword [ebx], ecx
mov ecx, dword [0x5951c0]
mov dword [ebx + 4], ecx
mov ecx, dword [0x5951c4]
mov dword [ebx + 8], ecx
mov ecx, dword [0x5951c8]
mov dword [ebx + 0xc], ecx
mov ecx, dword [0x5951cc]
mov dword [ebx + 0x10], ecx
mov ecx, dword [0x5951d0]
mov dword [ebx + 0x14], ecx
mov ecx, dword [ebx + 0x1c]
test ecx, ecx
je 0x4cab39
mov dword [esp], ecx
mov dword [ebp - 0x64], eax
mov dword [ebp - 0x5c], edx
call sym._free
mov eax, dword [ebp - 0x64]
mov edx, dword [ebp - 0x5c]
mov dword [ebx + 0x1c], 0
mov edi, dword [ebp + 0xc]
movzx edi, byte [edi + 0x31]
mov ecx, edi
call dbg.interface_by_endpoint
test eax, eax
mov dword [ebp - 0x5c], eax
js 0x4caeda
mov eax, dword [ebp - 0x5c]
mov dword [esp + 0x10], edi
mov dword [esp + 0xc], str.matched_endpoint__02X_with_interface__d
mov dword [esp + 8], str.hid_submit_bulk_transfer
mov dword [esp + 0x14], eax
mov dword [esp + 4], 4
mov dword [esp], 0
call dbg.usbi_log
mov eax, dword [ebp - 0x5c]
mov ecx, dword [esi + eax*8 + 0x20]
mov eax, dword [ebp + 0xc]
movzx eax, byte [eax + 0x31]
and eax, 0xffffff80
movzx edx, al
test edx, edx
jne 0x4cad27
lea esi, [ebp - 0x58]
mov dword [esp + 4], ecx
lea edi, [ebp - 0x30]
mov dword [esp], esi
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], 0
mov dword [esp + 8], 2
mov dword [ebp - 0x64], edx
call dbg.usbi_create_fd
mov ecx, 6
mov edx, dword [ebp - 0x64]
mov dword [ebp - 0x6c], edi
rep movsd dword es:[edi], dword [esi]
cmp dword [ebp - 0x30], 0
js 0x4caf07
mov eax, dword [ebp - 0x60]
mov eax, dword [eax + 0x354]
mov ecx, dword [eax + 0xc]
test ecx, ecx
je 0x4cad7f
mov eax, dword [ebp + 0xc]
mov esi, dword [eax + 0x3c]
lea edi, [esi + 1]
mov dword [esp + 4], edi
mov dword [esp], 1
mov dword [ebp - 0x64], edx
call sym._calloc
mov edx, dword [ebp - 0x64]
test eax, eax
mov dword [ebx + 0x1c], eax
je 0x4caf07
test edx, edx
mov dword [ebx + 0x24], esi
jne 0x4cad90
mov edi, dword [ebp - 0x60]
mov edx, dword [edi + 0x354]
mov edx, dword [edx + 0xc]
test edx, edx
jne 0x4cac3d
add eax, 1
mov edi, dword [ebp + 0xc]
mov edx, dword [edi + 0x4c]
mov ecx, dword [edi + 0x3c]
mov dword [esp], eax
mov dword [esp + 4], edx
mov dword [esp + 8], ecx
call sym._memcpy
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 + 0x14], eax
mov dword [esp + 4], 4
mov dword [esp], 0
call dbg.usbi_log
mov eax, dword [wfd.fd]
mov dword [esp + 8], esi
mov dword [esp + 0x10], eax
lea eax, [ebp - 0x34]
mov dword [esp + 0xc], eax
mov eax, dword [ebx + 0x1c]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x2c]
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
sub esp, 0x14
test eax, eax
je 0x4cadf1
mov eax, dword [ebx + 0x1c]
test eax, eax
je 0x4cacce
mov dword [esp], eax
call sym._free
mov dword [ebx + 0x1c], 0
mov edx, dword [ebp - 0x34]
test edx, edx
je 0x4cae33
xor eax, eax
cmp esi, edx
jb 0x4cae06
mov edx, dword [wfd.fd]
mov dword [edx], 0x104
mov ecx, dword [ebp - 0x34]
mov edx, dword [wfd.fd]
mov dword [edx + 4], ecx
mov edx, dword [ebp - 0x30]
movzx ecx, byte [ebp - 0x5c]
mov dword [ebx], edx
mov edx, dword [ebp - 0x2c]
mov byte [ebx + 0x18], cl
mov dword [ebx + 4], edx
mov edx, dword [wfd.fd]
mov dword [ebx + 8], edx
mov edx, dword [wfd.handle]
mov dword [ebx + 0xc], edx
mov edx, dword [wfd.overlapped]
mov dword [ebx + 0x10], edx
mov edx, dword [wfd.itransfer]
mov dword [ebx + 0x14], edx
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
lea esi, [ebp - 0x58]
mov dword [esp + 4], ecx
lea edi, [ebp - 0x30]
mov dword [esp], esi
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], 0
mov dword [esp + 8], 1
mov dword [ebp - 0x64], edx
call dbg.usbi_create_fd
mov ecx, 6
mov edx, dword [ebp - 0x64]
mov dword [ebp - 0x6c], edi
rep movsd dword es:[edi], dword [esi]
cmp dword [ebp - 0x30], 0
js 0x4caf07
mov eax, dword [ebp - 0x60]
mov eax, dword [eax + 0x354]
mov esi, dword [eax + 8]
test esi, esi
jne 0x4cabf5
mov eax, dword [ebp + 0xc]
mov eax, dword [eax + 0x3c]
lea esi, [eax + 1]
jmp 0x4cabfb
mov eax, dword [ebp + 0xc]
mov eax, dword [eax + 0x4c]
mov dword [ebx + 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 dbg.usbi_log
mov eax, dword [wfd.fd]
mov dword [esp + 8], edi
mov dword [esp + 0x10], eax
lea eax, [ebp - 0x34]
mov dword [esp + 0xc], eax
mov eax, dword [ebx + 0x1c]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x2c]
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_ReadFile]
sub esp, 0x14
test eax, eax
jne 0x4cacce
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x3e5
jne 0x4cae67
xor ax, ax
jmp 0x4cacf5
mov eax, dword [ebp - 0x68]
mov dword [esp + 0xc], str.OVERFLOW_
mov dword [esp + 8], str.hid_submit_bulk_transfer
mov dword [esp + 4], 1
mov dword [esp], eax
call dbg.usbi_log
mov eax, 0xfffffff8
jmp 0x4cace3
mov eax, dword [ebp - 0x68]
mov dword [esp + 0xc], str.program_assertion_failed___no_data_was_transferred
mov dword [esp + 8], str.hid_submit_bulk_transfer
mov dword [esp + 4], 1
mov dword [esp], eax
call dbg.usbi_log
mov edx, 1
mov dword [ebp - 0x34], 1
jmp 0x4cacd9
mov dword [esp], 0
call dbg.windows_error_str
mov dword [esp + 0xc], str.HID_transfer_failed:__s
mov dword [esp + 8], str.hid_submit_bulk_transfer
mov dword [esp + 4], 1
mov dword [esp + 0x10], eax
mov eax, dword [ebp - 0x68]
mov dword [esp], eax
call dbg.usbi_log
mov eax, dword [ebp - 0x6c]
mov dword [esp], eax
call dbg.usbi_free_fd
mov edx, dword [ebx + 0x1c]
mov eax, 0xffffffff
test edx, edx
je 0x4cad1f
mov dword [esp], edx
mov dword [ebp - 0x5c], eax
call sym._free
mov eax, dword [ebp - 0x5c]
mov dword [ebx + 0x1c], 0
jmp 0x4cad1f
mov eax, 0xfffffffd
jmp 0x4cad1f
mov eax, dword [ebp - 0x68]
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 dword [esp], eax
call dbg.usbi_log
mov eax, 0xfffffffb
jmp 0x4cad1f
mov eax, 0xfffffff5
jmp 0x4cad1f