Function at 0x401180
Capabilities:
Write file on windows

Disassembly:
push ebx
mov ebx, esp
sub esp, 8
and esp, 0xfffffff8
add esp, 4
push ebp
mov ebp, dword [ebx + 4]
mov dword [esp + 4], ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x403303
mov eax, dword fs:[0]
push eax
push ebx
sub esp, 0xa0
mov eax, dword [0x406004]
xor eax, ebp
mov dword [ebp - 0x14], eax
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov esi, edx
mov edi, ecx
mov ecx, dword [sym.imp.MSVCP140.dll_class_std::basic_ostream_char__struct_std::char_traits_char___std::cout]
mov edx, str.move:
push 0x401dd0
push esi
push edi
call fcn.00401bb0
push ecx
mov edx, 0x4042dc
mov ecx, eax
call fcn.00401bb0
add esp, 4
mov ecx, eax
call dword [sym.imp.MSVCP140.dll_public:_class_std::basic_ostream_char__struct_std::char_traits_char______thiscall_std::basic_ostream_char__struct_std::char_traits_char__::operator___int_]
mov edx, 0x4042d8
mov ecx, eax
call fcn.00401bb0
mov edx, 0x4042d4
mov ecx, eax
call fcn.00401bb0
mov ecx, eax
call dword [sym.imp.MSVCP140.dll_public:_class_std::basic_ostream_char__struct_std::char_traits_char______thiscall_std::basic_ostream_char__struct_std::char_traits_char__::operator___int_]
mov ecx, eax
call dword [sym.imp.MSVCP140.dll_public:_class_std::basic_ostream_char__struct_std::char_traits_char______thiscall_std::basic_ostream_char__struct_std::char_traits_char__::operator___class_std::basic_ostream_char__struct_std::char_traits_char_______cdecl___class_std::basic_ostream_char__struct_std::char_traits_char_____]
mov edx, esi
lea ecx, [ebp - 0xb0]
call fcn.004019d0
mov edx, edi
mov dword [ebp - 4], 0
lea ecx, [ebp - 0x80]
call fcn.004019d0
lea eax, [ebp - 0x80]
mov byte [ebp - 4], 1
push eax
lea ecx, [ebp - 0x98]
call fcn.00401e00
add esp, 4
mov ecx, eax
mov byte [ebp - 4], 2
mov esi, dword [ecx + 0x14]
mov eax, esi
mov edx, dword [ecx + 0x10]
sub eax, edx
cmp eax, 1
jb 0x40127c
lea eax, [edx + 1]
mov dword [ecx + 0x10], eax
mov eax, ecx
cmp esi, 0x10
jb 0x401274
mov eax, dword [ecx]
mov word [eax + edx], 0x2c
jmp 0x401293
push 1
push 0x4042e8
mov byte [ebp - 0x34], 0
push dword [ebp - 0x34]
push 1
call fcn.00401ef0
mov ecx, eax
movups xmm0, xmmword [ecx]
movups xmmword [ebp - 0x50], xmm0
movq xmm0, qword [ecx + 0x10]
movq qword [ebp - 0x40], xmm0
mov dword [ecx + 0x10], 0
mov dword [ecx + 0x14], 0xf
mov byte [ecx], 0
lea eax, [ebp - 0xb0]
mov byte [ebp - 4], 3
push eax
lea eax, [ebp - 0x50]
push eax
push dword [ebp - 0x34]
lea ecx, [ebp - 0x68]
call fcn.00402050
mov byte [ebp - 4], 4
mov edx, dword [ebp - 0x54]
mov eax, edx
mov ecx, dword [ebp - 0x58]
sub eax, ecx
push 3
push 0x4042d0
cmp eax, 3
jb 0x40130d
cmp edx, 0x10
lea esi, [ebp - 0x68]
lea eax, [ecx + 3]
cmovae esi, dword [ebp - 0x68]
add esi, ecx
mov dword [ebp - 0x58], eax
push esi
call sub.VCRUNTIME140.dll_memmove
add esp, 0xc
mov byte [esi + 3], 0
lea eax, [ebp - 0x68]
jmp 0x40131e
mov byte [ebp - 0x34], 0
lea ecx, [ebp - 0x68]
push dword [ebp - 0x34]
push 3
call fcn.00401ef0
mov dword [ebp - 0x1c], 0
xorps xmm0, xmm0
movups xmmword [ebp - 0x2c], xmm0
mov dword [ebp - 0x18], 0
movups xmm0, xmmword [eax]
movups xmmword [ebp - 0x2c], xmm0
movq xmm0, qword [eax + 0x10]
movq qword [ebp - 0x1c], xmm0
mov dword [eax + 0x10], 0
mov dword [eax + 0x14], 0xf
mov byte [eax], 0
mov byte [ebp - 4], 6
mov ecx, dword [ebp - 0x54]
cmp ecx, 0x10
jb 0x40138d
mov edx, dword [ebp - 0x68]
inc ecx
mov eax, edx
cmp ecx, 0x1000
jb 0x401383
mov edx, dword [eax - 4]
add ecx, 0x23
sub eax, edx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x4014a6
push ecx
push edx
call fcn.004025a4
add esp, 8
mov dword [ebp - 0x58], 0
mov dword [ebp - 0x54], 0xf
mov byte [ebp - 0x68], 0
mov byte [ebp - 4], 7
mov ecx, dword [ebp - 0x3c]
cmp ecx, 0x10
jb 0x4013d7
mov edx, dword [ebp - 0x50]
inc ecx
mov eax, edx
cmp ecx, 0x1000
jb 0x4013cd
mov edx, dword [eax - 4]
add ecx, 0x23
sub eax, edx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x4014a6
push ecx
push edx
call fcn.004025a4
add esp, 8
mov byte [ebp - 4], 8
mov ecx, dword [ebp - 0x84]
cmp ecx, 0x10
jb 0x401415
mov edx, dword [ebp - 0x98]
inc ecx
mov eax, edx
cmp ecx, 0x1000
jb 0x40140b
mov edx, dword [eax - 4]
add ecx, 0x23
sub eax, edx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x4014a6
push ecx
push edx
call fcn.004025a4
add esp, 8
mov dword [ebp - 0x88], 0
mov dword [ebp - 0x84], 0xf
mov byte [ebp - 0x98], 0
mov byte [ebp - 4], 9
mov ecx, dword [ebp - 0x6c]
cmp ecx, 0x10
jb 0x401464
mov edx, dword [ebp - 0x80]
inc ecx
mov eax, edx
cmp ecx, 0x1000
jb 0x40145a
mov edx, dword [eax - 4]
add ecx, 0x23
sub eax, edx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x4014a6
push ecx
push edx
call fcn.004025a4
add esp, 8
mov dword [ebp - 0x70], 0
mov dword [ebp - 0x6c], 0xf
mov byte [ebp - 0x80], 0
mov byte [ebp - 4], 0xa
mov ecx, dword [ebp - 0x9c]
cmp ecx, 0x10
jb 0x4014b6
mov edx, dword [ebp - 0xb0]
inc ecx
mov eax, edx
cmp ecx, 0x1000
jb 0x4014ac
mov edx, dword [eax - 4]
add ecx, 0x23
sub eax, edx
add eax, 0xfffffffc
cmp eax, 0x1f
jbe 0x4014ac
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo_noreturn]
push ecx
push edx
call fcn.004025a4
add esp, 8
mov ecx, dword [sym.imp.MSVCP140.dll_class_std::basic_ostream_char__struct_std::char_traits_char___std::cout]
mov edx, str.write_data:
call fcn.00401bb0
cmp dword [ebp - 0x18], 0x10
lea edx, [ebp - 0x2c]
push 0x401dd0
cmovae edx, dword [ebp - 0x2c]
push ecx
push dword [ebp - 0x1c]
mov ecx, eax
call fcn.00402230
add esp, 8
mov ecx, eax
call dword [sym.imp.MSVCP140.dll_public:_class_std::basic_ostream_char__struct_std::char_traits_char______thiscall_std::basic_ostream_char__struct_std::char_traits_char__::operator___class_std::basic_ostream_char__struct_std::char_traits_char_______cdecl___class_std::basic_ostream_char__struct_std::char_traits_char_____]
cmp dword [ebp - 0x18], 0x10
lea eax, [ebp - 0x2c]
mov edi, dword [ebp - 0x1c]
xorps xmm0, xmm0
cmovae eax, dword [ebp - 0x2c]
mov dword [ebp - 0x40], 0
mov dword [ebp - 0x3c], 0
mov dword [ebp - 0x34], eax
movups xmmword [ebp - 0x50], xmm0
cmp edi, 0x7fffffff
ja 0x4016a7
cmp edi, 0x10
jae 0x40153a
mov ecx, 0xf
mov dword [ebp - 0x40], edi
mov dword [ebp - 0x3c], ecx
movups xmm0, xmmword [eax]
movups xmmword [ebp - 0x50], xmm0
jmp 0x4015ca
mov esi, edi
mov dword [ebp - 0x3c], 0xf
or esi, 0xf
cmp esi, 0x7fffffff
jbe 0x401577
mov ecx, 0x80000000
mov esi, 0x7fffffff
add ecx, 0x23
push ecx
call fcn.00402574
add esp, 4
test eax, eax
je 0x4014a6
lea ecx, [eax + 0x23]
and ecx, 0xffffffe0
mov dword [ecx - 4], eax
jmp 0x4015ab
mov eax, 0x16
cmp esi, eax
cmovb esi, eax
lea eax, [esi + 1]
cmp eax, 0x1000
jb 0x401598
lea ecx, [eax + 0x23]
cmp ecx, eax
jbe 0x4016ac
jmp 0x40155b
test eax, eax
je 0x4015a9
push eax
call fcn.00402574
add esp, 4
mov ecx, eax
jmp 0x4015ab
xor ecx, ecx
lea eax, [edi + 1]
mov dword [ebp - 0x50], ecx
push eax
push dword [ebp - 0x34]
mov dword [ebp - 0x40], edi
push ecx
mov dword [ebp - 0x3c], esi
call sub.VCRUNTIME140.dll_memcpy
mov ecx, dword [ebp - 0x3c]
add esp, 0xc
mov edi, dword [ebp - 0x40]
push 0
cmp ecx, 0x10
mov byte [ebp - 4], 0xb
lea ecx, [ebp - 0x30]
push ecx
lea eax, [ebp - 0x50]
cmovae eax, dword [ebp - 0x50]
push edi
push eax
push dword [0x4063ec]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x40161d
push 0x401dd0
push ecx
mov ecx, dword [sym.imp.MSVCP140.dll_class_std::basic_ostream_char__struct_std::char_traits_char___std::cout]
mov edx, str.Failed_to_write_data_to_the_serial_port.
call fcn.00401bb0
add esp, 4
mov ecx, eax
call dword [sym.imp.MSVCP140.dll_public:_class_std::basic_ostream_char__struct_std::char_traits_char______thiscall_std::basic_ostream_char__struct_std::char_traits_char__::operator___class_std::basic_ostream_char__struct_std::char_traits_char_______cdecl___class_std::basic_ostream_char__struct_std::char_traits_char_____]
push dword [0x4063ec]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, dword [ebp - 0x3c]
cmp ecx, 0x10
jb 0x401653
mov edx, dword [ebp - 0x50]
inc ecx
mov eax, edx
cmp ecx, 0x1000
jb 0x401649
mov edx, dword [eax - 4]
add ecx, 0x23
sub eax, edx
add eax, 0xfffffffc
cmp eax, 0x1f
jbe 0x401649
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo_noreturn]
push ecx
push edx
call fcn.004025a4
add esp, 8
mov ecx, dword [ebp - 0x18]
cmp ecx, 0x10
jb 0x401689
mov edx, dword [ebp - 0x2c]
inc ecx
mov eax, edx
cmp ecx, 0x1000
jb 0x40167f
mov edx, dword [eax - 4]
add ecx, 0x23
sub eax, edx
add eax, 0xfffffffc
cmp eax, 0x1f
jbe 0x40167f
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo_noreturn]
push ecx
push edx
call fcn.004025a4
add esp, 8
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
mov ecx, dword [ebp - 0x14]
xor ecx, ebp
call fcn.00402566
mov esp, ebp
pop ebp
mov esp, ebx
pop ebx
ret
call fcn.00401170
call fcn.004010d0
int3