Jump to content











Photo
- - - - -

offlinereg


  • Please log in to reply
340 replies to this topic

#201 dodenko

dodenko

    Newbie

  • Validating
  • 22 posts
  •  
    Russian Federation

Posted 20 March 2018 - 06:26 PM

Also does it support stdin stdout? So that we can pipe text in to it? Thanks.



#202 dodenko

dodenko

    Newbie

  • Validating
  • 22 posts
  •  
    Russian Federation

Posted 28 October 2018 - 03:12 PM

I found some problem with this tool. If you have more than 500-1000 changes to make in the registry

it can get really really slow.

 

Because of this.

 

1. Open

2. Write

3. Close

 

A better way to do this would save handle to system environment variable.

 

Open handle/s

Make 500 changes or import reg file

Close handle/s

 

Silent option as well is needed.


Edited by dodenko, 28 October 2018 - 03:13 PM.


#203 erwan.l

erwan.l

    Platinum Member

  • Developer
  • 3042 posts
  • Location:Nantes - France
  •  
    France

Posted 28 October 2018 - 03:43 PM

I found some problem with this tool. If you have more than 500-1000 changes to make in the registry

it can get really really slow.

 

Because of this.

 

1. Open

2. Write

3. Close

 

A better way to do this would save handle to system environment variable.

 

Open handle/s

Make 500 changes or import reg file

Close handle/s

 

Silent option as well is needed.

 

If you use offlinereg in a batch, yes, it will open/write/close each time.

But if you use an input file, then it will open only once, does all read and write, then close (at least this is how I remember my code).

 

see post 



#204 dodenko

dodenko

    Newbie

  • Validating
  • 22 posts
  •  
    Russian Federation

Posted 28 October 2018 - 03:45 PM

The problem with input file is.. you can only write to one HIVE at a time :(

 

input file cannot have HKLM, HKCU, SAM etc 



#205 erwan.l

erwan.l

    Platinum Member

  • Developer
  • 3042 posts
  • Location:Nantes - France
  •  
    France

Posted 28 October 2018 - 03:47 PM

The problem with input file is.. you can only write to one HIVE at a time :(

 

input file cannot have HKLM, HKCU, SAM etc 

 

give your practical scenario and lets see how it can work it from there.



#206 dodenko

dodenko

    Newbie

  • Validating
  • 22 posts
  •  
    Russian Federation

Posted 28 October 2018 - 03:49 PM

I have many changes that need to be done. 1000~ 

That is it. 



#207 erwan.l

erwan.l

    Platinum Member

  • Developer
  • 3042 posts
  • Location:Nantes - France
  •  
    France

Posted 28 October 2018 - 03:57 PM

I have many changes that need to be done. 1000~ 

That is it. 

 

as you cannot be dealing with a thousand different hives (i.e one change per hive), why not group your changes per hive into one run command (thus using an input file) for each hive?

you will probably end up with a dozen max run commands which will considerably speed up your process.



#208 dodenko

dodenko

    Newbie

  • Validating
  • 22 posts
  •  
    Russian Federation

Posted 28 October 2018 - 03:58 PM

No currently I use reg add. Maybe add option to use different hives in input file?



#209 dodenko

dodenko

    Newbie

  • Validating
  • 22 posts
  •  
    Russian Federation

Posted 28 October 2018 - 04:08 PM

Seems like someone already made it!

https://github.com/steve4444/RegInject



#210 erwan.l

erwan.l

    Platinum Member

  • Developer
  • 3042 posts
  • Location:Nantes - France
  •  
    France

Posted 28 October 2018 - 04:20 PM

Seems like someone already made it!

https://github.com/steve4444/RegInject

 

I wont comment on others sourcecode on this thread but yes reginject looks all fine to me : go for it.

Not sure how it is different thus?

 

It takes an input file (in the form of a reg file) and will inject it into one hive.

Similar to what offlinereg does.

Not?



#211 dodenko

dodenko

    Newbie

  • Validating
  • 22 posts
  •  
    Russian Federation

Posted 28 October 2018 - 04:24 PM

It different because this project cannot modify multiple hives in input file.

 

So then i need 6 input files. Is not really practical.



#212 erwan.l

erwan.l

    Platinum Member

  • Developer
  • 3042 posts
  • Location:Nantes - France
  •  
    France

Posted 28 October 2018 - 04:38 PM

It different because this project cannot modify multiple hives in input file.

So then i need 6 input files. Is not really practical.


Maybe there is a confusion between HKCU, HKLM, etc. and actual hives=individual files (as existing in your system32\config folder).

For instance, HKLM is actually supported by multiple files (lets talk files now) : software, system, security, sam, etc ...
This is a constraint you cannot workaround (at least when using lowlevel MS library) : you will always have to open the file, do some read/write, close the file as opposed to tools like reg.exe, etc ... which will abstract the filesystem for you.

So lets say you have thousand of changes to do on the system file, then you can either use a reg file or a command file as input with offlinereg.

Now if you have a thousand of changes split between, lets say software and system, then whatever "low level" tool you use, you will always have to open one, do some stuff, close one, open another one, do some stuff, close this one again... and this even if both hives are logically/virtually grouped under HKLM.

#213 dodenko

dodenko

    Newbie

  • Validating
  • 22 posts
  •  
    Russian Federation

Posted 28 October 2018 - 04:40 PM

Are you saying the library can only have one hive open? :))

This tool needs a more flexible approach IMHO.


Edited by dodenko, 28 October 2018 - 04:43 PM.


#214 erwan.l

erwan.l

    Platinum Member

  • Developer
  • 3042 posts
  • Location:Nantes - France
  •  
    France

Posted 28 October 2018 - 04:46 PM

Are you saying the library can only have one hive open? :))

This tool needs a more flexible approach IMHO.

 

Yes and it makes perfect sense : the library opens a hive, performes some I/O, and closes the hive.

 

No this library does not need to be more flexible : this is just perfect as it is :)

 

Rather, use a tool which is adapted to your needs such as reg.exe which will abstract the file system for you : you can then use HKLM, HKCU, etc.



#215 dodenko

dodenko

    Newbie

  • Validating
  • 22 posts
  •  
    Russian Federation

Posted 28 October 2018 - 04:50 PM

That's not true. You can do multiple OROpenHive calls.
 
At the very least allow so that we can open multiple hives with run command.
 
offlinereg-win32.exe "D:\PATH\System, D:\PATH\SAM" " " run D:\commands.txt
 
or
 
offlinereg-win32.exe "D:\PATH\" " " run D:\commands.txt 

Edited by dodenko, 28 October 2018 - 05:02 PM.


#216 erwan.l

erwan.l

    Platinum Member

  • Developer
  • 3042 posts
  • Location:Nantes - France
  •  
    France

Posted 28 October 2018 - 05:02 PM

 

That's not true. You can do multiple OROpenHive calls.

 

 

Yes you can call this OROpenHive function several times against several hives which will give you several handles to maintain.

But then, once you input a reg file (or any list of registry path\keys to modify), how do you know which handle to use (OROpenKey takes a handle as input)?

Of course, then you can develop a logic (and tool) which would take hive1, hive2, hive3, etc as hives next to input1, input2, input3 as input files : the tool would then be smart enough to know which handle to use for each change you are willing to perform.

 

At this stage, I would recommend that you launch your preferred developement environement and start coding it ;)

Even better, if you mutli thread your app (i.e one thread per handle/hive), it will blasting fast.

 

Or, stick to reg.exe.

 

As for offlinereg, it is one hive at the time and there are no plans to change this.



#217 dodenko

dodenko

    Newbie

  • Validating
  • 22 posts
  •  
    Russian Federation

Posted 28 October 2018 - 05:04 PM

You parse the parameter and put in the array? 

 

Is it so hard to parse?

offlinereg-win32.exe "D:\PATH\System, D:\PATH\SAM" " " run D:\commands.txt


Edited by dodenko, 28 October 2018 - 05:04 PM.


#218 erwan.l

erwan.l

    Platinum Member

  • Developer
  • 3042 posts
  • Location:Nantes - France
  •  
    France

Posted 28 October 2018 - 05:09 PM

You parse the parameter and put in the array? 

 

Is it so hard to parse?

offlinereg-win32.exe "D:\PATH\System, D:\PATH\SAM" " " run D:\commands.txt

 

Parsing a command line is not the challenge.

 

Except there is a whole logic behind that (see previous post) which I am not willing to take on a journey.

 

Consider an alternative way of doing :

offlinereg-win32.exe "D:\PATH\System" " " run D:\sys_commands.txt

offlinereg-win32.exe "D:\PATH\SAM" " " run D:\sam_commands.txt



#219 dodenko

dodenko

    Newbie

  • Validating
  • 22 posts
  •  
    Russian Federation

Posted 28 October 2018 - 05:41 PM

You can easily associate it within commands.txt

 

 

offlinereg-win32.exe "D:\PATH\SYSTEM, D:\PATH\SAM, D:\PATH\SOFTWARE, D:\PATH\DEFAULT" " " run D:\commands.txt

 

command 1, SYSTEM

command 2, SAM

command 3, SOFTWARE

command 4, DEFAULT

 

I am sure you can use Pos function in Delphi to parse this.

Maintaining one file is much easier.


Edited by dodenko, 28 October 2018 - 05:42 PM.


#220 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 16066 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 28 October 2018 - 05:43 PM

It different because this project cannot modify multiple hives in input file.

 

So then i need 6 input files. Is not really practical.

Is it not? :unsure:

 

If the thing is write once and forget it, then maybe, but if -as it often happens - it is a work in progress, needs to be debugged, tested, modified, etc., personally I would want to keep 6 (or more) files separated.

 

:duff:

Wonko



#221 erwan.l

erwan.l

    Platinum Member

  • Developer
  • 3042 posts
  • Location:Nantes - France
  •  
    France

Posted 28 October 2018 - 05:44 PM

You can easily associate it within commands.txt

 

 

offlinereg-win32.exe "D:\PATH\SYSTEM, D:\PATH\SAM, D:\PATH\SOFTWARE, D:\PATH\DEFAULT" " " run D:\commands.txt

 

command 1, SYSTEM

command 2, SAM

command 3, SOFTWARE

command 4, DEFAULT

 

I am sure you can use Pos function in Delphi to parse this.

 

Too much work (rework the command line, implement some logic, deal with new bugs, etc) versus little benefits (i.e you can achieve what you want using the tool in a different way).

 

Sorry to say : request denied for now :)



#222 dodenko

dodenko

    Newbie

  • Validating
  • 22 posts
  •  
    Russian Federation

Posted 28 October 2018 - 06:15 PM

Btw offreg.dll is now standard with W10. 

x64 version errors out if dll is missing in the path.



#223 dodenko

dodenko

    Newbie

  • Validating
  • 22 posts
  •  
    Russian Federation

Posted 28 October 2018 - 08:46 PM

Also piping files does not work as well.



#224 darren rose

darren rose

    Frequent Member

  • Advanced user
  • 455 posts
  • Location:Norwich, Norfolk
  •  
    United Kingdom

Posted 28 October 2018 - 08:49 PM

@dodenko

 

If it doesn't do what you want it to do - then use something else!, rather than continually criticizing and finding fault with erwan.l's work - quite a few of us here are very happy with offlinereg and it works perfectly for what we do and erwan has worked hard on implementing what was needed



#225 osninja32120

osninja32120
  • Members
  • 4 posts
  •  
    United States

Posted 19 December 2018 - 04:52 PM

@Misty : new version uploaded which will support the @ character (meaning default key) while importing a reg file.

@ default keys support in reg keys still broken in the latest version. Hope you find time to fix it one day.

 

Thanks for such an amazing app!






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users