本文目录一览:
- 1、virtual serial port driver 7.2怎么破解
- 2、如何应用.dll文件破解虚拟串口
- 3、如何在Proteus中调试 虚拟串口
- 4、(200分)求SerialNull v1.7(一个虚拟串口软件)注册码或破解补丁
virtual serial port driver 7.2怎么破解
virtual serial port driver
是产生一对虚拟串口,然后将其连接,比如你现在的2和3
调试时,从串口2发数据,监视串口3接受数据
如何应用.dll文件破解虚拟串口
网上搜索一番,主要有VSPM和VSPD,前者是在WIN7前使用稳定,后者在WIN7中使用稳定。我的电脑是WIN7_64的,所以选用了VSPD7。于是下了个VSPD7.1的安装包,安装完成后,利用软件界面就可以创建相应的虚拟COM口了。具体如何使用,可以参看这篇文章《虚拟串口VSPD的使用方法》。记住一点,VSPD的COM通信是成对的,一个用于接收数据,一个用于发送数据。
有了虚拟COM口后,就是写一个DEMO进行测试。具体可以参看这篇文件章《win7系统下用vspd软件进行串口编程实例》。
当虚拟COM口可以实现通讯之后,就想着我们的程序是依赖于这个VSPD安装包的,那如果我们是否可以不依赖呢?有两种方案:
方案一:自己写一个虚拟COM的驱动,然后里面实现。有兴趣的可以参看该文《开发虚拟串口驱动程序》。
方案二:VSPD安装包是一个安装程序,为了实现虚拟COM,必然会有相应的驱动。如果我们能够找到这个驱动并安装,之后用相应的接口来调用,或是可行。
方案一想了,但自认还没有这个能耐,于是果断放弃,退而选方案二。那么方案二要实现,首先要解决的问题是接口的调用,因为驱动程序即使不能做到自己安装,但还是可以通过VSPD安装包的安装来解决,那么VSPD中有没有提供这样的接口呢?
查看VSPD的用户手册(User Manual),里面果然有相应的接口(在Using serial port driver in your program下的Functions中),于是有C#写了相应的调用,下面是代码。
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
//Add
using System.Runtime.InteropServices;
namespace Anser.U2Simulator.Model
{
public class VSPD
{
//[DllImport("VSPDCTL.dll", EntryPoint = "CreatePair", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Auto)]
//public static extern bool CreatePair(byte[] comName1, byte[] comName2);
/// summary
/// CreatePair creates a pair of virtual serial ports with given names.
/// It accepts two null-terminated strings determining which ports should be created as input.
/// For example, "COM5" and "COM6".
/// /summary
/// param name="comName1"A null-terminated string that defines the name of the first port in a pair/param
/// param name="comName2"A null-terminated string that defines the name of the second port in a pair/param
/// returnsCreatePair returns TRUE if virtual serial pair was created successfully and FALSE otherwise/returns
[DllImport("vspdctl.dll")]
public static extern bool CreatePair(string comName1, string comName2);
/// summary
/// DeletePair deletes a pair of virtual serial ports with a given name.
/// As input it takes name of any virtual serial port in a pair.
/// For example, if you want to remove pair named "COM5"-"COM6",
/// you can pass either "COM5" or "COM6" as argument to DeletePair function.
/// /summary
/// param name="comName" A null-terminated string that defines one of the two port names in a pair you want to delete /param
/// returnsDeletePair returns TRUE if virtual serial pair was successfully deleted and FALSE otherwise/returns
[DllImport("vspdctl.dll")]
public static extern bool DeletePair(string comName);
/// summary
/// DeleteAll deletes all virtual serial ports currently present in a system. It accepts no arguments at input.
/// /summary
/// returnsDeleteAll returns TRUE if all virtual serial pairs were successfully deleted and FALSE otherwise/returns
[DllImport("vspdctl.dll")]
public static extern bool DeleteAll();
[DllImport("vspdctl.dll")]
public static extern bool SetStrictBaudrateName(string comName, bool isStrictBaudrate);
[DllImport("vspdctl.dll")]
public static extern bool SetStrictBaudrateHandle(IntPtr handle, bool isStrictBaudrate);
/// summary
/// SetStrictBaudrate enables/disables full baudrate emulation,
/// needs the name of one of the paired virtual ports and boolean parameter
/// that defines if strict baudrate emulation should be enabled or not.
/// /summary
/// param name="comName"A null-terminated string that defines one of the two port names in a pair /param
/// param name="isStrictBaudrate"A boolean variable which should be TRUE
/// if you want to enable strict baudrate emulation and FALSE if you want to disable it/param
/// returnsSetStrictBaudrate returns TRUE if strict baudrate emulation was successfully enabled and FALSE otherwise/returns
[DllImport("vspdctl.dll")]
public static extern bool SetStrictBaudrate(string comName, bool isStrictBaudrate);
/// summary
/// SetBreak enables/disables line break emulation in virtual serial ports.
/// /summary
/// param name="comName"A null-terminated string that defines one of the two port names in a pair/param
/// param name="isBreak" A boolean variable should be TRUE if you want to emulate connection break and FALSE if you want to re-establish it /param
/// returnsSetBreak returns TRUE if line break emulation was successfully enabled and FALSE otherwise./returns
[DllImport("vspdctl.dll")]
public static extern bool SetBreak(string comName, bool isBreak);
/// summary
/// QueryBus: QueryBus sends request to get complete information from the virtual serial bus installed by VSPD.
/// /summary
/// param name="inBufferPtr"A pointer to VSBUS_QUERY or VSBUS_QUERY_EX structures.
/// If you want to get information about all current virtual serial ports
/// then use VSBUS_QUERY structure
/// and if you want to get extended information
/// about single virtual serial pair then use VSBUS_QUERY_EX structure./param
/// param name="inBufferSize"/param
/// param name="outBufferPtr"/param
/// param name="outBufferSize"A pointer to either PORT_INFORMATION or PORT_INFORMATION_EX structures list.
/// If you have used VSBUS_QUERY than you should get PORT_INFORMATION list
/// and if you used VSBUS_QUERY_EX then you should get PORT_INFORMATION_EX./param
/// returns/returns
[DllImport("vspdctl.dll")]
public static extern bool QueryBus(IntPtr inBufferPtr, long inBufferSize, IntPtr outBufferPtr, long outBufferSize);
/// summary
/// SetWiring sets custom signal lines wiring (pinout).
/// /summary
/// param name="comName"A null-terminated string that defines one of the two port names in a pair /param
/// param name="bufferPtr"A pointer to VSERIAL_WIRING structure /param
/// param name="bufferSize"Size of Buffer parameter in bytes /param
/// returnsSetWiring returns TRUE if signal lines wiring was created successfully and FALSE otherwise/returns
[DllImport("vspdctl.dll")]
public static extern bool SetWiring(string comName, IntPtr bufferPtr, long bufferSize);
/// summary
/// SetAccessList restricts access to created virtual serial ports for various applications.
/// /summary
/// param name="comName" A null-terminated string that defines one of the two port names in a pair /param
/// param name="bufferPtr"A pointer to PROGRAM_ACCESS array /param
/// param name="bufferSize"Size of Buffer parameter in bytes /param
/// returnsSetAccessList returns TRUE if port access list was created successfully and FALSE otherwise/returns
[DllImport("vspdctl.dll")]
public static extern bool SetAccessList(string comName, IntPtr bufferPtr, long bufferSize);
//[StructLayout(LayoutKind.Sequential,CharSet=CharSet.Ansi,Pack=1)]
public struct _VSBUS_QUERY
{
/// summary
/// VSBUS_QUERY structure size
/// /summary
ulong Size;
/// summary
/// Has QUERYTYPE_PORTS = 1 value. Can be extended in the future.
/// /summary
ulong QueryType;
};
private const int MAX_PORTNAME_LEN = 6;
public struct _VSBUS_QUERY_EX
{
/// summary
/// VSBUS_QUERY_EX structure size
/// /summary
ulong Size;
/// summary
/// 1:query all virtual ports.
/// 2:query particular virtual pair
/// 3:query particular virtual pair; name of the application, which created the port, is returned.
/// /summary
ulong QueryType;
/// summary
/// Unicode name of any port in the pair you want to delete.
/// For instance, if "COM6-COM7" virtual serial ports pair was created,
/// then to remove it, PortName's value should be COM6 or COM7.
/// /summary
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = MAX_PORTNAME_LEN)]
string PortName;
}
}
}
如何在Proteus中调试 虚拟串口
1、首先,需要一个虚拟串口软件,
2、其次是需要虚拟串口调试软件 SSOM32.rar 文件和串口调试的例子.rar(可选择下载它)
3、以上两项先安装虚拟串口软件,里面有破解说明,装完后启动界面是这样的
4、需要增加虚拟端口,看到右边的 ADD PAIR 了吗?就用它了,别急,先从它右边的两个下拉框中选择一下才行。
如何在Proteus中调试 虚拟串口 First 的选择框选择 COM3 ,Second 的选择框选择 COM4。就这二步,完成后成这个样子的界面
5、现在到点击 ADD pair 按钮的时候了,点击下去,看到左边窗口出现了
不用管 First和 Second 的选择框成了原来模样,这是软件自动默认归位造成的, 到了这个界面,恭喜你虚拟串口建成了。
6、接下来我们启动虚拟串口调试软件 SSOM32.rar 中的 sscom32.exe,这是绿色版的好用呀,这时候可以看到界面如下:
这里只需要注意串口号和波特率的选择下拉框,第一次启动时如上图界面串口号为:COM1;波特率为:9600(依据情况不同,我的界面是这样的,不一样不要紧)。
7、好了,现在我们该用串口调试的例子了,如果你手头有要调试的项目,建议先看一下它,再做你自己的调试项目,比较有益。这是一个压缩的文件包,解压后我们打开
为了让大家印象深刻,右边的 compim 元件为红色的了,不要问我怎么变红的,如果你是proteus 新手建议先入门学习使用 proteus。我们这个例子前例是对 proteus有所熟悉并且已经安装了 proteus的。长话短说,继续。。。
右键点击红色的 compim,有朋友会说这个是从哪里找的,很容易的本身 proteus 中就自带一个 compim实例可以在它的 samples 目录下找到。继续。。。右键点击后界面如下:
我们需要关心的是 Physical port、Physical Baud Rate、Virtual Baud Rate 这三个栏目,请切记住它们的设定值,特别是波特率的值一定要与源文件规定的值一定,比如我们这里是 9600则就是因为源文件中设置的就是 9600,在这里我们一定要选择好 COM3,默认是 COM1,一定要注意呀。设置完成这个界面 :
如何在Proteus中调试 虚拟串口
8、到这里还不能算完成,还要注意晶振的频率,比如源文件中设置了晶振的频率为 8MHz(为了测试原则不允许设置成 8MHz)。一定要设置成与源文件相同的晶振频率 。
一定要认真与此图比对呀,防止出错了还找不到原因,我就用了一下午的时间搞通的。
9、好也到此,我们又要返回到 sscom32.exe。我们需要把串口号和波特率设置,串口号一定记住在 compim中我们设置成了 COM3,在这
里要设置成 COM4 才行,我试了 COM3 是不出现的。波特率一定要与 compim 的波特率设置成一样的。好了,成这个样子。
仔细比对,以免出错。
10、所有准备工具均已经完成,现在开始运行仿真。成功了相关界面就成如下:
(200分)求SerialNull v1.7(一个虚拟串口软件)注册码或破解补丁
这个软件到目前来说还没听说过有破解的,网上也找不到破解补丁.
我推荐你使用vspm,免费.虽然使用起来不如你说的那个方便,但在虚拟串口在方面也是比较强的.