Function at 0x140012c60
Capabilities:
Write file on windows

Disassembly:
mov r11, rsp
sub rsp, 0x2d8
mov rax, qword [0x140050010]
xor rax, rsp
mov qword [rsp + 0x2a0], rax
mov r8, qword [0x140108af0]
cmp dword [r8 + 0x12ca2f8], 1
je 0x140013322
cmp dword [r8 + 0x4174778], 1
mov qword [r11 + 8], rbx
mov qword [r11 + 0x10], rbp
mov qword [r11 + 0x18], rsi
mov qword [r11 - 8], rdi
mov qword [r11 - 0x10], r12
mov qword [r11 - 0x18], r13
mov qword [r11 - 0x20], r14
mov qword [r11 - 0x28], r15
jne 0x140012dea
mov ecx, 0xe00038
call fcn.14001db7c
xor edx, edx
mov qword [rsp + 0x38], rax
mov r8d, 0xe00038
mov rcx, rax
mov rbx, rax
call fcn.14001f1a0
mov r8, qword [0x140108af0]
lea r13, vtable.CLocalRs232.0
xor edi, edi
mov qword [rbx], r13
mov qword [rbx + 0xe00028], rdi
lea rdx, str.._s
mov qword [rbx + 0xe00030], rdi
lea rcx, [rsp + 0xa0]
mov qword [rbx + 0xc], rdi
mov dword [rbx + 8], 1
mov qword [rbx + 0xe0001c], rdi
mov dword [rbx + 0x14], edi
mov dword [rbx + 0xe00018], edi
mov qword [r8 + 0x4174770], rbx
add r8, 0x4174758
call fcn.140001190
mov rcx, qword [0x140108af0]
lea rdx, [rsp + 0xa0]
mov r8d, dword [rcx + 0x4174768]
mov rcx, qword [rcx + 0x4174770]
call fcn.140017140
mov rcx, qword [0x140108af0]
cmp eax, 1
jne 0x140012d7c
mov dword [rcx + 0x12ca2f8], eax
lea rdx, str._s_opened
jmp 0x140012da9
mov r8, qword [rcx + 0x4174770]
test r8, r8
je 0x140012d9c
mov rax, qword [r8]
mov edx, 1
mov rcx, r8
call qword [rax]
mov rcx, qword [0x140108af0]
mov dword [rcx + 0x12ca2f8], edi
lea rdx, str.Can_not_open__s
or dword [rcx + 0xbb0b44], 0x20
lea r8, [rcx + 0x4174758]
add rcx, 0xbb0a44
call fcn.140001190
mov r11, qword [0x140108af0]
or dword [r11 + 0xbb0b44], 0x10
cmp dword [r11 + 0x12ca2f8], 1
jne 0x1400132ab
mov r15d, dword [rsp + 0x38]
jmp 0x14001312b
add r8, 0x4174758
lea rdx, str.._s
lea rcx, [rsp + 0x1a0]
call fcn.140001190
mov r9d, 0xa
lea rdx, str.V_0_0_0_c_c
lea rcx, [rsp + 0x60]
lea r8d, [r9 + 3]
call fcn.140001190
lea rax, [rsp + 0x60]
mov rbp, 0xffffffffffffffff
nop dword [rax]
inc rbp
cmp byte [rax + rbp], 0
jne 0x140012e30
lea r12, [0x1400480a8]
xor edi, edi
lea r13, vtable.CLocalRs232.0
nop dword [rax]
mov ecx, 0xe00038
call fcn.14001db7c
xor edx, edx
mov qword [rsp + 0x30], rax
mov r8d, 0xe00038
mov rcx, rax
mov rbx, rax
call fcn.14001f1a0
mov rax, qword [0x140108af0]
lea rdx, [rsp + 0x1a0]
mov r15d, dword [r12]
mov rcx, rbx
mov qword [rbx], r13
mov r8d, r15d
mov qword [rbx + 0xe00028], rdi
mov qword [rbx + 0xe00030], rdi
mov qword [rbx + 0xc], rdi
mov dword [rbx + 8], 1
mov qword [rbx + 0xe0001c], rdi
mov dword [rbx + 0x14], edi
mov dword [rbx + 0xe00018], edi
mov qword [rax + 0x4174770], rbx
call fcn.140017140
cmp eax, 1
jne 0x140013287
mov rcx, qword [0x140108af0]
lea rdx, str.comm_speed_check__d_bps
mov r8d, r15d
mov dword [rcx + 0x12ca2f8], eax
add rcx, 0xbb0a44
call fcn.140001190
mov r11, qword [0x140108af0]
or dword [r11 + 0xbb0b44], 0x10
cmp dword [r11 + 0x12ca2f8], 1
jne 0x140013077
mov rbx, qword [r11 + 0x4174770]
cmp dword [rbx + 8], 1
je 0x140012f45
mov rcx, qword [rbx + 0xe00028]
lea r9, [rsp + 0x38]
mov r8d, ebp
mov qword [rsp + 0x20], rdi
lea rdx, [rsp + 0x60]
call qword [sym.imp.KERNEL32.dll_WriteFile]
mov r11, qword [0x140108af0]
mov dword [rbx + 0xe00020], edi
cmp dword [r11 + 0x12ca2f8], 1
jne 0x140013077
mov rbx, qword [r11 + 0x4174770]
lea r14, [r11 + 0xbb12e0]
cmp dword [rbx + 8], 1
jne 0x140012f6f
mov byte [r14], dil
jmp 0x140013077
call qword [sym.imp.WINMM.dll_timeGetTime]
mov esi, eax
call qword [sym.imp.WINMM.dll_timeGetTime]
movsxd rdx, dword [rbx + 0xe0001c]
cmp dword [rbx + 0xe00018], edx
jne 0x140012fa6
sub eax, esi
cmp eax, 0x1f4
ja 0x140013070
mov ecx, 1
call qword [sym.imp.KERNEL32.dll_Sleep]
jmp 0x140012f77
sub eax, dword [rbx + 0xe00024]
cmp eax, 0x14
jae 0x140012fbe
mov ecx, 1
call qword [sym.imp.KERNEL32.dll_Sleep]
jmp 0x140012f77
mov esi, edi
mov r8, rdx
nop dword [rax]
nop word [rax + rax]
movzx eax, byte [r8 + rbx + 0x700018]
lea ecx, [rdx + 1]
mov byte [r14], al
lea r14, [r14 + 1]
inc esi
lea rax, [r8 + 1]
cmp ecx, 0x700000
mov edx, edi
mov r8, rdi
cmovb edx, ecx
cmovb r8, rax
cmp edx, dword [rbx + 0xe00018]
jne 0x140012fd0
test esi, esi
jle 0x140013070
mov r9, qword [0x140108af0]
mov edx, edi
mov rcx, qword [r9 + 0x4174770]
mov r8d, dword [rcx + 0xe00018]
nop
mov eax, dword [rcx + 0xe0001c]
cmp r8d, eax
je 0x140013046
inc eax
mov dword [rcx + 0xe0001c], eax
cmp eax, 0x700000
jb 0x140013040
mov dword [rcx + 0xe0001c], edi
inc edx
cmp edx, esi
jl 0x140013020
lea rcx, [r9 + 0xbb12e0]
mov r8d, 4
lea rdx, str.B290
call fcn.140029b80
test eax, eax
je 0x14001310e
mov r11, qword [0x140108af0]
jmp 0x14001307e
mov r11, qword [0x140108af0]
mov dword [r11 + 0x12ca2f8], edi
mov rbx, qword [r11 + 0x4174770]
mov rax, qword [rbx + 0xe00028]
test rax, rax
je 0x1400130d8
cmp rax, 0xffffffffffffffff
je 0x1400130d8
mov dword [rbx + 0x10], 1
mov edx, 0xffffffff
mov rcx, qword [rbx + 0xe00030]
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov rcx, qword [rbx + 0xe00030]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rcx, qword [rbx + 0xe00028]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov r11, qword [0x140108af0]
mov qword [rbx + 0xe00028], rdi
mov rcx, qword [r11 + 0x4174770]
test rcx, rcx
je 0x1400130f5
mov rax, qword [rcx]
mov edx, 1
call qword [rax]
mov r11, qword [0x140108af0]
add r12, 4
lea rax, [0x1400480c8]
cmp r12, rax
jl 0x140012e50
jmp 0x1400132ab
mov rdx, qword [0x140108af0]
mov r8d, esi
add rdx, 0xbb12e0
call fcn.140010670
mov r11, qword [0x140108af0]
mov dword [r11 + 0x12ca2f8], 1
mov ebx, edi
mov dword [r11 + 0x4174768], r15d
or dword [r11 + 0xbb0b44], 0x20
nop word [rax + rax]
test byte [r11 + 0xbb0b44], 0x10
je 0x140013183
test dword [r11 + 0xbb0b48], 0x80000
jne 0x140013183
mov ecx, 1
call qword [sym.imp.KERNEL32.dll_Sleep]
mov r11, qword [0x140108af0]
inc ebx
cmp ebx, 0xbb8
jl 0x140013150
cmp dword [r11 + 0x12ca36c], 1
jne 0x140013205
mov ebx, dword [r11 + 0x4174698]
call fcn.14000f5a0
call fcn.14000f860
call fcn.14000ffd0
mov r11, qword [0x140108af0]
or dword [r11 + 0xbb0b44], 0x200
call fcn.140010720
cmp ebx, dword [r11 + 0x4174698]
je 0x1400131e1
movabs rax, 0x4053033333333333
mov dword [r11 + 0x14], 0x384
mov qword [r11 + 0x12ca330], rax
mov edi, 1
cmp dword [r11 + 0x12ca3cc], 0
jne 0x1400131f8
mov dword [r11 + 0x12ca664], 1
jmp 0x1400131fd
cmp edi, 1
jne 0x140013205
or dword [r11 + 0xbb0b44], 8
cmp dword [r11 + 0x12ca3cc], 1
lea rcx, [rsp + 0x40]
jne 0x140013222
lea rdx, str.USB_CDC_12M
call fcn.140001190
jmp 0x140013235
mov r8d, dword [r11 + 0x4174768]
lea rdx, str.RS485_UART__d
call fcn.140001190
mov rcx, qword [0x140108af0]
lea r9, [rsp + 0x40]
mov eax, 0x12ad4
mov edx, 0x13498
cmp dword [rcx + 0x4174698], 1
lea r8, [rcx + 0x4174758]
cmovne eax, edx
add rcx, 0xbb0a44
lea rdx, str._s_opened___sbps___.1lfGHz
movd xmm0, eax
cvtdq2pd xmm0, xmm0
divsd xmm0, qword [0x1400494b8]
movsd qword [rsp + 0x20], xmm0
call fcn.140001190
jmp 0x1400132d4
mov r11, qword [0x140108af0]
mov rcx, qword [r11 + 0x4174770]
test rcx, rcx
je 0x1400132ab
mov rax, qword [rcx]
mov edx, 1
call qword [rax]
mov r11, qword [0x140108af0]
mov dword [r11 + 0x12ca2f8], edi
lea r8, [r11 + 0x4174758]
or dword [r11 + 0xbb0b44], 0x20
lea rcx, [r11 + 0xbb0a44]
lea rdx, str.Can_not_open__s
call fcn.140001190
mov rax, qword [0x140108af0]
mov r14, qword [rsp + 0x2b8]
mov r13, qword [rsp + 0x2c0]
mov r12, qword [rsp + 0x2c8]
or dword [rax + 0xbb0b44], 0x10
mov rdi, qword [rsp + 0x2d0]
mov rsi, qword [rsp + 0x2f0]
mov rbp, qword [rsp + 0x2e8]
mov rbx, qword [rsp + 0x2e0]
mov r15, qword [rsp + 0x2b0]
mov rcx, qword [rsp + 0x2a0]
xor rcx, rsp
call fcn.14001d8d0
add rsp, 0x2d8
ret