liuzhaoyzz 发表于 2021-2-10 14:58:29

请问下怎么知道某个硬盘有几个主分区?

请问下怎么知道某个硬盘有几个主分区?
给你一个盘符,想要获取这个盘符对应的硬盘是MBR还是GPT的,有几个主分区,分别是哪几个?
cxdirx86可以显示,但是对于用partnew新建的分区也会显示出来,会造成干扰,难以准确地过滤掉。关键词unknown感觉不是太靠谱。
友情5大空闲的时候出手。

liuzhaoyzz 发表于 2021-2-10 18:58:27

527104427 发表于 2021-2-10 18:40
逻辑分区要显示不?

逻辑分区是否显示无所谓,显示也行,最好另起一行,有个关键词便于定位。

liuzhaoyzz 发表于 2021-2-10 22:02:41

527104427 发表于 2021-2-10 20:27
仿照一下,-ChkAllDrvInfo或-ChkDrvInfoF:
你试试能否符合要求

感谢5大!应该可以了,我再详细测试下看看。

nttwqz 发表于 2021-2-10 22:13:32

我觉得吧,你要是看下dpinfo末尾的注释,搜索脚本定制,套用个for,你就不会问这个问题了

liuzhaoyzz 发表于 2021-2-10 22:33:11

nttwqz 发表于 2021-2-10 22:13
我觉得吧,你要是看下dpinfo末尾的注释,搜索脚本定制,套用个for,你就不会问这个问题了

5大的程序,还有很多其他的功能,集成在一起,挺好用的。

dos时代菜鸟 发表于 2021-2-10 23:54:18

mbr 结构硬盘 最多4个
GPT 的 除了几个特定的efi引导分区 啥的就都是主分区

你要这样的结果有啥目的么?是单独的就要个个数呀,还是要具体分区信息呢?

liuzhaoyzz 发表于 2021-2-11 09:51:15

本帖最后由 liuzhaoyzz 于 2021-2-11 09:55 编辑

dos时代菜鸟 发表于 2021-2-10 23:54
mbr 结构硬盘 最多4个
GPT 的 除了几个特定的efi引导分区 啥的就都是主分区


MBR/GPT主分区数我知道的。

搞这个的目的也是为了折腾。
用于partnew方案启动原生不支持整体启动的linux.iso方案,partnew方案会创建一个分区表项,并把iso“挂载到”这个对应的分区表项,相当于“虚拟”出一个磁盘。
cxdir会检测到这个“虚拟磁盘”,但是如果用“unknown”作为关键字过滤这种“虚拟磁盘”感觉不太可靠,所以想让5大重写一个。
如果有主分区个数直接显示出来最好,就是给一个盘符,显示出这个盘符所在的硬盘是哪一个,有几个主分区,主分区的盘符是什么。大概是这样子。

liuzhaoyzz 发表于 2021-2-11 12:06:44

527104427 发表于 2021-2-11 12:01
忘记更新帮助界面了

感谢!

austere 发表于 2021-2-15 01:07:21

5大又出山了哈

沙漠斗鱼 发表于 2021-3-5 22:26:53

liuzhaoyzz 发表于 2021-2-10 22:02
感谢5大!应该可以了,我再详细测试下看看。

五大这个软件在哪里下载呀?

liuzhaoyzz 发表于 2021-3-5 23:09:00

沙漠斗鱼 发表于 2021-3-5 22:26
五大这个软件在哪里下载呀?

https://liuzhaoyzz.lanzoui.com/i0nWUm55ode

沙漠斗鱼 发表于 2021-3-6 22:52:08

527104427 发表于 2021-2-10 20:27
仿照一下,-ChkAllDrvInfo或-ChkDrvInfoF:
你试试能否符合要求

五大出手,必属精品。论坛有五大更精彩。
你这软件,我有一事不明,还望五大出手。
怎么把显示的空格变为竖线分割呀?
1:1|        N:|        100MB|        49.36MB|        | ESP|        FAT|                | GPT|        0
我想显示成这种,不知道你wcz文件里怎么改?
琢磨了两天无解,还请五大出手。
代码里改的应该是下面这句,但我改了不合适,恳请五大出手
ENVI-ret %~4= %~2%&TAB%%&DriveLetter%%&TAB%%&AllSize%%&TAB%%&AvailableSize%%&TAB%%&PartType%%&TAB%%&FileSystem%%&TAB%%&VolumeLabel%%&TAB%%&MBRtype%%&TAB%%&ActFlag%
_END

2012wjia 发表于 2021-3-6 23:12:42

沙漠斗鱼 发表于 2021-3-7 07:47:27

527104427 发表于 2021-3-6 23:16
ENVI-ret %~4= %~2|%&TAB%%&DriveLetter%|%&TAB%%&AllSize%|%&TAB%%&AvailableSize%%&TAB%| %&PartType%| ...

感谢五大!
五大出手,实属大牛!
五大,pecmd编程没落了,估计也就你和阿弥陀佛大神熟悉,条件允许的话可否在论坛教教我们这些菜鸟?让它继续发扬光大,个人建议而已!红毛去年讲了几次,后来不讲了,可惜。

