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

Disassembly:
mov byte [rsp + 0x20], r9b
mov qword [rsp + 0x18], r8
mov byte [rsp + 0x10], dl
mov qword [rsp + 8], rcx
push rdi
sub rsp, 0x160
mov dword [rsp + 0x38], 0
mov byte [rsp + 0x40], 3
mov byte [rsp + 0x41], 1
movzx eax, byte [rsp + 0x188]
add eax, 5
mov byte [rsp + 0x42], al
lea rax, [rsp + 0x43]
mov rdi, rax
xor eax, eax
mov ecx, SQLAllocHandle
rep stosb byte [rdi], al
lea rax, [rsp + 0x60]
mov rdi, rax
xor eax, eax
mov ecx, 0x100
rep stosb byte [rdi], al
movzx eax, byte [rsp + 0x188]
cmp eax, 0x12
jge 0x14001ac6c
mov eax, 1
imul rax, rax, 3
movzx ecx, byte [rsp + 0x178]
mov byte [rsp + rax + 0x40], cl
movzx eax, byte [rsp + 0x188]
lea rcx, [rsp + 0x44]
mov r8d, eax
mov rdx, qword [rsp + 0x180]
call fcn.140161160
mov byte [rsp + 0x30], 0
mov byte [rsp + 0x31], 0
jmp 0x14001a978
movzx eax, byte [rsp + 0x30]
inc al
mov byte [rsp + 0x30], al
movzx eax, byte [rsp + 0x30]
movzx ecx, byte [rsp + 0x188]
add ecx, 3
cmp eax, ecx
jge 0x14001a9a9
movzx eax, byte [rsp + 0x30]
inc eax
cdqe
movzx eax, byte [rsp + rax + 0x40]
movzx ecx, byte [rsp + 0x31]
xor ecx, eax
mov eax, ecx
mov byte [rsp + 0x31], al
jmp 0x14001a96d
movzx eax, byte [rsp + 0x188]
add eax, 4
cdqe
movzx ecx, byte [rsp + 0x31]
mov byte [rsp + rax + 0x40], cl
movzx eax, byte [rsp + 0x188]
add eax, 5
cdqe
mov byte [rsp + rax + 0x40], 4
mov edx, reloc.WLDAP32.dll_Ordinal_12
mov rcx, qword [rsp + 0x170]
call qword [sym.imp.KERNEL32.dll_PurgeComm]
mov ecx, 0x64
call qword [sym.imp.KERNEL32.dll_Sleep]
mov qword [rsp + 0x20], 0
lea r9, [rsp + 0x34]
mov r8d, reloc.ODBC32.dll_SQLAllocHandle
lea rdx, [rsp + 0x40]
mov rcx, qword [rsp + 0x170]
call qword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x14001ac58
mov eax, dword [rsp + 0x34]
cmp rax, 0x18
jne 0x14001ac58
xor r8d, r8d
xor edx, edx
mov rcx, qword [rsp + 0x170]
call qword [sym.imp.KERNEL32.dll_ClearCommError]
mov ecx, 0x64
call qword [sym.imp.KERNEL32.dll_Sleep]
mov qword [rsp + 0x20], 0
lea r9, [rsp + 0x34]
mov r8d, 0x100
lea rdx, [rsp + 0x60]
mov rcx, qword [rsp + 0x170]
call qword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x14001ac42
cmp dword [rsp + 0x34], 6
jb 0x14001ac30
mov eax, 1
imul rax, rax, 0
movzx eax, byte [rsp + rax + 0x60]
cmp eax, 5
jne 0x14001ac22
mov eax, 1
imul rax, rax, 1
movzx eax, byte [rsp + rax + 0x60]
cmp eax, 1
jne 0x14001ac22
mov eax, 1
imul rax, rax, 2
movzx eax, byte [rsp + rax + 0x60]
cmp eax, 5
jl 0x14001ac14
mov eax, 1
imul rax, rax, 3
movzx eax, byte [rsp + rax + 0x60]
movzx ecx, byte [rsp + 0x178]
bts ecx, 7
cmp eax, ecx
jne 0x14001ac14
mov eax, 1
imul rax, rax, 2
movzx eax, byte [rsp + rax + 0x60]
sub eax, 5
mov byte [rsp + 0x32], al
mov byte [rsp + 0x30], 0
mov byte [rsp + 0x31], 0
jmp 0x14001ab17
movzx eax, byte [rsp + 0x30]
inc al
mov byte [rsp + 0x30], al
movzx eax, byte [rsp + 0x30]
movzx ecx, byte [rsp + 0x32]
add ecx, 3
cmp eax, ecx
jge 0x14001ab45
movzx eax, byte [rsp + 0x30]
inc eax
cdqe
movzx eax, byte [rsp + rax + 0x60]
movzx ecx, byte [rsp + 0x31]
xor ecx, eax
mov eax, ecx
mov byte [rsp + 0x31], al
jmp 0x14001ab0c
movzx eax, byte [rsp + 0x32]
add eax, 4
cdqe
movzx eax, byte [rsp + rax + 0x60]
movzx ecx, byte [rsp + 0x31]
cmp eax, ecx
jne 0x14001ac06
movzx eax, byte [rsp + 0x32]
add eax, 5
cdqe
movzx eax, byte [rsp + rax + 0x60]
cmp eax, 4
jne 0x14001ac06
mov dword [rsp + 0x38], 1
movzx eax, byte [rsp + 0x32]
test eax, eax
je 0x14001ac04
cmp qword [rsp + 0x190], 0
je 0x14001ac04
cmp qword [rsp + 0x198], 0
je 0x14001ac04
mov rax, qword [rsp + 0x198]
movzx ecx, byte [rsp + 0x32]
mov byte [rax], cl
movzx eax, byte [rsp + 0x32]
mov edx, eax
mov ecx, 0x40
call qword [sym.imp.KERNEL32.dll_LocalAlloc]
mov rcx, qword [rsp + 0x190]
mov qword [rcx], rax
mov rax, qword [rsp + 0x190]
cmp qword [rax], 0
je 0x14001abfc
movzx eax, byte [rsp + 0x32]
lea rcx, [rsp + 0x64]
mov r8d, eax
mov rdx, rcx
mov rax, qword [rsp + 0x190]
mov rcx, qword [rax]
call fcn.140161160
jmp 0x14001ac04
mov dword [rsp + 0x38], 0
jmp 0x14001ac12
lea rcx, str.ERROR_sr98_send_receive___Bad_CRC_data_n
call fcn.140013fd0
jmp 0x14001ac20
lea rcx, str.ERROR_sr98_send_receive___Bad_data_size_ctl_code_n
call fcn.140013fd0
jmp 0x14001ac2e
lea rcx, str.ERROR_sr98_send_receive___Bad_header_n
call fcn.140013fd0
jmp 0x14001ac40
mov edx, dword [rsp + 0x34]
lea rcx, str.ERROR_sr98_send_receive___Read_size___u_n
call fcn.140013fd0
jmp 0x14001ac56
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, eax
lea rcx, str.ERROR_sr98_send_receive___ReadFile__0x_08x__n
call fcn.140013fd0
jmp 0x14001ac6c
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, eax
lea rcx, str.ERROR_sr98_send_receive___WriteFile__0x_08x__n
call fcn.140013fd0
mov eax, dword [rsp + 0x38]
add rsp, 0x160
pop rdi
ret