Jump to content











Photo
- - - - -

Howto place a time bomb into a WB project


  • Please log in to reply
22 replies to this topic

#1 pscEx

pscEx

    Platinum Member

  • Team Reboot
  • 12707 posts
  • Location:Korschenbroich, Germany
  • Interests:What somebody else cannot do.
  •  
    European Union

Posted 05 February 2007 - 11:57 AM

A lot of applications, drivers etc. write into the registry.

It is the easiest way to find these registry entries by examinating one's own PC's registry and to use these entries to write the script.

But there is a big problem:

Some registry entries are enumerations.

Sample: in the RAMdisk script there is an entry made into the driver's class list.
The code:

RegWrite,HKLM,0x1,"WB-Setup\ControlSet001\Control\Class\{FFA1C341-4539-11D3-B88D-00C04FAD5172}","Class","RamDisk"
RegWrite,HKLM,0x1,"WB-Setup\ControlSet001\Control\Class\{FFA1C341-4539-11D3-B88D-00C04FAD5172}",,"RAM Disk"
RegWrite,HKLM,0x1,"WB-Setup\ControlSet001\Control\Class\{FFA1C341-4539-11D3-B88D-00C04FAD5172}\0001","ProviderName","Unknown"
RegWrite,HKLM,0x1,"WB-Setup\ControlSet001\Control\Class\{FFA1C341-4539-11D3-B88D-00C04FAD5172}\0001","MatchingDeviceId","ramdriv"
RegWrite,HKLM,0x1,"WB-Setup\ControlSet001\Control\Class\{FFA1C341-4539-11D3-B88D-00C04FAD5172}\0001","DriverDesc","Ramdisk"


The red coloured 0001 is an index which is automatically increased when the next driver is added (Should start with 0000).

Imagine a second script will follow using also the 0001: here it is: :P

Currently the projects are very small and the propability for such a coincidence is very small, too.
But when the projects increase, getting more and more drivers ... ???

Here is the reason that I alreadey asked Nuno for the RegGetNext command and I hope that it will be included in the script engine soon.
After we got it: @.script developers: Revise your scripts and use RegGetNext where applicable.

BTW: The go2pdf script has the same issue.



#2 Brito

Brito

    Platinum Member

  • .script developer
  • 10616 posts
  • Location:boot.wim
  • Interests:I'm just a quiet simple person with a very quiet simple life living one day at a time..
  •  
    European Union

Posted 05 February 2007 - 01:26 PM

wow.. you're right - hadn't noticed yet! :P

Will be added for sure on the next release, thanks for warning about this! :P

#3 thunn

thunn

    Silver Member

  • .script developer
  • 531 posts
  • Location:Brooklyn, New York
  • Interests:computers<br />mechanics<br />distortion<br /><br />
  •  
    United States

Posted 06 February 2007 - 01:54 AM

good point.
we should also use as few entries that have system specific markings as possible.

#4 MedEvil

MedEvil

    Platinum Member

  • .script developer
  • 7771 posts

Posted 06 February 2007 - 10:20 PM

good point.
we should also use as few entries that have system specific markings as possible.

I vote for none! :P

#5 pscEx

pscEx

    Platinum Member

  • Team Reboot
  • 12707 posts
  • Location:Korschenbroich, Germany
  • Interests:What somebody else cannot do.
  •  
    European Union

Posted 06 June 2007 - 12:02 PM

Bump to Top :1st:

Since some months I have a utility making a driver script from the *.inf file.
But I need this functionality to finish.

Peter

#6 Brito

Brito

    Platinum Member

  • .script developer
  • 10616 posts
  • Location:boot.wim
  • Interests:I'm just a quiet simple person with a very quiet simple life living one day at a time..
  •  
    European Union

Posted 06 June 2007 - 12:18 PM

Thanks for bumping!

How should this syntax be?

How about:

RegGetNext,HKLM,Path\to\EnumRegSection\,%outputVar%

Where it %outputvar% would return the value to be used on the next key needed to write.

:1st:

#7 pscEx