2013mqqdg 发表于 2021-3-27 12:04:31

diskpart应该能行吧

wintoflash 发表于 2022-1-7 19:43:59


liuzhaoyzz 发表于 2022-1-7 21:38:09

wintoflash 发表于 2022-1-7 19:43


等你完善后我试试。
5大的程序是基于mdyblog的pecmd的,pecmd稍微有点大,有时候会被弱智杀软干掉。
你的这个能过弱智杀软吗?

wintoflash 发表于 2022-1-7 21:52:44

liuzhaoyzz 发表于 2022-1-7 21:38
等你完善后我试试。
5大的程序是基于mdyblog的pecmd的,pecmd稍微有点大,有时候会被弱智杀软干掉。
你 ...

https://www.virustotal.com/gui/file/c0662de4308c070a1450327e311f9076cedc51b1ddc651733d752108a3ab44cb/detection

liuzhaoyzz 发表于 2022-1-7 22:03:13

wintoflash 发表于 2022-1-7 21:52
https://www.virustotal.com/gui/file/c0662de4308c070a1450327e311f9076cedc51b1ddc651733d752108a3ab44 ...

像是
https://www.virscan.org/
https://www.virustotal.com
对于实战没有太大的意义,因为大家都知道没有病毒啊。

我的问题是,实战中编译后的程序有可能会被弱智杀软干掉。比如360特别奇葩,对于它不认识的md5的exe文件,误报的几率很大,我给别人解释起来感觉好费劲,写个程序出来不能总是自己用吧,总要给别人用。不知道啥时候360能倒闭。

wintoflash 发表于 2022-1-7 22:11:14

liuzhaoyzz 发表于 2022-1-7 22:03
像是
https://www.virscan.org/
https://www.virustotal.com


有意义的,为了检测我写的exe没有一些不规范操作或者漏洞。

https://github.com/a1ive/diskfire/releases/tag/latest
你可以自己用360查下毒。反正就连ventoy这种,各种杀软都误报,足以说明追求不报毒是没有意义的。

liuzhaoyzz 发表于 2022-1-7 23:02:26

本帖最后由 liuzhaoyzz 于 2022-1-7 23:12 编辑

wintoflash 发表于 2022-1-7 22:11
有意义的,为了检测我写的exe没有一些不规范操作或者漏洞。

https://github.com/a1ive/diskfire/relea ...
感谢分享!

刚才下载360试了下,diskfire_x86.exe还是被报,我已提交反馈。https://open.soft.360.cn/report.php
反正就连ventoy这种,各种杀软都误报,足以说明追求不报毒是没有意义的。确实如此!


liuzhaoyzz 发表于 2022-1-7 23:15:43

本帖最后由 liuzhaoyzz 于 2022-1-8 09:20 编辑

diskfire [-d=DEBUG] [-m=FILE ...] COMMAND
OPTIONS:
-d=DEBUGSet debug conditions.
-m=FILE   Make a virtual drive (ldX) from a file.
COMMANDS:

help
Print help text.

fwgetvar VARIABLE
Display a UEFI variable.
OPTIONS:
-g={GUID}    Specify the GUID of the UEFI variable.
-t=TYPE      Specify the type of the UEFI variable:
   HEX       Hexadecimal bytes
   UINT      Unsigned integer
   UTF8      UTF-8 encoded string
   UCS2      UCS-2 encoded string
   DEVP      UEFI device path
-o=FILE      Dump variable data to a file.

fwsetvar OPTION VARIABLE
Set a UEFI variable.
OPTIONS:
-g={GUID}    Specify the GUID of the UEFI variable.
-u         Unset UEFI variable.
-t=TYPE      Specify the type of the UEFI variable:
   HEX       Hexadecimal bytes
   UTF8      UTF-8 encoded string
   UCS2      UCS-2 encoded string
-i=DATA      Specify input data.
-a=ATTR      Specify variable attributes.

mount FILE
Mount VHD|ISO using AttachVirtualDisk WINAPI.

umount FILE
Unmount VHD|ISO.

cat FILE
Show the contents of a file.

dd OPERAND ..
Copy a file, converting and formatting according to the operands.
OPERANDS:
if=FILE|DISK    read from FILE or DISK
of=FILE|DISK    write to FILE(convert to blocklists) or DISK
bs=SIZE         Specify block size (1~8192).
count=N         Specify number of blocks to copy.
skip=N          Skip N bytes at input.
seek=N          Skip N bytes at output.

pbr DISK
PBR tool.
OPTIONS:
-i=TYPE      Install PBR to disk partition.
    -o=CMD   Specify extra options for PBR.
TYPES:
    GRUB4DOS   GRUB4DOS PBR, extra options:
      <NAME>   Rename GRLDR.
    NT5      Windows NT5 PBR
    NT6      Windows NT6+ PBR
-b=FILE      Backup PBR to FILE.
    -s=N       Specify number of sectors to backup.
