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-06-20 06:35
中国DOS联盟论坛 » DOS启动盘 & LOGO技术 (启动盘室) » Programs that use hidden partition data after DOS boots, the source code is open! View 13,732 Replies 32
Original Poster Posted 2005-07-23 23:04 ·  中国 湖北 天门 联通
中级用户
★★
绝不写垃圾帖
Credits 322
Posts 99
Joined 2004-07-03 00:00
21-year member
UID 27774
Gender Male
From 湖北
Status Offline
I made a post last year Is there anyone who has a way to make hidden partitions visible in DOS?, which mentioned two ideas:

The first idea: Add a segment of program in the boot sector of the system recovery disk. After it resides in memory, it takes over Int13H. For the reading of the ID of the backup partition (1BH), it returns 0BH to make the partition visible. After the subsequent DOS starts, this partition will naturally be visible. This is a practice similar to boot-sector viruses.
The second idea: After the DOS of the system recovery disk starts, a program finds the hidden backup partition and adds it as a normal FAT32 partition to the device chain of DOS and assigns the corresponding drive letter. This is a practice similar to NTFSDOS.


I hope someone can use this idea to make some tools, but after a long time, I still haven't seen it. I myself am too lazy to care and started using batch processing to find partitions for GHOST to call.
This year I saw this post again, and finally I don't want to be lazy. Since I'm still not clear about the details of DOS, I wrote a boot program to do it. Finally, there was a result. It passed the test in Bochs-2.1.1 and VM, and can deceive DOS to assign drive letters to hidden partitions of 1B and 1C formats after startup. I bring it here and hope friends can help test it with redundant real hard drives. (Special reminder, I guarantee that there is no code writing MBR in the program, but it's hard to guarantee all accidents, it's best to use a real hard drive that doesn't save important data to do it!)

Download address:
It has been changed to the one compiled on August 23, see the attachment.
Test method:
Unzip the downloaded ZIP file and prepare a boot disk image file.
Run the image modification program in the unzipped directory, in the format
  MAKEIMG <original image file> <new image file>
The generated new image file can be tested in the virtual machine. If you want to test in a real machine, you can write it to a floppy disk or use software such as VFLOPPY to do it.

VMware screenshots:




The following is the programming record:
This is a program used to boot the boot floppy disk of my system backup/restoration CD. It will be placed in the first sector of the floppy disk. When this program boots the system, a prompt appears. The user can choose to press any key to boot the tool floppy disk, or boot the operating system on the hard drive after waiting for 8 seconds. After choosing to boot DOS from the tool floppy disk, the FAT32 primary partition (0B/0C) hidden in the MBR will be assigned a drive letter and become visible, so that conventional tools can be used to make backups - back up in the hidden partition, see who can delete it!
Final version: 2005/7/23 2005/6/29
Postscript:
The version on June 29 only handled the traditional INT13 function 2, so it worked normally in the small hard disk (1B-FAT32) in the virtual machine. As soon as it came to the partition (1C-FAT32LBA, 1E-FAT16LBA) read in LBA mode, it was done. But now there are no hard drives below 8GB, and reading is almost all in LBA mode.
July 23:
Added the takeover of the extended INT3 reading (42nd) function to realize the reading of the hidden LBA partition. Since there are almost no partitions using FAT16 on current hard drives, only FAT32 is processed.
Due to the addition of the new code, my original prompt information was also cut off a part.

【Current latest version】
  HFBOOT.ASM is still from September 1st, and MAKEIMG.EXE was compiled after adding options on September 5th

  The new command line is as follows:
  MAKEIMG source image file name
   Source image file name: The floppy disk image file used to make the function of displaying hidden partitions
   Destination image file name: The floppy disk image file with the function of displaying hidden partitions to be generated, which can be omitted, and the default value is YISIR.IMG
  Optional parameters:
   /f: The generated program directly boots from the floppy disk when the computer starts.
   /b: The generated program directly activates the hidden partition and starts when the computer starts. (Note that the operating system must be installed in the hidden partition. This function also does not write MBR)
  When there are no /f and /b parameters, a prompt will appear and wait for 8 seconds. During this period, press any key to boot from the floppy disk, otherwise boot from the hard drive and do not load the function of displaying hidden partitions.
   /k:n: n=1-4, 6-12. Set the key used to directly activate the hidden partition and start, which can be F1-F4, F6-F12
/p:n: n=0 - 255, customize the character that constitutes the progress bar, the default is 62 which is ">", like 219 (solid square), 220, 223 are also good-looking
/r:n: n=1 - 24, customize the starting line of the prompt information on the screen, the default is line 21, that is, display the prompt on line 21 and the progress bar on line 22.
   /u: Uninstall this program, restore the image file generated by this program, and save the result as an image file.

I hope friends who download and use this software will post messages or leave messages on my small station to talk about their opinions.

[ Last edited by TurboY on 2005-9-6 at 15:38 ]
Recent Ratings for This Post ( 1 in total) Click for details
RaterScoreTime
+1 2010-03-22 20:16
从95年开始用DOS3.2,96年在Windows3.1里认识了鼠标,97年开始用Win95,98年装过NetWare,99年迷过Linux,现在用WinXP、WinME和DOS7.1。一回首,从盲到忙,从忙到茫。
Floor 2 Posted 2005-08-05 10:50 ·  中国 河南 洛阳 联通
高级用户
★★
Credits 544
Posts 164
Joined 2004-10-17 12:00
21-year member
UID 32648
Gender Male
Status Offline
The building host is very creative, and I'm going to repost it! SYSOFT.ZDWX.COM and BBS.WUYOU.COM

But it's better for the building host to write a special small program for creating hidden partitions. After I tested this boot disk, I found that it doesn't support hidden partitions created by programs like HIDE.COM, PQ, GRUB, etc. It would be even better if this small boot program could support HPA partitions!

Looking forward to it!

[ Last edited by hnlyzhd on 2005-8-5 at 10:56 ]
我的留言簿

http://hnlyzhd.ys168.com 我的网络盘
Floor 3 Posted 2005-08-11 19:07 ·  中国 湖北 天门 联通
中级用户
★★
绝不写垃圾帖
Credits 322
Posts 99
Joined 2004-07-03 00:00
21-year member
UID 27774
Gender Male
From 湖北
Status Offline
Thanks for your attention! Here's the thing: since the program is in the boot sector and only has 512 bytes, and some space needs to be reserved, the code can't be too long (maybe with optimization, it can handle more partition types, I'll squeeze it later). Currently, this program only handles two types of hidden partitions, namely 0X1B (FAT32) and 0X1C (FAT32-LBA), and they can only be primary partitions (defined in the MBR). Theoretically, as long as it's a hidden partition converted from a partition type supported by DOS, it should be fine. You can post the common type codes of these hidden partitions, and then I can add them all.
从95年开始用DOS3.2,96年在Windows3.1里认识了鼠标,97年开始用Win95,98年装过NetWare,99年迷过Linux,现在用WinXP、WinME和DOS7.1。一回首,从盲到忙,从忙到茫。
Floor 4 Posted 2005-08-12 13:17 ·  中国 河南 洛阳 联通
高级用户
★★
Credits 544
Posts 164
Joined 2004-10-17 12:00
21-year member
UID 32648
Gender Male
Status Offline
I still don't quite understand the types of hidden partitions. Sorry about that!
You can use software like GRUB or PQ or ACRONIS to test. The more hidden partitions it supports, the better.
我的留言簿

http://hnlyzhd.ys168.com 我的网络盘
Floor 5 Posted 2005-08-13 20:28 ·  中国 广东 汕头 电信
银牌会员
★★★
Credits 1,451
Posts 446
Joined 2002-10-20 00:00
23-year member
UID 29
Gender Male
Status Offline
List the types of hidden partitions I currently know:
11, 14, 16, 17, 1b, 1c, 1e, 26
If this thing can support HPA, it would be perfect. Of course, if the space is too small to support it, can it be made into a separate software then.

[ Last edited by pfox on 2005-8-13 at 20:36 ]
Floor 6 Posted 2005-08-14 22:51 ·  中国 湖北 天门 联通
中级用户
★★
绝不写垃圾帖
Credits 322
Posts 99
Joined 2004-07-03 00:00
21-year member
UID 27774
Gender Male
From 湖北
Status Offline
I just found a lot of useful information in the FDISKPT.INI file that comes with DOS7.10's FDISK. I can find the following corresponding relationships:
11 -- 01 FAT12
14 -- 04 FAT16
16 -- 06 FAT16(BIGDOS)
17 -- 07 NTFS
1b -- 0b FAT32
1c -- 0c FAT32 LBA
1e -- 0e FAT16 LBA
26 --? I don't know what the original type is.
With these correspondences, I can start working.
从95年开始用DOS3.2,96年在Windows3.1里认识了鼠标,97年开始用Win95,98年装过NetWare,99年迷过Linux,现在用WinXP、WinME和DOS7.1。一回首,从盲到忙,从忙到茫。
Floor 7 Posted 2005-08-16 09:42 ·  中国 广东 汕头 电信
银牌会员
★★★
Credits 1,451
Posts 446
Joined 2002-10-20 00:00
23-year member
UID 29
Gender Male
Status Offline
Originally posted by TurboY at 2005-8-14 10:51 PM:
I just found a lot of useful information in the FDISKPT.INI file of DOS7.10's FDISK. The following corresponding relationships can be found:
11 -- 01 FAT12
14 -- 04 FAT16
16 -- 06 FAT16(BIGDOS)
17 -- 07 NTFS
1 ...



Hehe, 26 is the hidden partition type used by spfdisk itself. The types I listed are moved from spfdisk, so you can't find this in FDISKPT.INI.
Floor 8 Posted 2005-08-19 08:38 ·  中国 浙江 台州 椒江区 电信
中级用户
★★
Credits 447
Posts 126
Joined 2004-02-10 00:00
22-year member
UID 17150
Gender Male
Status Offline
It is suggested to post the source program so that everyone can improve it together.
从来不用别人的东西,要用,也先改成自己的再说!
Floor 9 Posted 2005-08-19 08:57 ·  中国 浙江 台州 椒江区 电信
中级用户
★★
Credits 447
Posts 126
Joined 2004-02-10 00:00
22-year member
UID 17150
Gender Male
Status Offline
Oh, I can't help you with this translation request. You can provide other topics for me to translate.
从来不用别人的东西,要用,也先改成自己的再说!
Floor 10 Posted 2005-08-22 22:50 ·  中国 湖北 天门 联通
中级用户
★★
绝不写垃圾帖
Credits 322
Posts 99
Joined 2004-07-03 00:00
21-year member
UID 27774
Gender Male
From 湖北
Status Offline
I'm using NASM, and the program is boot sector code. The friend above had issues with disassembly. I'm still modifying it. Now I've added a list of recognizable partition flag codes (FlagTable), and I handle them one by one. As long as they are in the table, they can be processed. Currently, it supports 01 - 11, 04 - 14, 06 - 16, 07 - 17, 0b - 1b, 0c - 1c, 0e - 1e. Those not in the list can also be added quickly. Everyone can download the new one here.
http://yisir.softhome.cn/yisir/hfboot/fortestd.zip
从95年开始用DOS3.2,96年在Windows3.1里认识了鼠标,97年开始用Win95,98年装过NetWare,99年迷过Linux,现在用WinXP、WinME和DOS7.1。一回首,从盲到忙,从忙到茫。
Floor 11 Posted 2005-08-24 20:21 ·  中国 河南 洛阳 联通
高级用户
★★
Credits 544
Posts 164
Joined 2004-10-17 12:00
21-year member
UID 32648
Gender Male
Status Offline
I used GRUB to hide a partition with model number 1B, but after booting with this, the hidden partition is still not recognized.
我的留言簿

http://hnlyzhd.ys168.com 我的网络盘
Floor 12 Posted 2005-08-25 09:08 ·  中国 湖北 天门 联通
中级用户
★★
绝不写垃圾帖
Credits 322
Posts 99
Joined 2004-07-03 00:00
21-year member
UID 27774
Gender Male
From 湖北
Status Offline
The 1B partition I tried on the computer in my machine room is okay. Is your this partition a primary partition? This program can only handle primary partitions.
从95年开始用DOS3.2,96年在Windows3.1里认识了鼠标,97年开始用Win95,98年装过NetWare,99年迷过Linux,现在用WinXP、WinME和DOS7.1。一回首,从盲到忙,从忙到茫。
Floor 13 Posted 2005-08-25 10:22 ·  中国 河南 洛阳 联通
高级用户
★★
Credits 544
Posts 164
Joined 2004-10-17 12:00
21-year member
UID 32648
Gender Male
Status Offline
Oh, I see. You didn't explain it. I'm dealing with an extended partition. Hehe, can it support extended partitions?
我的留言簿

http://hnlyzhd.ys168.com 我的网络盘
Floor 14 Posted 2005-08-25 10:25 ·  中国 河南 洛阳 联通
高级用户
★★
Credits 544
Posts 164
Joined 2004-10-17 12:00
21-year member
UID 32648
Gender Male
Status Offline
There is also a better idea:
For example, IBM's F11 activates the hidden partition, and ACRONIS's F11 activates the hidden partition and then boots the corresponding recovery program from the hidden partition. These all need to be written to the MBR. Can we write a boot code to activate them from software?
Or directly load and activate with NTLDR?
我的留言簿

http://hnlyzhd.ys168.com 我的网络盘
Floor 15 Posted 2005-08-26 12:32 ·  中国 湖北 天门 联通
中级用户
★★
绝不写垃圾帖
Credits 322
Posts 99
Joined 2004-07-03 00:00
21-year member
UID 27774
Gender Male
From 湖北
Status Offline
It should be okay like IBM and ACRONIS. Adding a function to boot from a hidden partition in this program can be done, but I need to squeeze a bit more. There's not much space in 512 bytes to write too many programs. Loading with NTLDR is also possible, and I'll try it now.
从95年开始用DOS3.2,96年在Windows3.1里认识了鼠标,97年开始用Win95,98年装过NetWare,99年迷过Linux,现在用WinXP、WinME和DOS7.1。一回首,从盲到忙,从忙到茫。
Forum Jump: