Function at 0x5a2a50
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 [esi + 0x48]
mov dword [ebp - 0x20], eax
mov eax, dword [esi + 0x4c]
mov dword [ebp - 0x28], eax
mov eax, dword [eax + 0x24]
mov dword [ebp - 0x24], eax
mov eax, dword [0x743e14]
test eax, eax
je 0x5a2dc0
cmp byte [esi + 0x51], 0
js 0x5a2a8b
test byte [esi + 0x50], 8
jne 0x5a2dac
mov edi, dword [ebp - 0x20]
mov eax, dword [edi + 0x24]
mov dword [edi + 0x28], 0
test eax, eax
je 0x5a2aab
mov dword [esp], eax
call sym._free
mov dword [edi + 0x24], 0
mov eax, dword [ebp - 0x28]
movzx ecx, byte [esi + 0x51]
mov dword [ebp + 0xc], esi
mov dword [ebp - 0x1c], 0
lea edi, [eax + 0x3c]
mov eax, dword [ebp - 0x24]
add eax, 0x5c
mov esi, eax
mov eax, dword [edi]
sub eax, 1
cmp eax, 0xfffffffd
ja 0x5a2afc
mov edx, dword [esi]
test edx, edx
je 0x5a2afc
movsx ebx, byte [esi - 4]
test ebx, ebx
jle 0x5a2afc
cmp cl, byte [edx]
je 0x5a2b45
xor eax, eax
jmp 0x5a2af5
cmp cl, byte [edx + eax]
je 0x5a2b45
add eax, 1
cmp eax, ebx
jne 0x5a2af0
add dword [ebp - 0x1c], 1
add edi, 0x28
add esi, 0x1c
mov eax, dword [ebp - 0x1c]
cmp eax, 0x20
jne 0x5a2ac7
mov esi, dword [ebp + 0xc]
mov eax, dword [esi + 0x2c]
test eax, eax
je 0x5a2b1b
mov eax, dword [eax + 4]
mov dword [esp], eax
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
call sym._usbi_log
mov eax, 0xfffffffb
jmp 0x5a2c8a
mov esi, dword [ebp + 0xc]
mov eax, dword [esi + 0x2c]
test eax, eax
je 0x5a2b52
mov eax, dword [eax + 4]
mov edi, dword [ebp - 0x1c]
mov dword [esp], eax
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 + 0x14], edi
call sym._usbi_log
mov ebx, dword [ebp - 0x20]
mov eax, edi
mov byte [ebx + 0x20], al
lea eax, [edi + edi*4]
mov edi, dword [ebp - 0x28]
mov edi, dword [edi + eax*8 + 0x3c]
mov eax, dword [esi + 0x48]
mov dword [eax + 0x14], edi
mov eax, dword [esi + 0x48]
movzx edx, byte [esi + 0x51]
mov dword [ebp - 0x1c], eax
mov eax, dword [ebp - 0x24]
test dl, dl
mov eax, dword [eax + 0x3cc]
js 0x5a2d20
cmp byte [eax + 7], 0
je 0x5a2d2a
mov ebx, dword [esi + 0x5c]
lea eax, [ebx + 1]
mov dword [esp], 1
mov byte [ebp - 0x28], dl
mov dword [esp + 4], eax
mov dword [ebp - 0x2c], eax
call sym._calloc
mov ecx, dword [ebp - 0x20]
test eax, eax
mov dword [ecx + 0x24], eax
je 0x5a2db6
movzx edx, byte [ebp - 0x28]
mov dword [ecx + 0x2c], ebx
test dl, dl
js 0x5a2d35
mov edx, dword [ebp - 0x24]
mov edx, dword [edx + 0x3cc]
cmp byte [edx + 7], 0
je 0x5a2d10
mov edx, dword [esi + 0x5c]
mov ecx, dword [esi + 0x6c]
mov dword [esp], eax
mov dword [esp + 8], edx
mov dword [esp + 4], ecx
call sym._memcpy
mov eax, dword [ebp - 0x20]
mov eax, dword [eax + 0x24]
movzx edx, byte [eax]
mov eax, dword [esi + 0x2c]
test eax, eax
je 0x5a2d9a
mov eax, dword [eax + 4]
mov dword [esp], eax
mov dword [esp + 0x14], edx
mov dword [esp + 0x10], ebx
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
call sym._usbi_log
mov eax, dword [ebp - 0x1c]
mov dword [esp + 0xc], 0
mov dword [esp + 8], ebx
mov dword [esp + 0x10], eax
mov eax, dword [ebp - 0x20]
mov eax, dword [eax + 0x24]
mov dword [esp], edi
mov dword [esp + 4], eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
sub esp, 0x14
test eax, eax
je 0x5a2c92
xor eax, eax
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x3e5
je 0x5a2c88
mov dword [esp], 0
call sym._windows_error_str
mov edx, dword [esi + 0x2c]
test edx, edx
je 0x5a2da1
mov edx, dword [edx + 4]
mov dword [esp + 0x10], eax
mov dword [esp], edx
mov dword [esp + 0xc], str.HID_transfer_failed:__s
mov dword [esp + 8], str.hid_submit_bulk_transfer
mov dword [esp + 4], 1
call sym._usbi_log
mov esi, dword [ebp - 0x20]
mov eax, 0xffffffff
mov edx, dword [esi + 0x24]
test edx, edx
je 0x5a2c8a
mov dword [esp], edx
mov dword [ebp - 0x1c], eax
call sym._free
mov dword [esi + 0x24], 0
mov eax, dword [ebp - 0x1c]
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
add eax, 1
jmp 0x5a2c06
cmp byte [eax + 6], 0
jne 0x5a2bba
mov eax, dword [esi + 0x5c]
lea ebx, [eax + 1]
jmp 0x5a2bbd
mov eax, dword [esi + 0x6c]
mov dword [ecx + 0x28], eax
mov eax, dword [esi + 0x2c]
test eax, eax
je 0x5a2da8
mov eax, dword [eax + 4]
mov dword [esp], eax
mov dword [esp + 0x10], ebx
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
call sym._usbi_log
mov eax, dword [ebp - 0x1c]
mov dword [esp + 0xc], 0
mov dword [esp + 0x10], eax
mov eax, dword [ebp - 0x2c]
mov dword [esp + 8], eax
mov eax, dword [ebp - 0x20]
mov eax, dword [eax + 0x24]
mov dword [esp], edi
mov dword [esp + 4], eax
call dword [sym.imp.KERNEL32.dll_ReadFile]
sub esp, 0x14
jmp 0x5a2c84
xor eax, eax
jmp 0x5a2c33
xor edx, edx
jmp 0x5a2cb9
xor eax, eax
jmp 0x5a2d45
mov eax, 0xfffffff4
jmp 0x5a2c8a
mov eax, 0xfffffff5
jmp 0x5a2c8a
mov eax, 0xfffffffd
jmp 0x5a2c8a