-r=FILE      Restore PBR from FILE.
    -x         Do NOT keep original BPB (BIOS Parameter Block).

mbr DISK
MBR tool.
OPTIONS:
-i=TYPE      Install MBR to disk.
    -o=CMD   Specify extra options for MBR.
TYPES:
    EMPTY      Empty MBR
    GRUB4DOS   GRUB4DOS MBR
    NT5      Windows NT5 MBR
    NT6      Windows NT6+ MBR
    RUFUS      Rufus MBR
    ULTRAISO   UltraISO USB-HDD+ MBR
    SYSLINUX   SYSLINUX 6.02 MBR
    WEE      WEE63 MBR, extra options:
      <MENU>   Import custom WEE menu.
-b=FILE      Backup MBR to FILE.
    -s=N       Specify number of sectors to backup.
-r=FILE      Restore MBR from FILE.
    -x         Do NOT keep original disk signature and partition table.

blocklist FILE
Print a block list.

stat FILE
Display file status.

hxd FILE
Show raw contents of a file.
OPTIONS:
-d    Decompress file.
-s=NSkip N bytes from the beginning of file.
-n=NRead only N bytes.

hashsum OPTIONS FILE
Compute hash checksum.
OPTIONS:
--md5      Compute MD5 checksum.
--crc32    Compute CRC32 checksum.
--sha1   Compute SHA1 checksum.
--sha256   Compute SHA256 checksum.

probe OPTIONS
Retrieve disk info.
OPTIONS:
--partmap   Determine partition map type.
--fs      Determine filesystem type.
--fsuuid    Determine filesystem UUID.
--label   Determine filesystem label.
--size      Determine disk/partition size (bytes).
--start   Determine partition starting LBA (sectors).
--bus       Determine bus type.
--rm      Determine if the disk is removable.
--pid       Determine product id.
--vid       Determine vendor id.
--letter    Determine drive letters.
--partuuidDetermine partition UUID.
--flag      Determine partition flags.

extract [-d] SRC_FILE DST_FILE
Extract file from source location.
-dDecompress source file.

ls [-l]
List disks and files.
-lShow a long list with more detailed information.

bin2c OPTIONS FILE
Convert binary file to C language array.
OPTIONS:
-i=FILESpecify input binary file.
-a=NAMESpecify array name.
-l=N   Specify input length.
-n       Do not write data length to output.
-s       Use static variables.
-c=N   Specify column number .

看起来超级强大啊,几乎相当于bootice的命令行版本了。晚点再试试
你应该单独发帖。
github访问比较卡,上传个临时版本到这里,以后删除。

liuzhaoyzz 发表于 2022-1-8 09:19:40

本帖最后由 liuzhaoyzz 于 2022-1-8 09:27 编辑

wintoflash 发表于 2022-1-7 19:43

F:\bak\diskfire>diskfire_x64.exe probe --partmap f:
error: disk f: not found.

F:\bak\diskfire>diskfire_x64.exe probe --fs F:
error: disk F: not found.

F:\bak\diskfire>diskfire_x64.exe probe f:
hd0
hd0,msdos3
hd0,msdos2
hd0,msdos1
hd1
hd1,msdos2
hd1,msdos1
hd2
hd2,msdos1

好像参数有点问题啊?disk用什么表示的?f:这样子的windows表示方法不行吗?

1、哦,试了下,disk应该用hd0这样子的,问题是diskfire_x64.exe probe提示error: missing arguments.
F:\bak\diskfire>diskfire_x64.exe probe
error: missing arguments.


2、diskfire_x64.exe probe hd0,为啥还显示出了hd1?
F:\bak\diskfire>diskfire_x64.exe probe hd0
hd0
hd0,msdos3
hd0,msdos2
hd0,msdos1
hd1
hd1,msdos2
hd1,msdos1
hd2
hd2,msdos1

3、hd2是vhd,似乎不能获取uuid?
F:\bak\diskfire>diskfire_x64.exe probe --fsuuid hd2
error: unknown filesystem.



liuzhaoyzz 发表于 2022-1-9 08:06:19

wintoflash 发表于 2022-1-7 22:11
有意义的,为了检测我写的exe没有一些不规范操作或者漏洞。

https://github.com/a1ive/diskfire/relea ...

    亲爱的软件开发者
        您好!

经360软件开放平台检测,您于2022-01-07 23:09:57提交的软件ID:3977029的diskfire.zip审核未通过。

您提交的备注信息:https://github.com/a1ive/diskfire/releases/tag/latest


拒绝原因:软件存在风险未通过检测,如有需要请添加本地信任使用

请参考360软件开放平台软件检测标准: http://open.soft.360.cn/guide/guide_2.html?i=4

360直接拒绝了,源代码都给他们展示了,他们都不放行,可见有多么龌龊!收保护费也不能这样子呀!

他们也是程序员,为何程序员要去为难程序员?
页: [1]
查看完整版本: 请问下怎么知道某个硬盘有几个主分区?