China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-08-01 12:16
中国DOS联盟论坛 » DOS开发编程 & 发展交流 (开发室) » Reading CPU encryption in C under DOS View 1,966 Replies 13
Original Poster Posted 2004-03-17 00:00 ·  美国
初级用户
Credits 132
Posts 13
Joined 2004-03-13 00:00
22-year member
UID 20008
Gender Male
Status Offline
Dear all experts and moderators:

I have just developed a monitoring and control system for medical equipment using C/C++, and it has been completed in communication with NAIS's FP0. Now it is about to be delivered. I must remove the logic locks and related functions for preventing long-term use in the program, but I am worried about unlimited copying by customers. Please give me some advice, everyone. Currently, I know two schemes that can be implemented:

1: Read the serial number of the CPU or the CPU of the acquisition card, but I don't know how to read this serial number in C language.
2: Add a hardware dongle, but I haven't actually operated it, and I don't know the price and performance.

If the first scheme can be adopted, it is better; otherwise, I have to add a dongle. Actually, I don't want to do this.

I am originally kind, but I didn't expect the world to be difficult. Now my colleague and I have been working for nearly three months without any income.

Urgent! Urgent! Urgent!...

Wang from Guangzhou 13006881860
Floor 2 Posted 2004-03-20 00:00 ·  中国 辽宁 朝阳 联通
铂金会员
★★★★
痴迷DOS者
Credits 5,798
Posts 1,924
Joined 2003-06-20 00:00
23-year member
UID 5583
Gender Male
From 金獅電腦軟體工作室
Status Offline
You can use hardware code encryption methods to prevent users from copying the program indefinitely. If the user copies the program to another machine, because the hardware code changes, the program will not run. In this way, authorized users can use it for a long time and prevent the occurrence of piracy. Many shareware popular on the Internet use this method.

You can calculate this hardware code using the hard disk serial number. Specifically, I will send you the C program code. Please send an email to my mailbox.
熟能生巧,巧能生精,一艺不精,终生无成,精亦求精,始有所成,臻于完美,永无止境!
金狮電腦軟體工作室愿竭诚为您服务!
QQ群:8393170(定期清理不发言者)
个人网站:http://www.520269.cn
电子邮件:doujiehui@vip.qq.com
微信公众号: doujiehui
Floor 3 Posted 2004-03-22 00:00 ·  中国 广东 广州 天河区 电信
初级用户
Credits 132
Posts 13
Joined 2004-03-13 00:00
22-year member
UID 20008
Gender Male
Status Offline
Thanks kinglion, I can only do this through the physical serial number of the hard drive now. I sent a C language source program to your two email boxes, please check. Currently, I can read it out, but I can't verify whether what I read is correct. I also hope to get a copy of your original code, thanks.
Floor 4 Posted 2004-03-22 00:00 ·  中国 辽宁 朝阳 联通
铂金会员
★★★★
痴迷DOS者
Credits 5,798
Posts 1,924
Joined 2003-06-20 00:00
23-year member
UID 5583
Gender Male
From 金獅電腦軟體工作室
Status Offline
In the other post you made, I've already uploaded the program. Please take a look.
熟能生巧,巧能生精,一艺不精,终生无成,精亦求精,始有所成,臻于完美,永无止境!
金狮電腦軟體工作室愿竭诚为您服务!
QQ群:8393170(定期清理不发言者)
个人网站:http://www.520269.cn
电子邮件:doujiehui@vip.qq.com
微信公众号: doujiehui
Floor 5 Posted 2004-03-22 00:00 ·  中国 广东 广州 教育网
初级用户
Credits 132
Posts 13
Joined 2004-03-13 00:00
22-year member
UID 20008
Gender Male
Status Offline
Thanks KINGLION, I have seen it.
Floor 6 Posted 2004-03-22 00:00 ·  中国 广东 广州 教育网
初级用户
Credits 132
Posts 13
Joined 2004-03-13 00:00
22-year member
UID 20008
Gender Male
Status Offline
Thanks KINGLION, I have seen it
Floor 7 Posted 2004-03-22 00:00 ·  中国 广东 广州 教育网
初级用户
Credits 132
Posts 13
Joined 2004-03-13 00:00
22-year member
UID 20008
Gender Male
Status Offline
In addition, may I ask where to download C's *.CHR files? Actually, in my opinion, TC/BC and so on can already meet most engineering requirements - real-time performance, operability to hardware, low requirements for the system, and stability determine that TC/BC still has strong vitality (including DOS). But because TC/BC was launched earlier, it cannot support many hardware - for example, in terms of the display, it cannot well support 800X600 or 1024X768, 256S colors, etc. (need to develop from the bottom layer again).

