Function at 0x40e580
Capabilities:
Print debug messages

Disassembly:
push 8
mov eax, 0x420101
call fcn.0041de82
mov dword [ebp - 0x10], ecx
mov esi, dword [ebp + 8]
movzx ax, byte [esi + 5]
movzx eax, ax
push eax
mov ecx, esi
call fcn.0040e067
mov edi, dword [ebp + 0x18]
mov word [edi], ax
cmp ax, 6
jb 0x40e5c4
push 0xc8
push 0x7d0
call dword [sym.imp.KERNEL32.dll_Beep]
push 3
pop eax
mov word [edi], ax
movzx eax, word [esi + 8]
mov ecx, dword [ebp + 0xc]
mov edx, dword [ebp + 0x10]
mov word [ecx], ax
mov bx, word [esi + 0xc]
shr bx, 1
add bx, ax
mov word [edx], bx
mov al, byte [esi + 5]
cmp al, 1
je 0x40e62a
cmp al, 2
je 0x40e615
cmp al, 4
je 0x40e615
cmp al, 3
je 0x40e615
cmp al, 0x14
je 0x40e615
cmp al, 5
je 0x40e615
cmp al, 0xf
je 0x40e615
cmp al, 0x10
je 0x40e615
cmp al, 6
je 0x40e615
cmp al, 0x16
je 0x40e615
cmp al, 0x15
je 0x40e615
xor eax, eax
inc eax
mov dword [ebp + 0x1c], eax
jmp 0x40e650
cmp al, 1
je 0x40e62a
cmp al, 2
je 0x40e62a
cmp al, 0xf
je 0x40e62a
mov bx, word [esi + 0xc]
add bx, bx
jmp 0x40e632
mov bx, word [esi + 0xc]
shr bx, 3
mov eax, dword [ebp + 0x1c]
mov word [eax], bx
movzx eax, bx
mov ebx, dword [ebp - 0x10]
cmp eax, dword [ebx + 0x6d0]
jbe 0x40e658
push 3
mov dword [ebp + 0x1c], 1
pop eax
mov ebx, dword [ebp + 0x14]
mov word [ebx], ax
jmp 0x40e65c
and dword [ebp + 0x1c], 0
mov ebx, dword [ebp - 0x10]
cmp dword [ebx + 0x478], 0
je 0x40e6bd
movzx eax, word [edi]
cmp ax, 2
je 0x40e67d
cmp ax, 3
je 0x40e67d
cmp ax, 4
jne 0x40e6bd
movzx eax, word [edx]
movzx ecx, word [ecx]
mov dx, ax
mov di, cx
shr dx, 0xb
shr di, 0xb
movzx edx, dx
shr eax, 8
movzx edi, di
shr ecx, 8
and eax, 7
and ecx, 7
cmp dx, di
jne 0x40e6ad
cmp ax, cx
je 0x40e6bd
mov ecx, dword [ebp + 0x14]
push 2
pop eax
mov dword [ebp + 0x1c], 1
mov word [ecx], ax
cmp dword [ebx + 0x47c], 0
mov edi, dword [sym.imp.mfc90.dll_Ordinal_2539]
mov ebx, dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
je 0x40e747
mov al, byte [esi + 5]
cmp al, 5
je 0x40e6ed
cmp al, 6
je 0x40e6ed
cmp al, 0x16
je 0x40e6ed
cmp al, 0xf
je 0x40e6ed
cmp al, 0x10
je 0x40e6ed
cmp al, 0x15
jne 0x40e747
lea ecx, [ebp + 8]
call dword [sym.imp.mfc90.dll_Ordinal_316]
mov ecx, dword [ebp + 0x14]
and dword [ebp - 4], 0
xor eax, eax
inc eax
mov dword [ebp + 0x1c], eax
mov word [ecx], ax
lea eax, [ebp + 8]
push str.Writting_to_registers_or_I_O_is_disabled__n
push eax
call edi
pop ecx
pop ecx
lea ecx, [ebp + 8]
call dword [sym.imp.mfc90.dll_Ordinal_910]
push eax
call ebx
mov eax, dword [ebp - 0x10]
mov eax, dword [eax]
lea ecx, [ebp + 8]
mov dword [ebp - 0x14], eax
call dword [sym.imp.mfc90.dll_Ordinal_910]
mov ecx, dword [ebp - 0x10]
push eax
mov eax, dword [ebp - 0x14]
call dword [eax + 0x24]
or dword [ebp - 4], 0xffffffff
lea ecx, [ebp + 8]
call dword [sym.imp.mfc90.dll_Ordinal_601]
cmp byte [esi + 5], 0xf
jne 0x40e7af
movzx eax, word [esi + 6]
movzx ecx, byte [esi + 0xe]
sub eax, 7
cmp ecx, eax
je 0x40e7af
lea ecx, [ebp + 8]
call dword [sym.imp.mfc90.dll_Ordinal_316]
mov ecx, dword [ebp + 0x14]
xor eax, eax
inc eax
mov dword [ebp - 4], eax
mov dword [ebp + 0x1c], eax
mov word [ecx], ax
lea eax, [ebp + 8]
push str.Invalid_I_O_length__n
push eax
call edi
pop ecx
pop ecx
lea ecx, [ebp + 8]
call dword [sym.imp.mfc90.dll_Ordinal_910]
push eax
call ebx
mov eax, dword [ebp - 0x10]
mov esi, dword [eax]
lea ecx, [ebp + 8]
call dword [sym.imp.mfc90.dll_Ordinal_910]
mov ecx, dword [ebp - 0x10]
push eax
call dword [esi + 0x24]
or dword [ebp - 4], 0xffffffff
lea ecx, [ebp + 8]
call dword [sym.imp.mfc90.dll_Ordinal_601]
cmp dword [ebp + 0x1c], 0
jne 0x40e802
mov eax, dword [ebp + 0x18]
movzx eax, word [eax]
mov esi, 0x434140
push eax
mov ecx, esi
call fcn.0040da27
mov ecx, dword [ebp + 0x10]
movzx ecx, word [ecx]
mov eax, dword [eax + 8]
cmp eax, ecx
jge 0x40e850
mov eax, dword [ebp + 0x18]
movzx eax, word [eax]
push eax
mov ecx, esi
mov dword [ebp + 0x1c], 1
call fcn.0040da27
mov ecx, dword [ebp + 0xc]
movzx ecx, word [ecx]
mov eax, dword [eax + 8]
xor edx, edx
cmp eax, ecx
mov eax, dword [ebp + 0x14]
setge dl
inc edx
inc edx
mov word [eax], dx
lea ecx, [ebp + 0x18]
call dword [sym.imp.mfc90.dll_Ordinal_316]
mov eax, dword [ebp + 0x14]
movzx eax, word [eax]
push eax
lea eax, [ebp + 0x18]
push str.Modbus_message_in_error_x_02X_n
push eax
mov dword [ebp - 4], 2
call edi
add esp, 0xc
lea ecx, [ebp + 0x18]
call dword [sym.imp.mfc90.dll_Ordinal_910]
push eax
call ebx
mov edi, dword [ebp - 0x10]
mov esi, dword [edi]
lea ecx, [ebp + 0x18]
call dword [sym.imp.mfc90.dll_Ordinal_910]
push eax
mov ecx, edi
call dword [esi + 0x24]
lea ecx, [ebp + 0x18]
call dword [sym.imp.mfc90.dll_Ordinal_601]
mov eax, dword [ebp + 0x1c]
call fcn.0041df5a
ret 0x18