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

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x154
mov eax, dword [section..data]
xor eax, esp
mov dword [esp + 0x150], eax
cmp dword [ebp + 8], 2
mov eax, dword [ebp + 0xc]
push ebx
push esi
push edi
jne 0x4014f0
mov eax, dword [eax + 4]
mov dword [str.COM7], eax
jmp 0x40150d
push dword [0x4248b0]
push str.SerialCom
push str.Usage:__s__port______s_by_default__n
call fcn.00401060
mov eax, dword [str.COM7]
add esp, 0xc
push 0
push 0x80
push 3
push 0
push 0
push 0xc0000000
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov ebx, eax
cmp ebx, 0xffffffff
jne 0x40154b
push str.Error_opening_serial_port_n
push 2
call fcn.00404e39
add esp, 4
push eax
call fcn.00401040
add esp, 8
push eax
call fcn.00404d5b
lea eax, [esp + 0x28]
mov dword [esp + 0x28], 0x1c
xorps xmm0, xmm0
push eax
push ebx
movlpd qword [esp + 0x34], xmm0
movlpd qword [esp + 0x3c], xmm0
movlpd qword [esp + 0x44], xmm0
call dword [sym.imp.KERNEL32.dll_GetCommState]
test eax, eax
jne 0x40157f
mov esi, str.Error_getting_serial_port_state_n
jmp 0x4015e7
lea eax, [esp + 0x28]
mov dword [esp + 0x2c], 0x2580
push eax
push ebx
mov word [esp + 0x42], 8
mov byte [esp + 0x44], 0
call dword [sym.imp.KERNEL32.dll_SetCommState]
test eax, eax
jne 0x4015aa
mov esi, str.Error_setting_serial_port_state_n
jmp 0x4015e7
lea eax, [esp + 0x44]
mov dword [esp + 0x44], 0xffffffff
push eax
push ebx
mov dword [esp + 0x54], 0x64
mov dword [esp + 0x50], 0
mov dword [esp + 0x5c], 0x32
mov dword [esp + 0x58], 0xa
call dword [sym.imp.KERNEL32.dll_SetCommTimeouts]
test eax, eax
jne 0x401606
mov esi, str.Error_setting_serial_port_timeouts_n
push 2
call fcn.00404e39
add esp, 4
push esi
push eax
call fcn.00401040
add esp, 8
test eax, eax
je 0x401606
push 1
call fcn.00404d5b
push str.Waiting_for_port_to_be_ready...
call fcn.00407f46
add esp, 4
push 0xbb8
call dword [sym.imp.KERNEL32.dll_Sleep]
push 0x100
lea eax, [esp + 0x5c]
push 0
push eax
call fcn.00402ff0
add esp, 0xc
sub esp, 0x18
xorps xmm0, xmm0
mov ecx, esp
movlpd qword [esp + 0x30], xmm0
push str.wmic_cpu_get_loadpercentage__value
call fcn.00401870
lea ecx, [esp + 0x30]
call fcn.00401280
mov edi, dword [esp + 0x30]
add esp, 0x18
mov dword [esp + 0x14], 0xffffffff
mov esi, dword [edi]
cmp esi, edi
je 0x401737
nop dword [eax]
cmp dword [esi + 0x1c], 0x10
lea eax, [esi + 8]
jb 0x40167b
mov eax, dword [eax]
lea ecx, [esp + 0x14]
push ecx
push str.LoadPercentage_i
push eax
call fcn.004010f0
add esp, 0xc
cmp eax, 1
je 0x401699
mov esi, dword [esi]
cmp esi, edi
jne 0x401670
mov eax, dword [esp + 0x14]
cmp eax, 0xffffffff
je 0x401737
push eax
lea eax, [esp + 0x5c]
push str.LoadPercentage_i_n
push eax
call fcn.004010b0
lea ecx, [esp + 0x64]
add esp, 0xc
lea edx, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x4016c0
push 0
lea eax, [esp + 0x24]
sub ecx, edx
push eax
push ecx
lea eax, [esp + 0x64]
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x401763
lea eax, [esp + 0x58]
push eax
push dword [esp + 0x24]
push str._lu_bytes_written_to_serial_port:__s_n
call fcn.00401060
add esp, 0xc
push 0x64
call dword [sym.imp.KERNEL32.dll_Sleep]
push 0
lea eax, [esp + 0x28]
push eax
push 0x100
lea eax, [esp + 0x64]
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x401745
lea eax, [esp + 0x58]
push eax
mov eax, dword [esp + 0x28]
push eax
push eax
push str._lu_bytes_read_from_serial_port:__.s_n
call fcn.00401060
add esp, 0x10
lea ecx, [esp + 0x18]
call fcn.00401790
jmp 0x401632
push str.Error_reading_from_serial_port_n
push 2
call fcn.00404e39
add esp, 4
push eax
call fcn.00401040
add esp, 8
push eax
call fcn.00404d5b
push str.Error_writing_to_serial_port_n
push 2
call fcn.00404e39
add esp, 4
push eax
call fcn.00401040
add esp, 8
push eax
call fcn.00404d5b
int3