PDA

View Full Version : Error writing the registry



NewsArchive
10-09-2011, 01:29 AM
Hi Friedrich,
I have Sb 7.0.2680
I´m trying to create/write in the following key

HKEY_LOCAL_MACHINE\System\CurrentControlSet\Contro l\Network\NetworkLocationWizarD
Operation: Create/Update Key and Value
Value: ShowFirst
Data Type: Default
Data Value: -1

and I´m allways getting %_SB_ERRORCODE%<>0

How can I debug it?

Thanks,

--
*Alberto Michelis*
ARMi software solutions www.armi.com.ar <http://www.armi.com.ar>
Desea hacer crecer sus ahorros? www.portfoliofinanciero.com.ar
<http://www.portfoliofinanciero.com.ar>

NewsArchive
10-09-2011, 01:30 AM
Hi Alberto,

> I have Sb 7.0.2680
> I´m trying to create/write in the following key
>
> HKEY_LOCAL_MACHINE\System\CurrentControlSet\Contro l\Network\NetworkLocationWizarD
> Operation: Create/Update Key and Value
> Value: ShowFirst
> Data Type: Default
> Data Value: -1
>
> and I´m allways getting %_SB_ERRORCODE%<>0
>
> How can I debug it?

The only information provided is success or failure.

I just tried your settings with the latest SB75 and it worked fine (see
attached screenshot). Support for SB7.0 came to an end two years ago and I
don't know if there was a bug in your build. I would suggest to download
and try the latest version to see if this makes a difference (especially on
modern operating systems like Windows 7 and Windows Server 2008 R2).

Hope this helps.

Friedrich

NewsArchive
10-09-2011, 01:31 AM
My maintenence plan has expired, thats the message when I try to update SB7
Wrinting to USER keys works ok, but not to write to LOCAL keys.

*Alberto Michelis*
ARMi software solutions www.armi.com.ar <http://www.armi.com.ar>
Desea hacer crecer sus ahorros? www.portfoliofinanciero.com.ar
<http://www.portfoliofinanciero.com.ar>

NewsArchive
10-09-2011, 01:32 AM
Have you set the installer's manifest to requireAdministrator ?

Jane Fleming

NewsArchive
10-09-2011, 03:46 AM
Hi Alberto,

> My maintenence plan has expired, thats the message when I try to update
> SB7
> Wrinting to USER keys works ok, but not to write to LOCAL keys.

Then it's what Jane said. You have to request administrator execution level
privileges to write to protected resources on UAC-aware systems (Vista+) or
you need administrator privileges on NT/200x/XP based systems.
HKEY_LOCAL_MACHINE is a protected resource.

Hope this helps.

Friedrich

NewsArchive
10-11-2011, 06:47 AM
THanks Jane! and... how do I do this?

*Alberto Michelis*
ARMi software solutions www.armi.com.ar <http://www.armi.com.ar>
Desea hacer crecer sus ahorros? www.portfoliofinanciero.com.ar
<http://www.portfoliofinanciero.com.ar>

NewsArchive
10-11-2011, 06:49 AM
You mean this?
See atached image.

*Alberto Michelis*
ARMi software solutions www.armi.com.ar <http://www.armi.com.ar>
Desea hacer crecer sus ahorros? www.portfoliofinanciero.com.ar
<http://www.portfoliofinanciero.com.ar>

NewsArchive
10-11-2011, 06:49 AM
> You mean this?
> See atached image.

Yes, correct!

Friedrich

NewsArchive
10-11-2011, 06:50 AM
Then I´m using it, and it does not work.

*Alberto Michelis*
ARMi software solutions www.armi.com.ar <http://www.armi.com.ar>
Desea hacer crecer sus ahorros? www.portfoliofinanciero.com.ar
<http://www.portfoliofinanciero.com.ar>

NewsArchive
10-11-2011, 06:50 AM
>
> Then I´m using it, and it does not work.
>

I have uploaded my test .exe (link will be valid for 48 hours):

