无忧启动论坛

 找回密码
 注册
搜索
系统gho:最纯净好用系统下载站广告联系 微信:wuyouceo QQ:184822951
查看: 3302|回复: 12
打印 上一主题 下一主题

[讨论] Reg2Inf 源码改进,C#和正则式

[复制链接]
跳转到指定楼层
1#
发表于 2019-1-31 11:30:28 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
本帖最后由 2010hook 于 2019-2-1 10:19 编辑

名称:Reg2Inf 0.46
作者:n7Epsilon
出处:https://ryanvm.net/forum/viewtopic.php?t=2169
下载:http://cid-704054d7328ec826.skyd ... Reg2Inf%5E_0.46.zip
本坛下载附件

此工具,可能是同类最好,但还不完善。
若使用“/RepVars”参数,会把 “C:\Program Files (x86)\Common Files” 转成 “%16422% (x86)\Common Files”,注册表的路径也这么转哦。文件夹层次也没根据“\”划分。
x86 对应的应该是 16426,而且应该优先处理最长的环境变量。

希望有能力者帮忙改进:
1、针对x64改进,dirids需要补充,见文末。要支持任意盘符转换。
2、[DestinationDirs] 用于指定CopyFiles、RenFiles或DelFiles入口的缺省操作目录。
注册表的路径,转成%24%之类的话,安装时不能转成系统环境路径,%1%也不能得到当前路径,那就不应该这么处理。
注册表的路径数值,应该转成%CommonProgramFiles(x86)%或%%CommonProgramFiles(x86)%%这种形式。
3、关于Unicode字符转换,系统API依赖已安装的代码页,不一定完整,那就优先调用严格的iconv.dll吧。
4、既然能处理好inf,那么稍加改进也能转成cmd吧。
  1. [DestinationDirs]
  2. -1 Absolute path
  3. 1  %~dp0%
  4. 00 Null LDID [this LDID can be used to create a new LDID]
  5. 01 Source Drive_Letter:\Path_Name  (the directory from which the INF file was installed)
  6. 02 Temp Setup
  7. 03 Uninstall
  8. 04 Backup
  9. 10 Windows directory. %SystemRoot%.
  10. 11 System directory. %SystemRoot%\system32.
  11. 12 Drivers directory. %SystemRoot%\system32\drivers.
  12. 13 Driver package's Driver Store directory. For Windows 8.1 and later, specifies the path to the Driver Store directory where the driver package was imported.
  13.    The optional subdirectory in the SourceDiskFiles section for a file must match the subdirectory in the DestinationDirs section for the entry that applies to this file.
  14.    Don't use DelFiles on a file for which DestinationDirs includes dirid 13.
  15.    Don't use CopyFiles to rename a file for which DestinationDirs includes dirid 13.
  16. 14 Control Panel
  17. 15 Printers
  18. 16 Workgroup
  19. 17 INF Directory [%windir%\INF]
  20. 18 Help directory [%windir%\HELP]
  21. 19 Administration
  22. 20 Fonts [%windir%\FONTS]
  23. 21 Viewers [%windir%\SYSTEM\VIEWERS]
  24. 22 VMM32 [%windir%\SYSTEM\VMM32]
  25. 23 Color directory [%windir%\SYSTEM\COLOR]
  26. 24 Root of drive containing the Windows files are installed directory. e.g., if dirid 10 is "C:\winnt", then dirid 24 is "C:".
  27. 25 Shared directory
  28. 26 Guaranteed boot device for Windows (Winboot) [C:\ root]
  29. 27 Machine [%windir%]
  30. 28 Host Winboot [usually C:\ root]
  31. 30 Root directory of the boot disk, also known as "ARC system partition". (This might or might not be the same directory as the one represented by dirid 24.)
  32. 31 Root directory of the Host drive of a virtual boot drive [usually C:\ root]
  33. 50 System directory. This is equivalent to %SystemRoot%\system.
  34. 51 Spool directory. (not used for installing printer drivers - see Printer Dirids)
  35. 53 User profile directory.
  36. 54 Directory where Ntldr.exe and Osloader.exe are located.
  37. 55 Print processors directory. (not used for installing printer drivers)

  38. 16384 %USERPROFILE%\Desktop
  39. 16386 %USERPROFILE%\Start Menu\Programs
  40. 16389 %USERPROFILE%\Documents
  41. 16390 %USERPROFILE%\Favorites
  42. 16391 %USERPROFILE%\Start Menu\Programs\Startup
  43. 16392 %USERPROFILE%\Recent
  44. 16393 %USERPROFILE%\SendTo
  45. 16395 %USERPROFILE%\Start Menu
  46. 16397 %USERPROFILE%\Music
  47. 16398 %USERPROFILE%\Videos
  48. 16400 %USERPROFILE%\Desktop
  49. 16403 %USERPROFILE%\NetHood
  50. 16405 %USERPROFILE%\Templates
  51. 16406 %ALLUSERSPROFILE%\Start Menu
  52. 16407 %ALLUSERSPROFILE%\Start Menu\Programs
  53. 16408 %ALLUSERSPROFILE%\Start Menu\Programs\Startup
  54. 16409 %ALLUSERSPROFILE%\Desktop
  55. 16410 %USERPROFILE%\Application Data
  56. 16411 %USERPROFILE%\PrintHood
  57. 16412 %USERPROFILE%\Local Settings\Application Data
  58. 16415 %ALLUSERSPROFILE%\Favorites
  59. 16416 %USERPROFILE%\Local Settings\Temporary Internet Files
  60. 16417 %USERPROFILE%\Cookies
  61. 16418 %USERPROFILE%\Local Settings\History
  62. 16419 %ALLUSERSPROFILE%\Application Data
  63. 16422 %ProgramFiles%
  64. 16423 %USERPROFILE%\Pictures
  65. 16425 %SystemRoot%\system32 (valid for Microsoft Win32 user-mode applications that are running under Windows on Windows (WOW64))
  66. 16426 Program Files (valid for Win32 user-mode applications that are running under WOW64)
  67. 16427 %ProgramFiles%\Common Files
  68. 16428 Program Files\Common (valid for Win32 user-mode applications that are running under WOW64)
  69. 16429 %ALLUSERSPROFILE%\Templates
  70. 16430 %ALLUSERSPROFILE%\Documents
  71. 16431 %ALLUSERSPROFILE%\Start Menu\Programs\Administrative Tools
  72. 16432 %USERPROFILE%\Start Menu\Programs\Administrative Tools
  73. 16437 %ALLUSERSPROFILE%\Documents\My Music
  74. 16438 %ALLUSERSPROFILE%\Documents\My Pictures
  75. 16439 %ALLUSERSPROFILE%\Documents\My Videos
  76. 16440 %SystemRoot%\Resources
  77. 16441 %SystemRoot%\Resources\0409
  78. 16443 %USERPROFILE%\Local Settings\Application Data\Microsoft\CD Burning
复制代码

评分

参与人数 1无忧币 +5 收起 理由
GaMNiA + 5 赞一个!

查看全部评分

2#
 楼主| 发表于 2019-1-31 12:44:35 | 只看该作者
本帖最后由 2010hook 于 2019-1-31 12:50 编辑

原作者把工具名称、网址插入到每一节开头,有些繁琐,最好改成插入到文件头,一行即可。
还要把不必要的MyRegTweaks相关代码清除。
回复

使用道具 举报

3#
发表于 2019-1-31 14:40:04 | 只看该作者
楼主推介的这个需要依赖 NET!我也收藏有国内某人(忘记了)的 Reg2Inf  C 源码。
本想自己写一个,无奈没时间。
回复

使用道具 举报

4#
 楼主| 发表于 2019-1-31 16:57:19 | 只看该作者
chishingchan 发表于 2019-1-31 14:40
楼主推介的这个需要依赖 NET!我也收藏有国内某人(忘记了)的 Reg2Inf  C 源码。
本想自己写一个,无奈没时 ...

Reg2Inf  C 源码,顺手也发一份吧。
依赖NET,总比VBS堪用啊,只要能转换正确,可以接受。
感觉一个exe就能转 Inf、cmd。要求细致严谨,希望你能突破!

点评

刚找出来,原来跟楼主的相同版本,可我是在好几年前就已收藏了。  发表于 2019-1-31 17:10
回复

使用道具 举报

5#
发表于 2019-1-31 17:23:32 | 只看该作者
一起都来分析一下,好东西
回复

使用道具 举报

6#
发表于 2019-1-31 17:32:02 | 只看该作者
真正找到的是这个!2002年的。
  1. #include <windows.h>
  2. #include <windowsx.h>
  3. #include <commctrl.h>
  4. #include <shlobj.h>
  5. #include <richedit.h>
  6. #include <math.h>
  7. #include <stdio.h>
  8. #include <stdlib.h>
  9. #include <string.h>
  10. #pragma hdrstop

  11. #include "..\api\winapi.h"

  12. int errorcode;
  13. LPSTR errorprompts[]=
  14. {
  15. "This program generates .Inf file from a .Reg file. (by kajaa@eastday.com)\n"
  16. "Syntax:\tReg2Inf [switches] [<SourceFile.Reg> [DestFile.Inf]]\n"
  17. "\tswitches:\n"
  18. "\t\t-w\toutput WHOLE keyname instead of abbreviation\n"
  19. "\t\t-t\toutput in TINY mode, no comments\n"
  20. ,
  21. "Memory Allocation Error\n",
  22. "File cannot be opened\n",
  23. "Memory Allocation Error\n",
  24. "Not a REG File\n",
  25. "File cannot be created\n",
  26. "OK\n",
  27. };

  28. const int RESBUFSIZE=65500;
  29. int skipbytes, knlsize;
  30. LPSTR ComBuf,srcfile,destfile,destBuffer;

  31. LPSTR WINAPI skipwhitespace(LPSTR buffer,int comment)
  32. {
  33. LPSTR lp;
  34. lp=buffer;
  35. while (*lp)
  36.         {
  37.         if (!comment)
  38.                 {
  39.                 switch(*lp)
  40.                         {
  41.                         case 0x9:
  42.                         case 0x20: break;
  43.                         case ';': comment=1; break;
  44.                         default:
  45.                                 if (IsReturn(lp)) ++lp;
  46.                                 else{
  47.                                         if (*lp!='\r'&&*lp!='\n') return lp;
  48.                                         break;
  49.                                         }
  50.                         }
  51.                 ++lp;
  52.                 }
  53.         else{
  54.                 if (IsReturn(lp)) ++lp, comment=0; else{ if (*lp=='\r'||*lp=='\n') comment=0; }
  55.                 ++lp;
  56.                 }
  57.         }
  58. return lp;
  59. }

  60. #define INFHEADER \
  61. "[Version]\r\nSignature="$CHICAGO$"\r\nProvider=kajaa@eastday.com, 2002\r\n\r\n"\
  62. "[DefaultInstall]\r\n"\
  63. "; DelReg=$PZ_DelReg\r\n"\
  64. "AddReg=$PZ_AddReg\r\n"

  65. #define INFCOMMENTS \
  66. "; reg-root-string, [subkey], [value-name], [flags], [value]\r\n"\
  67. ";DelReg=$PZ_DelReg\r\n"\
  68. "; reg-root-string, subkey, [value-name]\r\n"\
  69. ";Delfiles=$PZ_Delfiles\r\n"\
  70. "; file-name[,,,flag]\r\n"\
  71. ";Renfiles=$PZ_Renfiles\r\n"\
  72. "; new-file-name,old-file-name\r\n"\
  73. ";Copyfiles=$PZ_Copyfiles\r\n"\
  74. "; destination-file-name[,source-file-name][,temporary-file-name][,flag]\r\n"\
  75. ";UpdateInis=$PZ_UpdateInis\r\n"\
  76. "; ini-file,ini-section,[old-ini-entry],[new-ini-entry],[flags]\r\n"\
  77. "\r\n"\
  78. "[DestinationDirs]\r\n"\
  79. "; -01 or 0xffff The directory from which the INF was installed.\r\n"\
  80. "; 01 SourceDrive:\\path.\r\n"\
  81. "; 10 Windows directory.\r\n"\
  82. "; 11 System directory. (%windir%\\system on Windows 95, %windir%\\system32 on Windows NT)\r\n"\
  83. "; 12 Drivers directory.(%windir%\\system32\\drivers on Windows NT)\r\n"\
  84. "; 17 INF file directory.\r\n"\
  85. "; 18 Help directory.\r\n"\
  86. "; 20 Fonts directory.\r\n"\
  87. "; 21 Viewers directory.\r\n"\
  88. "; 24 Applications directory.\r\n"\
  89. "; 25 Shared directory.\r\n"\
  90. "; 30 Root directory of the boot drive.\r\n"\
  91. "; 50 %windir%\\system\r\n"\
  92. "; 51 Spool directory.\r\n"\
  93. "; 52 Spool drivers directory.\r\n"\
  94. "; 53 User Profile directory.\r\n"\
  95. "; 54 Path to ntldr or OSLOADER.EXE\r\n"

  96. #define INFBEGIN "\r\n[$PZ_DelReg]\r\n\r\n[$PZ_AddReg]"


  97. LPSTR curkeyname,root,key;
  98. int WINAPI whichroot(LPSTR lp)
  99. {
  100. #define HKLM "HKEY_LOCAL_MACHINE"
  101. #define HKCU "HKEY_CURRENT_USER"
  102. #define HKU "HKEY_USERS"
  103. #define HKCR "HKEY_CLASSES_ROOT"
  104. #define HKLMSC "HKEY_LOCAL_MACHINE\\SOFTWARE\\Classes"

  105. if (strncmpi(lp, HKLMSC, sizeof(HKLMSC)-1)==0)
  106.         {
  107.         root="hkcr";
  108.         return sizeof(HKLMSC);
  109.         }
  110. if (strncmpi(lp, HKLM, sizeof(HKLM)-1)==0)
  111.         {
  112.         root="hklm";
  113.         return sizeof(HKLM);
  114.         }
  115. if (strncmpi(lp, HKCU, sizeof(HKCU)-1)==0)
  116.         {
  117.         root="hkcu";
  118.         return sizeof(HKCU);
  119.         }
  120. if (strncmpi(lp, HKU, sizeof(HKU)-1)==0)
  121.         {
  122.         root="hku";
  123.         return sizeof(HKU);
  124.         }
  125. if (strncmpi(lp, HKCR, sizeof(HKCR)-1)==0)
  126.         {
  127.         root="hkcr";
  128.         return sizeof(HKCR);
  129.         }
  130. return 0;
  131. }

  132. LPSTR writebinary(LPSTR src,LPSTR dest,int hex)
  133. {
  134. if (hex)
  135.         {
  136. //        V2LP(dest)=0x090a0d5c,dest+=4;
  137.         while (*src&&(IsReturn(src)==0||*(src-1)=='\\')) *dest++=*src++;
  138.         }
  139. else{
  140.         short *ch;
  141.         ch=((short *)src)+3;
  142.         V2SP(dest)=*ch--; *(dest+2)=','; dest+=3;
  143.         V2SP(dest)=*ch--; *(dest+2)=','; dest+=3;
  144.         V2SP(dest)=*ch--; *(dest+2)=','; dest+=3;
  145.         V2SP(dest)=*ch; dest+=2;
  146.         }
  147. return dest;
  148. }

  149. int use_abb_key=1,use_tiny_mode; LPSTR stringBuffer,stringEnd;
  150. LPSTR WINAPI genstring(LPSTR key)
  151. {
  152. static int number;
  153. int kl;
  154. LPSTR se,temp;
  155. if (use_abb_key==0) return key;
  156. se=stringEnd;
  157. se+=sprintf(se,"%s%d_",ComBuf,++number);
  158. temp=key;
  159. while (*temp)
  160.         {
  161.         if ((*temp&'\x80')!=0)
  162.                 {
  163.                 se+=sprintf(se,"%d",++number);
  164.                 ++temp;
  165.                 }
  166.         else *se++=*temp++;
  167.         while (*temp&&*temp!='\\') ++temp;
  168.         if (*temp) ++temp;
  169.         }
  170. kl=(temp=se)-stringEnd;
  171. *temp++='='; *temp++='"';
  172. lstrcpy(temp,key); while (*temp) ++temp;
  173. *temp++='"'; V2SP(temp)=0x0a0d;
  174. se=(temp+=2);
  175. *temp++='%';
  176. lstrcpyn(temp,stringEnd,kl+1);
  177. V2SP(temp+=kl)=0x25;
  178. return stringEnd=se;
  179. }

  180. int WINAPI genvalues(LPSTR buffer,int size)
  181. {
  182. LPSTR lp,dest;
  183. skipbytes=0, lp=buffer, dest=destBuffer+size;
  184. switch(*lp)
  185.         {
  186.         case '[':
  187.                 while (*lp&&*lp!=']') ++lp; skipbytes=lp-buffer+1; ++buffer;
  188.                 if (*lp)
  189.                         {
  190.                         *lp=0, lp=buffer;
  191.                         if (curkeyname==0||lstrcmpi(lp,curkeyname))
  192.                                 {
  193.                                 int len;
  194.                                 if ((len=whichroot(buffer))!=0)
  195.                                         {
  196.                                         if (V2SP(dest-4)!=0x0a0d)
  197.                                                 V2SP(dest)=0x0a0d, dest+=2;
  198.                                         key=genstring((curkeyname=buffer)+len);
  199.                                         }
  200.                                 }
  201.                         }
  202.                 break;
  203.         case '@':
  204.         case '"':
  205.                 if (*lp!='@')
  206.                         {
  207.                         ++lp;
  208.                         while (*lp&&*lp!='"') ++lp;
  209.                         ++buffer;
  210.                         }
  211.                 *lp++=0, skipbytes=lp-buffer+1;
  212.                 if (*lp)
  213.                         {
  214.                         while (*lp&&*lp!='=') ++lp;
  215.                         if (*lp)
  216.                                 {
  217.                                 ++lp;
  218.                                 if (*lp=='"') size=0, ++lp;
  219.                                 else{
  220.                                         if (strncmpi(lp,"dword:",6)==0) size=0x10001, lp+=6;
  221.                                         else{
  222.                                                 if (strncmpi(lp,"hex:",4)==0) size=1, lp+=4;
  223.                                                 else size=-1;
  224.                                                 }
  225.                                         }
  226.                                 if (size>=0)
  227.                                         {
  228.                                         dest+=sprintf(dest,"%s,"%s",",root,key);//"%s",%d,
  229.                                         if (*buffer) dest+=sprintf(dest,""%s",", buffer); else *(dest++)=',';
  230.                                         if (size) dest+=sprintf(dest,"%d,",size); else *(dest++)=',';
  231.                                         if (size==0)
  232.                                                 {
  233.                                                 *dest++='"';
  234.                                                 while (*lp)
  235.                                                         {
  236.                                                         if (V2SP(lp)==0x5c5c)
  237.                                                                 ++lp;
  238.                                                         else{
  239.                                                                 if (V2SP(lp)==0x225c)
  240.                                                                         *dest++='"', lp++;
  241.                                                                 else{
  242.                                                                         if (*lp=='%') *dest++='%';
  243.                                                                         else{
  244.                                                                                 if (*lp=='"') break;
  245.                                                                                 }
  246.                                                                         }
  247.                                                                 }
  248.                                                         *dest++=*lp++;
  249.                                                         }
  250.                                                 *dest++='"';
  251.                                                 }
  252.                                         else dest=writebinary(lp, dest, size==1);
  253.                                         V2SP(dest)=0x0a0d, dest+=2;
  254.                                         }
  255.                                 }
  256.                         }
  257.                 break;
  258.         }
  259. return dest-destBuffer;
  260. }

  261. int WINAPI writeheader(LPSTR header,int from)
  262. {
  263. int size;
  264. LPSTR sp,dp;
  265. size=knlsize, sp=header, dp=destBuffer+from;
  266. while (*sp)
  267.         {
  268.         if (V2LP(sp)==0x5a502424)
  269.                 {
  270.                 lstrcpy(dp,ComBuf);
  271.                 dp+=size, sp+=4;
  272.                 }
  273.         else *dp++=*sp++;
  274.         }
  275. return dp-destBuffer;
  276. }

  277. void WINAPI convert(void)
  278. {
  279. DWORD size;
  280. LPSTR lpfile,temp;
  281. HANDLE hfile;
  282. if ((hfile=ezCreateFile(srcfile,0))!=INVALID_HANDLE_VALUE)
  283.         {
  284.         ++errorcode;
  285.         if ((lpfile=(LPSTR)GlobalAlloc(GPTR,(size=GetFileSize(hfile,0))*5+4+sizeof(INFHEADER)))!=0)
  286.                 {
  287.                 ++errorcode;
  288.                 if (ReadFile(hfile,lpfile+size,size,&size,0)==0) size=0;
  289.                 }
  290.         CloseHandle(hfile);
  291.         if (size)
  292.                 {
  293.                 if (V2SP(lpfile+size)==(short)0xfeff)
  294.                         WideCharToMultiByte(CP_ACP,0,(LPCWSTR)(lpfile+size),-1,lpfile,size,0,0);
  295.                 else
  296.                         CopyMemory(lpfile,lpfile+size,size);
  297.                 destBuffer=(stringBuffer=(temp=lpfile+size)+1)+size+1; *temp=0;
  298.                 stringEnd=stringBuffer+sprintf(stringBuffer,"\r\n[Strings]\r\n");
  299.                 #define REGID_UNICODE "Windows Registry Editor Version 5.00"
  300.                 if        (
  301.                         strncmpi(temp=skipwhitespace(lpfile,0),"REGEDIT4",sizeof("REGEDIT4")-1)==0
  302.                         ||
  303.                         strncmpi(temp+1,"REGEDIT4",sizeof("REGEDIT4")-1)==0
  304.                         ||
  305.                         strncmpi(temp,REGID_UNICODE,sizeof(REGID_UNICODE)-1)==0
  306.                         ||
  307.                         strncmpi(temp+1,REGID_UNICODE,sizeof(REGID_UNICODE)-1)==0
  308.                         )
  309.                         {
  310.                         ++errorcode;
  311.                         if ((hfile=ezCreateFile(destfile,1))!=INVALID_HANDLE_VALUE)
  312.                                 {
  313.                                 ++errorcode;
  314.                                 size=writeheader(INFHEADER,0);
  315.                                 if (use_tiny_mode==0) size=writeheader(INFCOMMENTS,size);
  316.                                 size=writeheader(INFBEGIN,size);
  317.                                 while (*(temp=skipwhitespace(temp+skipbytes,1))!=0)
  318.                                         size=genvalues(temp,size);
  319.                                 lstrcpy(destBuffer+size,stringBuffer);
  320.                                 WriteFile(hfile,destBuffer,size+(stringEnd-stringBuffer),&size,0);
  321.                                 CloseHandle(hfile);
  322.                                 printf("%s Generated ", destfile);
  323.                                 }
  324.                         }
  325.                 }
  326.         }
  327. }

  328. void WINAPI extfn(LPSTR cmd)
  329. {
  330. int i;
  331. LPSTR fp;
  332. if (*(fp=cmd)=='"') { ++fp,++cmd; while (*fp!='"') ++fp; *fp=0; }
  333. GetFullPathName(cmd,MAX_PATH,ComBuf,&fp);
  334. *((ComBuf=fp)-1)=0;
  335. i=0; while (*fp) ++fp,++i;
  336. while (i&&*fp!='.') --fp,--i;
  337. if (i) *fp=0;
  338. knlsize=i;
  339. }

  340. void main(int argc,char *argv[])
  341. {
  342. if (argc>=2)
  343.         {
  344.         int i; LPSTR tmp,fn1,fn2;
  345.         for (fn1=fn2=0,i=1; i<argc; i++)
  346.                 {
  347.                 if (*(tmp=argv[i])=='-'||*tmp=='/')
  348.                         {
  349.                         switch(*(tmp+1))
  350.                                 {
  351.                                 case 'w':
  352.                                 case 'W':
  353.                                         use_abb_key=0;
  354.                                         break;
  355.                                 case 't':
  356.                                 case 'T':
  357.                                         use_tiny_mode=1;
  358.                                         break;
  359.                                 }
  360.                         }
  361.                 else{
  362.                         if (fn1) fn2=tmp; else fn1=tmp;
  363.                         }
  364.                 }
  365.         if (fn1==0) fn1=argv[1]; ++errorcode;
  366.         if ((ComBuf=(LPSTR)GlobalAlloc(GPTR,3*MAX_PATH))!=0)
  367.                 {
  368.                 ++errorcode;
  369.                 destfile=(srcfile=ComBuf+MAX_PATH)+MAX_PATH;
  370.                 extfn(fn1);
  371.                 lstrcpy(srcfile,fn1); if (fn2) lstrcpy(destfile,fn2); else lstrcat(lstrcpy(destfile,srcfile),".inf");
  372.                 convert();
  373.                 }
  374.         }
  375. printf(errorprompts[errorcode]);
  376. }