pscEx

    Platinum Member

  • Team Reboot
  • 12707 posts
  • Location:Korschenbroich, Germany
  • Interests:What somebody else cannot do.
  •  
    European Union

Posted 06 June 2007 - 12:22 PM

Thanks for bumping!

How should this syntax be?

How about:

RegGetNext,HKLM,Path\to\EnumRegSection\,%outputVar%

Where it %outputvar% would return the value to be used on the next key needed to write.

:1st:

:thumbup:

In my sample this would be:
RegGetNext,HKLM,WB-Setup\ControlSet001\Control\Class\{FFA1C341-4539-11D3-B88D-00C04FAD5172}\,%myEnum%

Please provide in the code that the red backslash at the end may be set or missing.

Peter

#8 Brito

Brito

    Platinum Member

  • .script developer
  • 10616 posts
  • Location:boot.wim
  • Interests:I'm just a quiet simple person with a very quiet simple life living one day at a time..
  •  
    European Union

Posted 06 June 2007 - 12:53 PM

Sounds good.. :1st:

#9 smiley

smiley

    Silver Member

  • .script developer
  • 905 posts
  •  
    Greece

Posted 14 June 2007 - 08:49 PM

Bump!

Any news about this function?

#10 pscEx

pscEx

    Platinum Member

  • Team Reboot
  • 12707 posts
  • Location:Korschenbroich, Germany
  • Interests:What somebody else cannot do.
  •  
    European Union

Posted 14 June 2007 - 09:23 PM

Bump!

@smiley!
You have to learn to be more patient! :1st:

Less than one week to bump ???

(You know, that is a time bomb which will bump itself!)

Peter

#11 Brito

Brito

    Platinum Member

  • .script developer
  • 10616 posts
  • Location:boot.wim
  • Interests:I'm just a quiet simple person with a very quiet simple life living one day at a time..
  •  
    European Union

Posted 14 June 2007 - 10:01 PM

:1st:

Thanks for bumping, it was really needed as a reminder of the priorities needed to be solved next. :thumbup:

#12 Brito

Brito

    Platinum Member

  • .script developer
  • 10616 posts
  • Location:boot.wim
  • Interests:I'm just a quiet simple person with a very quiet simple life living one day at a time..
  •  
    European Union

Posted 14 June 2007 - 11:43 PM

Here's a test binary: Attached File  WinBuilder071_Beta5c.zip   806.19KB   349 downloads


You can try out the new syntax of RegGetNext using something like:

RegGetNext,HKLM,SYSTEM\ControlSet001\Control\Class\{36FC9E60-C465-11CF-8056-444553540000}\,myTest

echo,MyTest

It will work with and without ending \ as Peter requested.

Hope you like it.. :1st:

#13 smiley

smiley

    Silver Member

  • .script developer
  • 905 posts
  •  
    Greece

Posted 15 June 2007 - 10:48 AM

Can you also create a RegGetNextValue command?

The same can happen for runonceex:

RegWrite,&#34;HKLM&#34;,0x1,&#34;WB-Software\Microsoft\Windows\CurrentVersion\RunOnceEx\500&#34;,&#34;100&#34;,&#34;shell32.dll|DllInstall|I&#34;

RegWrite,&#34;HKLM&#34;,0x1,&#34;WB-Software\Microsoft\Windows\CurrentVersion\RunOnceEx\500&#34;,&#34;103&#34;,&#34;browseui.dll|DllInstall|I&#34;

RegWrite,&#34;HKLM&#34;,0x1,&#34;WB-Software\Microsoft\Windows\CurrentVersion\RunOnceEx\500&#34;,&#34;104&#34;,&#34;shdocvw.dll|DllInstall|I&#34;

RegWrite,&#34;HKLM&#34;,0x1,&#34;WB-Software\Microsoft\Windows\CurrentVersion\RunOnceEx\500&#34;,&#34;105&#34;,&#34;ie4uinit.exe&#34;

If a program write its value in WB-Software\Microsoft\Windows\CurrentVersion\RunOnceEx\500\104, explorer won't start.

#14 Brito

