深圳全飞鸿

 找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 681|回复: 2
打印 上一主题 下一主题

微软串口组件的破解方法/MSCOMM32.OCX

[复制链接]

800

主题

1379

帖子

7704

积分

版主

Rank: 7Rank: 7Rank: 7

积分
7704
跳转到指定楼层
楼主
发表于 2021-5-31 18:44:25 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式

今天发现微软的MSCOMM32.OCX有限制,串口数最大只能到16。如果电脑串口大于16,则无法使用。


解除这一限制的方法如下:



Hi Guys

As some of you who use COM ports to communicate with may have found out, MSCOMM32.OCX only supports a max of 16 COM ports. Since it is just a wrapper to the API's I don't know why they put in that limitation.

So with that said it would be nice to remove this false limitation and really USE the OCX, by increasing the number of ports it will open.

If you are brave and a bit handy with a HEX editor you can do it. I have successfully gone upto port 50 but I suppose you can go higher upto 65K if you wanted to.

Basically you need to "overcome" the limitation of MSCOMM32.ocx with a bit of creative hacking. There are 2 places - search for the HEX strings (I use HEX edit) and patch them. Is this Legal? Don't ask me.
Does it work? Sure does.

Make a backup of MSCOMM32.ocx just in case you muck up

Patch 1(Assembly)
*******
:21C1493B 56 push esi
:21C1493C 8B742408 mov esi, dword ptr [esp+08]
:21C14940 837E1C00 cmp dword ptr [esi+1C], 00000000
:21C14944 7530 jne 21C14976
:21C14946 668B44240C mov ax, word ptr [esp+0C]
:21C1494B 663D0100 cmp ax, 0001<--- is port set to < one
:21C1494F 7C3F jl 21C14990<--- Error: Invalid Port Number
:21C14951 663D1000 cmp ax, 0010<--- is port > 16 (hex 10)
:21C14955 7F39 jg 21C14990<---- Error: Invalid Port
:21C14957 663B4620 cmp ax, word ptr [esi+20]
:21C1495B 7415 je 21C14972
:21C1495D 6A04 push 00000004
:21C1495F 8D8E6CFFFFFF lea ecx, dword ptr [esi+FFFFFF6C]

SO Change the code at location :21C14951

663D1000 change to 663D3200 this will give you 50 ports (32h = 50 Dec) maybe be greedy and go up to FFFF?

Offsets: 16 进制
3F53: 7F 10

Patch 2
*******
* Reference To: KERNEL32.CreateFileA, Ord:0031h
|
:21C144AD FF15A010C121 Call dword ptr [21C110A0]
:21C144B3 83F8FF cmp eax, FFFFFFFF
:21C144B6 8986D8000000 mov dword ptr [esi+000000D8], eax
:21C144BC 0F840E1C0000 je 21C160D0<--- This jump raises an error so you need to bypass it!

:21C144C2 68FD010000 push 000001FD
:21C144C7 50 push eax
:21C144C8 89BE4C020000 mov dword ptr [esi+0000024C], edi


Change code at :21C144BC

0F840E1C0000 to 909090909090 (This is basically NOP so that the jump is NOT taken).

Now save your changes and Voila - 50 ports.

To search for these codes just enter the hexdigits into the hex editor.

eg: search for : 663D1000 Only 1 instance found, so make your changes.

Also there is a mob that have come up with a Virtual COM port driver. That too works exactly as advertised and is very useful for testing. Check it out at :
回复

使用道具 举报

800

主题

1379

帖子

7704

积分

版主

Rank: 7Rank: 7Rank: 7

积分
7704
沙发
 楼主| 发表于 2021-10-4 16:45:41 | 只看该作者

注册的批处理:

:: @echo off
@set "DIR=%~dp0"
regsvr32  "%DIR%MSCOMM32.OCX"


权限的注册表:
Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\Licenses\4250E830-6AC2-11cf-8ADB-00AA00C00905]
@="kjljvjjjoquqmjjjvpqqkqmqykypoqjquoun"




回复 支持 反对

使用道具 举报

800

主题

1379

帖子

7704

积分

版主

Rank: 7Rank: 7Rank: 7

积分
7704
板凳
 楼主| 发表于 2021-10-30 17:26:58 | 只看该作者






回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|Archiver|手机版|小黑屋|nagomes  

GMT+8, 2025-5-5 02:11 , Processed in 0.037255 second(s), 23 queries .

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表