复制代码

评分

参与人数 1无忧币 +5 收起 理由
2010hook + 5 赞一个!

查看全部评分

回复

使用道具 举报

7#
 楼主| 发表于 2019-1-31 17:58:36 | 只看该作者
本帖最后由 2010hook 于 2019-1-31 20:00 编辑
chishingchan 发表于 2019-1-31 17:32
真正找到的是这个!2002年的。


“不能转换x64带有(x86)的路径”,我误会了,reg里面就是这样,没转换。
你能趁春节假期稍微完善一下吗?工作量应该不大吧?
输出“Provider=*”替换成“AdvancedINF=2.5”更好。

点评

我的 C 不精及不常用  发表于 2019-2-1 11:56
回复

使用道具 举报

8#
 楼主| 发表于 2019-1-31 19:26:39 | 只看该作者
本帖最后由 2010hook 于 2019-1-31 20:10 编辑

嘿嘿,我用Hex编辑器修改了一下:
1、“Provider=***”改成“AdvancedINF=2.5”,支持一些高级特性。
2、主键名称,由小写改为大写。

这个48K工具,最大遗憾还是输出编码并非Unicode。

附件提供源码和cmd:

reg2inf.7z

19.39 KB, 下载次数: 46, 下载积分: 无忧币 -2

修改版

