标签:handle bytes pcs lpn code write ber set file
hook 该函数获取串口信息 和 lpDCB 数据
BOOL BuildCommDCBA(
LPCSTR lpDef,
LPDCB lpDCB
);
hook 该函数比较上面函数获得到的 lpDCB 数据,如果相同则获取 hFile 句柄。
BOOL SetCommState(
HANDLE hFile,
LPDCB lpDCB
);
hook 写函数并比较 hFile 值,如果相等则转发发送的数据
BOOL WriteFile(
HANDLE hFile,
LPCVOID lpBuffer,
DWORD nNumberOfBytesToWrite,
LPDWORD lpNumberOfBytesWritten,
LPOVERLAPPED lpOverlapped
);
hook 读函数并比较 hFile 值,如果相等则转发发送的数据
BOOL ReadFile(
HANDLE hFile,
LPVOID lpBuffer,
DWORD nNumberOfBytesToRead,
LPDWORD lpNumberOfBytesRead,
LPOVERLAPPED lpOverlapped
);
标签:handle bytes pcs lpn code write ber set file
原文地址:https://www.cnblogs.com/cheungxiongwei/p/10649614.html