Brito

    Platinum Member

  • .script developer
  • 10616 posts
  • Location:boot.wim
  • Interests:I'm just a quiet simple person with a very quiet simple life living one day at a time..
  •  
    European Union

Posted 15 June 2007 - 11:00 AM

Sure! :1st:

Can you indicate me where I can find a registry key from the host machine that I can use as example for testing?

:thumbup:

#15 smiley

smiley

    Silver Member

  • .script developer
  • 905 posts
  •  
    Greece

Posted 15 June 2007 - 01:51 PM

I can't fine one but you can use something like this:
Windows Registry Editor Version 5.00

&#91;HKEY_LOCAL_MACHINE\Software\test&#93;

&#34;100&#34;=&#34;shell32.dll|DllInstall|I&#34;

&#34;103&#34;=&#34;browseui.dll|DllInstall|I&#34;

&#34;104&#34;=&#34;shdocvw.dll|DllInstall|I&#34;

&#34;105&#34;=&#34;ie4uinit.exe&#34;

&#34;202&#34;=&#34;regsvr32.exe /s shimgvw.dll&#34;

&#34;201&#34;=&#34;hiderun /w reg import cplfix.reg&#34;


#16 pscEx

pscEx

    Platinum Member

  • Team Reboot
  • 12707 posts
  • Location:Korschenbroich, Germany
  • Interests:What somebody else cannot do.
  •  
    European Union

Posted 15 June 2007 - 02:04 PM

I can't fine one but you can use something like this:

Windows Registry Editor Version 5.00

 &#91;HKEY_LOCAL_MACHINE\Software\test&#93;

 &#34;100&#34;=&#34;shell32.dll|DllInstall|I&#34;

 &#34;103&#34;=&#34;browseui.dll|DllInstall|I&#34;

 &#34;104&#34;=&#34;shdocvw.dll|DllInstall|I&#34;

 &#34;105&#34;=&#34;ie4uinit.exe&#34;

 &#34;202&#34;=&#34;regsvr32.exe /s shimgvw.dll&#34;

 &#34;201&#34;=&#34;hiderun /w reg import cplfix.reg&#34;


1st @Nuno: Thanks for the new functionality. Next week I'm going to continue my driver script.

2nd @Smiley: The idea sounds good but I think we could do it better:

I suggest a mechanism comparable with 'autostart' where all the requests are collected first.

The requests should contain one or both of 'before ???', 'following ???', 'does not matter'

In the second step, using PreISO script, the RunOnceEx-s are created.

What do you think?

Peter

#17 smiley

smiley

    Silver Member

  • .script developer
  • 905 posts
  •  
    Greece

Posted 15 June 2007 - 02:11 PM

The idea sounds good but I think we could do it better:
I suggest a mechanism comparable with 'autostart' where all the requests are collected first.
The requests should contain one or both of 'before ???', 'following ???', 'does not matter'
In the second step, using PreISO script, the RunOnceEx-s are created.
What do you think?


Sounds good...

#18 Brito

Brito

    Platinum Member

  • .script developer
  • 10616 posts
  • Location:boot.wim
  • Interests:I'm just a quiet simple person with a very quiet simple life living one day at a time..
  •  
    European Union

Posted 15 June 2007 - 04:15 PM

I've added a new command called RegWriteNext which should be used to add sequential keys, it will support the same parameters as RegWrite, but will omit the respective keyname.

Also agree with Peter's opinion about a more efficient use of this feature and it is added for future use if needed.

This command will determinate which name should the next key have and will then call RegWrite function with the complete set of parameters.

You can test the new command using:

RegWriteNext,HKLM,0x1,Software\test,myTest



This test will work along with the reg code snippet provided by Smiley on his earlier post.


Here's the test binary (wb 071 beta 5d): Attached File  WinBuilder071_Beta5d.zip   806.42KB   365 downloads


Good luck! :1st:

#19 pscEx

pscEx

    Platinum Member

  • Team Reboot
  • 12707 posts
  • Location:Korschenbroich, Germany
  • Interests:What somebody else cannot do.
  •  
    European Union

Posted 15 June 2007 - 04:21 PM

I've added a new command called RegWriteNext which should be used to add sequential keys, it will support the same parameters as RegWrite, but will omit the respective keyname.

Also agree with Peter's opinion about a more efficient use of this feature and it is added for future use if needed.

This command will determinate which name should the next key have and will then call RegWrite function with the complete set of parameters.

You can test the new command using:



This test will work along with the reg code snippet provided by Smiley on his earlier post.


Here's the test binary (wb 071 beta 5d): Attached File  WinBuilder071_Beta5d.zip   806.42KB   365 downloads


Good luck! :thumbup:

:1st:

Peter

#20 pscEx

pscEx

    Platinum Member

  • Team Reboot
  • 12707 posts
  • Location:Korschenbroich, Germany
  • Interests:What somebody else cannot do.
  •  
    European Union

Posted 16 June 2007 - 07:57 AM

I've added a new command called RegWriteNext which should be used to add sequential keys, it will support the same parameters as RegWrite, but will omit the respective keyname.


The code
RegWriteNext,HKLM,0x1,WB-Setup\ControlSet001\Control\Class\{FFA1C341-4539-11D3-B88D-00C04FAD5172},&#34;ProviderName&#34;,&#34;QSoft&#34;
Logically
RegWrite,HKLM,0x1,WB-Setup\ControlSet001\Control\Class\{FFA1C341-4539-11D3-B88D-00C04FAD5172}\????,&#34;ProviderName&#34;,&#34;QSoft&#34;
Brings error:

RegWriteNext - Failed [HKLM\WB-Setup\ControlSet001\Control\Class\{FFA1C341-4539-11D3-B88D-00C04FAD5172}


You can try with the RAMDisk script.

epeter

#21 Brito

Brito

    Platinum Member

  • .script developer
  • 10616 posts
  • Location:boot.wim
  • Interests:I'm just a quiet simple person with a very quiet simple life living one day at a time..
  •  
    European Union

Posted 16 June 2007 - 08:38 AM

Thanks for mentioning this issue.

Can you try with RegGetNext?

You can then use the outputed variable to write the new registry key, I will test as soon as possible..

:1st:

#22 pscEx

pscEx

    Platinum Member

  • Team Reboot
  • 12707 posts
  • Location:Korschenbroich, Germany
  • Interests:What somebody else cannot do.
  •  
    European Union

Posted 16 June 2007 - 01:59 PM

Thanks for mentioning this issue.

Can you try with RegGetNext?

You can then use the outputed variable to write the new registry key, I will test as soon as possible..

:thumbup:


Comparable result:
RegGetNext,HKLM,0x1,WB-Setup\ControlSet001\Control\Class\{FFA1C341-4539-11D3-B88D-00C04FAD5172},%next%

RegGetNext - Failed [HKLMx1=WB-Setup\ControlSet001\Control\Class\{FFA1C341-4539-11D3-B88D-00C04FAD5172}


Peter

EDIT: Sorry I made a syntax error (0x1).

Works :1st:

Edited by psc, 16 June 2007 - 02:03 PM.
Correction


#23 pscEx

pscEx

    Platinum Member

  • Team Reboot
  • 12707 posts
  • Location:Korschenbroich, Germany
  • Interests:What somebody else cannot do.
  •  
    European Union

Posted 16 June 2007 - 02:36 PM

I have to correct me again :1st:

RegGetNext worked ok when there was a key already.

With WB-Setup\ControlSet001\Control\Class\{FFA1C341-4539-11D3-B88D-00C04FAD5172}001 it found
WB-Setup\ControlSet001\Control\Class\{FFA1C341-4539-11D3-B88D-00C04FAD5172}002.

But with the empty
WB-Setup\ControlSet001\Control\Class\{FFA1C341-4539-11D3-B88D-00C04FAD5172}
it did not find
WB-Setup\ControlSet001\Control\Class\{FFA1C341-4539-11D3-B88D-00C04FAD5172}000

Instaed of that I got the error
reggetnext.gif

Peter




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users