点评

可以整合到上下文菜单(右键菜单)  详情 回复 发表于 2019-2-1 12:04
回复

使用道具 举报

9#
发表于 2019-2-1 12:04:13 | 只看该作者
2010hook 发表于 2019-1-31 19:26
嘿嘿,我用Hex编辑器修改了一下:
1、“Provider=***”改成“AdvancedINF=2.5”,支持一些高级特性。
2、 ...

可以整合到上下文菜单(右键菜单)
  1. [Version]
  2. AdvancedINF=2.5, "您需要一个新版本的 ADVPACK.DLL 文件"
  3. Signature="$CHICAGO$"

  4. [DefaultInstall]
  5. AddReg=添加注册表
  6. CopyFiles=复制文件

  7. [DestinationDirs]
  8. 复制文件=11

  9. [复制文件]
  10. Reg2Inf.exe

  11. [添加注册表]
  12. HKCR,"regfile\shell\转换为(.&INF)\command",,0x20000,"Reg2Inf.exe -w ""%%1"""
复制代码
回复

使用道具 举报

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

本版积分规则

小黑屋|手机版|Archiver|捐助支持|无忧启动 ( 闽ICP备05002490号-1 )

闽公网安备 35020302032614号

GMT+8, 2024-4-25 23:43

Powered by Discuz! X3.3

© 2001-2017 Comsenz Inc.

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