1: I am now looking for English font files download under TC/BC (to avoid making the programs written be easily recognized as software under DOS at a glance). I don't know which DX can provide relevant download addresses.
2: I am also looking for relevant materials of the interrupt encyclopedia under DOS. Many addresses on the Internet cannot be downloaded. I hope to get some pointers.

ths
Floor 8 Posted 2004-06-06 00:00 ·  中国 广东 广州 番禺区 电信
初级用户
Credits 120
Posts 5
Joined 2004-04-04 00:00
22-year member
UID 21704
Gender Male
Status Offline
Please send me a program to read the physical hard disk serial number under DOS too, thanks!

Wager@126.com
Floor 9 Posted 2004-06-30 00:00 ·  中国 云南 红河哈尼族彝族自治州 电信
中级用户
★★
Credits 478
Posts 132
Joined 2003-07-02 00:00
23-year member
UID 6296
Gender Male
Status Offline
I'm also looking for it. Send me one.
xpzsj@126.com

Floor 10 Posted 2004-07-07 00:00 ·  中国 上海 浦东新区 电信
初级用户
Credits 130
Posts 10
Joined 2003-11-04 00:00
22-year member
UID 12428
Gender Male
Status Offline
There is no physical serial number for the electronic disk. You can read the track number and sector number of a specific file to achieve the same purpose (haven't heard of it, right). Guess whether this software is for DOS or WINDOWS http://zk888.go.nease.net

Floor 11 Posted 2004-07-25 00:00 ·  中国 浙江 杭州 电信
初级用户
★★
Credits 66
Posts 80
Joined 2004-07-24 00:00
22-year member
UID 28917
Gender Female
Status Offline
Install a UNIX system. Just use more /pro/cpuinfo.
Floor 12 Posted 2004-07-30 00:00 ·  中国 河北 石家庄 联通
初级用户
Credits 183
Posts 31
Joined 2002-11-30 00:00
23-year member
UID 371
Gender Male
Status Offline
I have quite a few font files *.CHR for TC. If you need them, leave a message for me at http://zjp-vlk.vicp.net/bbs/
我的论坛 http://zjp-vlk.vicp.net/bbs 我在它就在!
Floor 13 Posted 2004-10-30 00:00 ·  中国 安徽 合肥 电信
中级用户
★★
Credits 365
Posts 95
Joined 2004-02-28 00:00
22-year member
UID 18733
Gender Male
Status Offline
The encryption method of UCDOS is to use the hardware code encryption method to prevent users from copying the program without limitation.
Floor 14 Posted 2004-11-24 00:00 ·  中国 广东 深圳 宝安区 电信
中级用户
Credits 225
Posts 39
Joined 2004-10-06 00:00
21-year member
UID 32162
Gender Male
Status Offline
In the industrial control field, real-time performance is the most important, but Windows is not real-time. For the situation that requires both "interface" and "real-time", you can download the "WinSail" software for free under the web page "WWW.FirstSail.b2b.Cn". It can be said that DOS + WinSail = Windows CE. Now, a "WinSail Industrial Control Development System" is widely used in the industry. Its launch truly enables designers not to spend too much time on hardware, underlying operations, interface, parameter settings, etc. when developing products for embedded PCs. They only need to focus on function development. As long as you understand C++ For DOS or Visual C++, you can program under DOS and generate an application system comparable to Windows! The "WinSail Industrial Control Development System" is a software development kit developed based on the DOS system using Borland C++ 3.1 language in Large mode. Although the complete software package is about 450K, the programs generated under DOS have the same interface as WIN9x, with interface elements such as Group, Label, Edit, ComboBox, Button, Radio, Check, ListBox, Grid, ScrollBar, Desktop, ToolsBar, StatusBar, Menu, PopuMenu, Window, Dialog, ICON, Bitmap, oscilloscope, etc. It supports the mouse, and 99.9% of the control operations are compatible with Windows! It can load and run script dialog boxes; supports Socket socket programming; the smallest application with a complete window graphical interface is about 150K and can run in an electronic disk with only 1M; has a delay function with an accuracy of 0.5 microseconds. It can be said that DOS + WinSail >= Windows CE. The "WinSail Industrial Control Development System" currently supports: (1) The API of "WinSail" coexists with the "C++ For DOS" function library, especially coexists with the graphics function BGI of the C language. (2) Supports prioritized multitasking, and can reach up to 50 tasks. (Note: The script file can be configured to not need multitasking support, so that the program runs in single-task.) (3) Supports databases, and the generated files are compatible with Foxpro 2.6 libraries and can be directly opened in Microsoft Office's Excel. (4) Uses 16*16 simplified and traditional Chinese character libraries, 8*16 English character library, and supports TrueType character libraries. (5) The "dialog box" can be pre-made in Visual C++, and then through the conversion software, the Windows dialog box interface can be turned into the interface code source file or script file of the "WinSail" system, making full use of the superiority of Visual, so that the application program interface development on the DOS platform "is no longer difficult"!!!!! (6) Supports multiple resolutions such as 600*480*16, 600*400*256, 800*600*256, 1024*768*256. (7) Supports interface elements such as Group, Label, Edit, ComboBox, Button, Radio, Check, ListBox, Grid, ScrollBar, Desktop, ToolsBar, StatusBar, Menu, PopuMenu, Window, Dialog, ICON, Bitmap, MessageBox, oscilloscope, multi-ordinate oscilloscope, etc. (8) Supports memory access of extended memory - XMS, expanded memory EMS. (9) Supports reading and writing of text registry - INI files, and when writing key values, the "comment content" after the key values can still remain. (10) Supports object-oriented I/O access, shielding the underlying I/O ports. (11) Has a COMM port communication interface, supports multiple parity bits, including "no parity bit", "odd parity bit", "even parity bit", "parity bit always 1", "parity bit always 0". The latter two parity methods are mostly used to distinguish "address" and "data" in multi-machine communication. (12) Supports barcode display. Including EAN_8, UPC_A, UPC_E, EAN_13 (product code), ISBN, ISSN, 39, 128, Codabar, cross 25 code. (13) The window supports multiple callback functions such as "virtual keyboard defined by I/O port", "window timer", "call a function when idle", "call a function when the window is refreshed". (14) Multiple common mathematical operations, including the generation of low-pass, high-pass, band-pass, band-stop filter coefficients (can add rectangular window, triangular window, Hamming window, Hanning window, Blackman window, Sin(x)/x window, cosine window, Kaiser window), filtering, interpolation, fitting, calculus, correlation analysis, FFT, DFT, etc. (15) Statistical process SPC and histogram, measurement reliability and repeatability GageR&R report. (16) Supports display of "Bitmap", "ICON" image files and playback of "Wav" sound files. (17) Supports "ordinary oscilloscope" and "multi-ordinate oscilloscope". (18) Supports Socket socket programming. I. File Description 1: File: WinSail Industrial Control Development System.doc ------ Brief user manual of the WinSail system 2: Directory: WinToDos --------------------- Conversion program 3: Directory: include2 --------------------- System "header files" and "library files" 4: Directory: Sail3000 --------------------- Application project examples 5: Directory: Application ------------------ VC++ program, with multiple dialog boxes II. File Description in the include2 Directory 01: Barcode.h --------- Header file for barcode display/printing, class interface 02: DownComm.h ---------- COMM port communication, class interface 03: Foxpro.h ------------ Foxpro 2.6 database, class interface 04: GageRR.h ------------ Report on measurement reliability and repeatability, class interface 05: Graph.h ------------- Oscilloscope and multi-ordinate oscilloscope, class interface 06: HglgPrit.h ---------- Display of text, BITMAP pictures, ICON icons, WAV sound playback, API interface 07: Kernal.h ------------ Multitasking, API interface 08: Listing.h ----------- Double linked list, class interface 09: Memroy.h ------------ XMS and EMS memory, class interface 10: Mouse.h ------------ Mouse, API interface 11: MyFrame.h ---------- Control and kernel initialization, class and API interface 12: NewMath.h ---------- Math library, API interface 13: Register.h --------- Reading and writing access of text INI file, class interface 14: Relay.h ------------ Object-oriented I/O access, API interface 15: Spc.h -------------- Process statistical control SPC, class interface 16: SVga_Dev.h --------- Graphics driver for resolutions 800*600*256, 1024*768*256, API interface 17: Symbol.h ----------- Symbol definition 18: EgavgaF.Obj -------- BC31 far call driver program 19: Sail.Lib ----------- System library file III. File Description in the Sail3000 Directory 01: Config.Sys ----------- System driver configuration file 02: Display.Fon ---------- 8*16 English character library and 16*16 simplified Chinese character library 02: DisplayF.Fon --------- 8*16 English character library and 16*16 traditional Chinese character library 03: Dwpword.Exe ---------- File for viewing user and password (advanced application) 04: Pass.Bin ------------- User and password database, binary 05: Mouse.Com ------------ Mouse driver program 06: Sail2000.Cpp --------- Example of source file of user project 07: Sail2000.Prj --------- Example of project file of user project 08: Sail2000.Exe --------- Main program of user project 09: a.bat ---------------- Batch file of user project 10: Sys\Destop.Sys ------- Desktop configuration file of user project 11: Sys\Manager.Sys ------ Desktop configuration file of user project 12: Sys\Relay.Sys -------- I/O configuration file of user project 13: Bmp\Computer.Bmp----- A picture used by the kernel 14: Bmp\Desktop.Bmp------ A picture used by the kernel 15: Bmp\Winnt.BMp-------- A picture used by the password box 16: Bmp\Sail200.Ico------ Default title bar icon of the window 17: Bmp\BookS??.Ico------ Default icon of the menu 18: Bmp\MsgBox??.Ico----- Icon used by the information box 19: Bmp\Display.Ico------ A icon used by the kernel 20: Bmp\Net.Ico---------- A icon used by the kernel IV. File Description in the WinToDos Directory For the files in the VC project, only the "Project.rc" and "Resource.h" files are valuable 01: MakeDlg.Exe ---------- Convert the resource dialog box in VC into the source program of the WinSail dialog box 02: RegisterDll.Dll ------ DLL file supporting MakeDlg.Exe to access the text INI registry V. Configuration Instructions for DOS Boot File Assume the directory name of Win is "c:\Windows" and the directory of BC31 is "C:\Bc31" Please configure C:\Config.Sys as follows Device = C:\Windows\Himem.Sys/TestMem:Off Device = C:\Windows\Emm386.Exe Ram HighScan DOS = High,Umb Stacks = 9,256 Files = 25 Please configure C:\Autoexec.Bat as follows path C:\Windows;C:\Windows\Command;C:\Bc31\Bin Lh SmartDrv.Exe VI. Requirements for the Main() Main Function 1: Need to include the header files "Symbol.h" and "MyFrame.h" 2: First call the BOOL InitSystem(int argc, char** argv) kernel initialization function 3: Write your own code in the middle 4: Finally call the BOOL CloseSystem() kernel exit function. 5: Example: #include "Symbol.h" #include "Myframe.h" extern unsigned _strlen = 60u * 1024u; void far TransrateKey(CObject* pCurObj) { return(0); } int main(int argc, char** argv) { // Kernel initialization of the system if (!InitSystem(argc, argv)) { ::CloseSystem() ; ::printf("\nInit System Error!" ; return(0); } // Start of user code //…… // End of user code // Exit the system kernel ::CloseSystem(); return(1); } VII. How to Create the Sail2000 Project and Code 01: Install BC31 on drive C, preferably the directory is C:\Bc31 02: The user creates an "Include2" directory in their own BC31 directory 03: Copy all files in include2\*.* to the "include2" directory of C:\bc31 04: In the BC31 integrated environment, set the "include include" path to "c:\bc31\include2;c:\bc31\include" 05: In the BC31 integrated environment, set "Large" large mode; "Default for memory model" default memory mode. 06: In the BC31 integrated environment, set Floating Point to "80287/387" and Instruction Set to "80386" 07: In the BC31 integrated environment, create a project, assume the project name is Sail2000.Prj 08: Add the kernel library file C:\BC31\include2\Sail.Lib to the project 09: Add the graphics library file C;\BC31\include2\Egavgaf.Obj to the project 10: In the project, the default window virtual keyboard function void far TransrateKey(CObject* pCurObj) must be written, generally as follows void far TransrateKey(CObject* pCurObj) { return(0); }
Forum Jump: