New Registry tip for advanced users 
Author Message
 New Registry tip for advanced users

FOREWARD: This tip is (c) 2001 by myself, Paul Bowlay (aka OTSER).  :)

Okay, here's a cool tip I just invented.  :)  Many times people ask how
to save to the Registry to a spot OTHER than "VB and VBA Program Settings",
which the "SaveSetting" command uses by default.  Then, someone usually
replies with some API code as the answer.  Well, try my method instead.

WARNING: THIS TIP IS ***NOT*** FOR BEGINNERS!  Follow it at your own risk,
and if you can't understand anything, then too bad -- I don't have time to
help.  Sorry!  :(

First off, you'll need a good hex editor -- I used Frhed (free) from here:
http://www.*-*-*.com/ ~rkibria/

Next, I am a VB5 user, so I opened the file called "VBA5.DLL" in my VB
folder with Frhed.  Different versions of VB may have a differently-named
file, so just use your brain to find the equivalent.

Next, do a search with Frhed for the following text string (note that the
space in the middle is intentional):

v<bd:0>b<bd:0> <bd:0>a<bd:0>n<bd:0>d

With VBA5.DLL, the offset for this search is at 0x1826da.  Frhed's cursor
will now be sitting at the "VB and VBA Program Settings" text.  What you
want to do is change it to the name of your company, or something similar.
In this example, let's say your company is called "Bowlay.com".  :)

Now start typing the text "Bowlay.com" (without quotes), BUT DO NOT TYPE
OVER THE DOTS!  These must be left intact!  So, type "Bowlay.com" by putting
the "B" where the "S" is, the new "o" where the old "o" is, and so on.  Then,
put a trailing slash ("\") at the end.  Next, change all the remaining text
to zero bytes, up to and including the original "\" character.

So what you'll now have in Frhed is this from offset 0x1826da:

S.o.f.t.w.a.r.e.\.B.o.w.l.a.y...c.o.m\

Now save the file with Frhed and quit Frhed.

Start VB and create a new project.  Put a single Command Button on it and
double-click it.  Enter this for its code:

Private Sub Command1_Click()

    SaveSetting "MyApp", "Startup", "LastDoc", "c:\test.txt"
    MsgBox "Now look in the Registry!"

End Sub

Run the project, click the button, then check the Registry under this
section:

My Computer\HKEY_CURRENT_USER\Software\

COOL!  :)

So what have we done?  We simply changed the location that VB saves your
Registry settings with its "SaveSettings" command.  All your apps will
now have their settings saved under "Bowlay.com" (or whatever company
name you used), instead of under "VB and VBA Program Settings" -- which
is always a dead giveaway that your app is written in VB and the first
place that crackers will look.  We have also avoided the need to use
long and cumbersome API calls to save the settings.  Enjoy!  :)

Regards, Otser.



Wed, 03 Sep 2003 01:54:21 GMT  
 New Registry tip for advanced users
LMFAO,

this would become very quickly overwritten by the persons app who gets
intsalled next and has a later file on it.

"VBA and VB settings"....it should read "Instert settings for your newbie
ass app here, you 15 year old loose interest before you distribute it all
over the net and  #$$# people computers."



Wed, 03 Sep 2003 05:41:43 GMT  
 New Registry tip for advanced users
Paul...

Are you sure you have enough to do?

 ;->

Dag.


Quote:
> FOREWARD: This tip is (c) 2001 by myself, Paul Bowlay (aka OTSER).  :)

> Okay, here's a cool tip I just invented.  :)  Many times people ask how
> to save to the Registry to a spot OTHER than "VB and VBA Program
Settings",
> which the "SaveSetting" command uses by default.  Then, someone usually
> replies with some API code as the answer.  Well, try my method instead.

> WARNING: THIS TIP IS ***NOT*** FOR BEGINNERS!  Follow it at your own risk,
> and if you can't understand anything, then too bad -- I don't have time to
> help.  Sorry!  :(

> First off, you'll need a good hex editor -- I used Frhed (free) from here:
> http://homepages.tu-darmstadt.de/~rkibria/

> Next, I am a VB5 user, so I opened the file called "VBA5.DLL" in my VB
> folder with Frhed.  Different versions of VB may have a differently-named
> file, so just use your brain to find the equivalent.

> Next, do a search with Frhed for the following text string (note that the
> space in the middle is intentional):

> v<bd:0>b<bd:0> <bd:0>a<bd:0>n<bd:0>d

> With VBA5.DLL, the offset for this search is at 0x1826da.  Frhed's cursor
> will now be sitting at the "VB and VBA Program Settings" text.  What you
> want to do is change it to the name of your company, or something similar.
> In this example, let's say your company is called "Bowlay.com".  :)

> Now start typing the text "Bowlay.com" (without quotes), BUT DO NOT TYPE
> OVER THE DOTS!  These must be left intact!  So, type "Bowlay.com" by
putting
> the "B" where the "S" is, the new "o" where the old "o" is, and so on.
Then,
> put a trailing slash ("\") at the end.  Next, change all the remaining
text
> to zero bytes, up to and including the original "\" character.

> So what you'll now have in Frhed is this from offset 0x1826da:

> S.o.f.t.w.a.r.e.\.B.o.w.l.a.y...c.o.m\

> Now save the file with Frhed and quit Frhed.

> Start VB and create a new project.  Put a single Command Button on it and
> double-click it.  Enter this for its code:

> Private Sub Command1_Click()

>     SaveSetting "MyApp", "Startup", "LastDoc", "c:\test.txt"
>     MsgBox "Now look in the Registry!"

> End Sub

> Run the project, click the button, then check the Registry under this
> section:

> My Computer\HKEY_CURRENT_USER\Software\

> COOL!  :)

> So what have we done?  We simply changed the location that VB saves your
> Registry settings with its "SaveSettings" command.  All your apps will
> now have their settings saved under "Bowlay.com" (or whatever company
> name you used), instead of under "VB and VBA Program Settings" -- which
> is always a dead giveaway that your app is written in VB and the first
> place that crackers will look.  We have also avoided the need to use
> long and cumbersome API calls to save the settings.  Enjoy!  :)

> Regards, Otser.



Wed, 03 Sep 2003 02:28:59 GMT  
 New Registry tip for advanced users

Quote:
> So what have we done?  We simply changed the location that VB saves your
> Registry settings with its "SaveSettings" command.  All your apps will
> now have their settings saved under "Bowlay.com" (or whatever company
> name you used), instead of under "VB and VBA Program Settings" -- which
> is always a dead giveaway that your app is written in VB and the first
> place that crackers will look.  We have also avoided the need to use
> long and cumbersome API calls to save the settings.  Enjoy!  :)

Yeah, all your apps and all everyone else's VB apps running on that
computer too.  Sure, why not force your users to copy the configuration
settings for all their non-bowlay.com apps into the bowlay.com registry
key?  Great idea!  Let's see what happens when clueless users who get
e{*filter*}d about figuring out how to change their wallpaper start
calling tech support because their apps just stopped working.  Big
laffs!  Wacky hijinx ensue!

But if you think that's funny, wait until Microsoft's lawyers descend on
you.  The EULA doesn't grant you the right to tamper with the VB runtime
libraries.  A home user making a single unauthorized copy of a program
probably isn't worth the effort of tracking down, but someone selling a
commercial product with hacked MS binaries that cause other people's
properly written code to break would be a very juicy target.

API calls are not "long and cumbersome".  They are an essential tool in the
VB programmer's arsenal.  Would you trust a plumber who didn't feel
comfortable using a soldering iron?  If you really have a problem with
them, write them once--or heck, grab some sample code off the net--package
them once into a class module or ActiveX DLL, then forget about
them.  There's tons of source code on the Net if you don't feel like
writing your own.  But hacking the VB runtime libraries with a hex editor
has got to be the dumbest idea for "addressing" VB's shortcomings.

--



Wed, 03 Sep 2003 02:42:12 GMT  
 New Registry tip for advanced users
Otser-

I agree with Peter.  There are tons of freeware classes for encapsulating
registry API calls available on the Internet, all of which make using the
registry just as easy as Get/SaveSetting.  Here's one of the great ones,
from Karl E. Peterson:

http://www.*-*-*.com/

(Quoted from his site:)
"Whether you find it embarrassing or enraging that VB's native registry
functions force you to use the VB and VBA Program Settings section, you'll
love this class that replaces the native SaveSetting, GetSetting,
GetAllSettings, and DeleteSetting functions! Besides allowing you to specify
your own company name under which you may store each app's settings, these
new functions also allow you to set the default value for your section
entries."

Note the part about "specify your own company name"--probably much safer
approach than embedding your company name into Microsoft's DLL.

-Jon




|
| > So what have we done?  We simply changed the location that VB saves your
| > Registry settings with its "SaveSettings" command.  All your apps will
| > now have their settings saved under "Bowlay.com" (or whatever company
| > name you used), instead of under "VB and VBA Program Settings" -- which
| > is always a dead giveaway that your app is written in VB and the first
| > place that crackers will look.  We have also avoided the need to use
| > long and cumbersome API calls to save the settings.  Enjoy!  :)
|
| Yeah, all your apps and all everyone else's VB apps running on that
| computer too.  Sure, why not force your users to copy the configuration
| settings for all their non-bowlay.com apps into the bowlay.com registry
| key?  Great idea!  Let's see what happens when clueless users who get
| e{*filter*}d about figuring out how to change their wallpaper start
| calling tech support because their apps just stopped working.  Big
| laffs!  Wacky hijinx ensue!
|
| But if you think that's funny, wait until Microsoft's lawyers descend on
| you.  The EULA doesn't grant you the right to tamper with the VB runtime
| libraries.  A home user making a single unauthorized copy of a program
| probably isn't worth the effort of tracking down, but someone selling a
| commercial product with hacked MS binaries that cause other people's
| properly written code to break would be a very juicy target.
|
| API calls are not "long and cumbersome".  They are an essential tool in
the
| VB programmer's arsenal.  Would you trust a plumber who didn't feel
| comfortable using a soldering iron?  If you really have a problem with
| them, write them once--or heck, grab some sample code off the net--package
| them once into a class module or ActiveX DLL, then forget about
| them.  There's tons of source code on the Net if you don't feel like
| writing your own.  But hacking the VB runtime libraries with a hex editor
| has got to be the dumbest idea for "addressing" VB's shortcomings.
|
|
| --



Wed, 03 Sep 2003 03:20:50 GMT  
 New Registry tip for advanced users

Quote:

> FOREWARD: This tip is (c) 2001 by myself, Paul Bowlay (aka OTSER).  :)

OTSER, you're being forged by someone either in your neck of the woods
or someone willing to make very long distance phone calls. I just can't

won't get the joke, piss-poor as it is.

Quote:
> Okay, here's a cool tip I just invented.  :)  Many times people ask how
> to save to the Registry to a spot OTHER than "VB and VBA Program Settings",
> which the "SaveSetting" command uses by default.  Then, someone usually
> replies with some API code as the answer.  Well, try my method instead.

No. FOAD, but first, tell us what crapps you've released which use this
so we can scan for and Kill them on sight. VB5.DLL is a shared runtime
file, dumbass. This idea is even worse than modifying CARDS.DLL without
giving it new internal and file names.

--

WARNING: I cannot be held responsible for the above        They're   coming  to
because  my cats have  apparently  learned to type.        take me away, ha ha!



Wed, 03 Sep 2003 06:05:31 GMT  
 New Registry tip for advanced users


Wed, 18 Jun 1902 08:00:00 GMT  
 New Registry tip for advanced users

Quote:
> No. FOAD, but first, tell us what crapps you've released which use this
> so we can scan for and Kill them on sight. VB5.DLL is a shared runtime
> file, dumbass. This idea is even worse than modifying CARDS.DLL without
> giving it new internal and file names.

I seriously don't understand all the abuse I've received over this tip.
"{*filter*} off and die" ?  Why?  The file that I said to edit is NOT a shared
VB runtime file at all -- it exists in my VB5 folder ONLY and is never
included by the VB package and deployment wizard.  It is for the CREATION
of VB exe's ONLY -- it NEVER gets installed on an end-users machine.

I'm sorry for making the post -- I didn't know it would cause so much
backlash.  I honestly thought it was a useful tip.  :(

Regards, Otser.



Wed, 03 Sep 2003 11:30:51 GMT  
 New Registry tip for advanced users


Wed, 18 Jun 1902 08:00:00 GMT  
 New Registry tip for advanced users

Quote:
> But if you think that's funny, wait until Microsoft's lawyers descend on
> you.  The EULA doesn't grant you the right to tamper with the VB runtime
> libraries.

See my other post -- the file I referred to is NOT a VB runtime library.
I think too many people misread my post and got all uppity over nothing.

Regards, Otser.



Wed, 03 Sep 2003 11:36:33 GMT  
 New Registry tip for advanced users

Quote:
> this would become very quickly overwritten by the persons app who gets
> intsalled next and has a later file on it.

Sorry, but VBA5.DLL is not a runtime library that gets distributed with
VB apps.  I think you misread my post.

Regards, Otser.



Wed, 03 Sep 2003 11:37:30 GMT  
 New Registry tip for advanced users


Wed, 18 Jun 1902 08:00:00 GMT  
 New Registry tip for advanced users

Quote:
> I'm sorry for making the post -- I didn't know it would cause so much
> backlash.  I honestly thought it was a useful tip.  :(

Further to this, someone just E-Mailed me and said the tip wouldn't work
anyway because the VB runtime file itself would still look for "VB and
VBA Program Settings" -- so my tip was doomed to failure anyway.

Regards, Otser.



Wed, 03 Sep 2003 11:59:13 GMT  
 New Registry tip for advanced users

Quote:


> > I'm sorry for making the post -- I didn't know it would cause so much
> > backlash.  I honestly thought it was a useful tip.  :(

> Further to this, someone just E-Mailed me and said the tip wouldn't work
> anyway because the VB runtime file itself would still look for "VB and
> VBA Program Settings" -- so my tip was doomed to failure anyway.

Umm... err... ahh... I was just playing along so TheDumDum would
actually try it? Yeah, yeah, that's the ticket...

--

WARNING: I cannot be held responsible for the above        They're   coming  to
because  my cats have  apparently  learned to type.        take me away, ha ha!



Wed, 03 Sep 2003 14:01:17 GMT  
 New Registry tip for advanced users


Wed, 18 Jun 1902 08:00:00 GMT  
 
 [ 20 post ]  Go to page: [1] [2]

 Relevant Pages 

1. Advanced Tips for VB programmers

2. registry tip

3. Advancing from a standard form to a new continuation form

4. PUBLICATION OF NEW ADVANCED QBASIC BOOK

5. IMPORTANT : New Advanced QBasic Book Release

6. Matthew Curland's new advanced vb book

7. Hints And Tips For New Posters In The Access Newsgroups

8. New article and tips on the Office Developer web site

9. New tips, Easter egg and free support for Microsoft Access

10. New tips, Easter egg and free support for Access

11. New tips, tricks, software add-on, Easter egg, support and FAQ for access

12. New knowledgebase site - looking for authors, articles or tips about Visual Basic

 

 
Powered by phpBB® Forum Software