www.lindersoft.com/projects/alberto.zip

Does this work on your machine? I tested it here and it worked (see
previously posted RegEdit screenshot).

Friedrich

NewsArchive
10-11-2011, 06:52 AM
BTW, I just tested it on Win7 and I also got a permission issue. I think
UAC-aware systems do not allow apps to create keys with full access any
longer (see attached screenshot from the Permission tab). Windows 7 only
gives you "Read" permission.

If you really have to write to the key and you would like to work-around
this security setting, you can try to change the permission (see attached
script screenshot). But it is not recommended!

Hope this helps.

Friedrich

NewsArchive
10-13-2011, 12:25 AM
Thanks Friedrich,
I am trying to use the registry to save the install date and how many
times the user runs a program to limit it to a number of runs.
I thought the registry was the better place to save it but if I cant
write to a "all users" registry position... may be I can use the "per
user" registry but it will alow the user to install the program under
various users and continue using it.
Any idea of how to sort this?

*Alberto Michelis*
ARMi software solutions www.armi.com.ar <http://www.armi.com.ar>
Desea hacer crecer sus ahorros? www.portfoliofinanciero.com.ar
<http://www.portfoliofinanciero.com.ar>

NewsArchive
10-13-2011, 12:27 AM
Alberto,

> Thanks Friedrich,
> I am trying to use the registry to save the install date and how many
> times the user runs a program to limit it to a number of runs.
> I thought the registry was the better place to save it but if I cant
> write to a "all users" registry position... may be I can use the "per
> user" registry but it will alow the user to install the program under
> various users and continue using it.
> Any idea of how to sort this?

The install date is stored by default (see attached screenshot).

BTW, I would not try to limit the number of uses based on a simple registry
setting. This will not work as expected in most cases. And those hacks
are not worth the efforts <g> "They" will crack your protection mechanism
in 10 seconds!

Even if you write the number of uses to the "per-user" key, the user only
has to log-in to another account on the very same machine and has again a
"fresh" set of per-user registry keys.

Friedrich

NewsArchive
10-13-2011, 12:28 AM
> BTW, I would not try to limit the number of uses based on a simple
> registry
> setting. This will not work as expected in most cases. And those hacks
> are not worth the efforts <g> "They" will crack your protection mechanism
> in 10 seconds!

Yep, I've got code here that tells me every change (date & time) made to my
registry so I can see exactly what goes on with my pc's, would get flagged
up as soon as its written.

Richard Rose

NewsArchive
10-13-2011, 12:28 AM
Ok, then where to save it?

*Alberto Michelis*
ARMi software solutions www.armi.com.ar <http://www.armi.com.ar>
Desea hacer crecer sus ahorros? www.portfoliofinanciero.com.ar
<http://www.portfoliofinanciero.com.ar>

NewsArchive
10-13-2011, 12:28 AM
>
> Ok, then where to save it?
>

There is really no safe place for such a "counter".

Friedrich

NewsArchive
10-13-2011, 12:28 AM
Encrypted TPS file might be easiest?

Richard Rose

NewsArchive
10-13-2011, 12:29 AM
>
> Encrypted TPS file might be easiest?
>

Yes, absolutely. But if I were a hacker, I would then make a copy of the
original file and once the "limit" has reached, restore the backup and
continue with the program <g>

The problem is that all these "self-made" protection mechanisms (based on
simple counters) can be cracked in a few seconds. It's not worth the
efforts (IMO).

Friedrich

NewsArchive
10-14-2011, 12:37 AM
Stuff it in the exe then it cant be copied and if its encrypted properly,
you can mix it up with some of the PE resource data to make someone really
explore the app maybe even stuff a dll into the exe as well. After all who
really cares about exe sizes todays? ;-)

I do agree with your point that nothing is 100% unhackable, its about
balancing effort with the need to protect. Bring back the dongle I say but
even that can be cracked when running apps on terminal server! :-)

Richard Rose