PDA

View Full Version : multiple reg.getkeynames and reg.getvaluenames = autorun detected one error closed


Solmos
12-06-2008, 04:55 PM
hello

I tried to create a code that will scan the keys on each key and find all the values.

But to stop scanning and try to close the application, it gives an error, said that autorun.exe has had a problem and has had to close.

Other times in changing pages, get the same error.

How could fix it?

There any way to "cleanse" all the tables and code so that when finished look no error?

Thank you very much

example:

function scan()

tblKeys = Registry.GetKeyNames(HKEY_LOCAL_MACHINE, "");
if tblKeys == nil then
else
nCounter = 1;
for i, Name in tblKeys do

---here Registry.GetValueNames...

tblKey = Registry.GetKeyNames(HKEY_LOCAL_MACHINE, Name);
if tblKey == nil then
else
nCounte = 1;
for i, Nam in tblKey do

---here Registry.GetValueNames...

tblKe = Registry.GetKeyNames(HKEY_LOCAL_MACHINE, Name.."\\"..Nam);
if tblKe == nil then
else
nCount = 1;
for i, Na in tblKe do

---here Registry.GetValueNames...

--etc etc etc

nCount = nCount + 1;
end
end

nCounte = nCounte + 1;
end
end

nCounter = nCounter + 1;
end
end

end

jassing
12-07-2008, 11:28 AM
Your problem is that you keep changing variables.

use different variables for each for loop.. your basically do this:

for x = 1 to 10
for x = 1 to 10
for x = 1 to 30
end
end
does x = 30 or 1?
end

My guess is that AMS is now 'confused' as it was doing a for loop of 1 to 10; but x is now 30
I would change each var to a new varname; or you could include a lot of local declarations; but that's going to be ugly code to read.
Instead of using one less letter (tblKeys, tblKey, tblKe) you might want to use proper names

hive/keys/value=data

additionally; I think you're limiting yourself to the depth a key can be...

jassing
12-07-2008, 04:31 PM
The problem with going to a PM on an issue like this is that others can no longer try to help you...

You're going to have to trace it down to find the smallest # of lines of code that generate the error....

I'm out of ideas at the moment..

Solmos
12-08-2008, 04:47 AM
I tried to change the names, but still gives error. At times during the scanning and only provided to close the application.

If I list more Registry.GetKeynames, the application gives errors constantly.

My intention is to make a scanner, to review all the registry keys and values.

Any suggestions?

Thank you very much

StatusDlg.Show();

function Basic()

uno = Registry.GetKeyNames(HKEY_LOCAL_MACHINE, "Software");
if uno == nil then
else
nooo = 1
for b,Name in uno do

StatusDlg.SetStatusText(Name);

one = Registry.GetValueNames(HKEY_LOCAL_MACHINE, "Software\\"..Name);
if one == nil then
else
rn = 1;
for j,se in one do

StatusDlg.SetStatusText(Name.."\\"..se);

data = Registry.GetValue(HKEY_LOCAL_MACHINE, "Software\\"..Name, se, true);

---your code

rn = rn + 1;
end
end

dos = Registry.GetKeyNames(HKEY_LOCAL_MACHINE, "Software\\"..Name);
if dos == nil then
else
noo = 1;
for d,Nam in dos do

StatusDlg.SetStatusText(Name.."\\"..Nam);


tho = Registry.GetValueNames(HKEY_LOCAL_MACHINE, "Software\\"..Name.."\\"..Nam);
if tho == nil then
else
rn = 1;
for m,ue in tho do

StatusDlg.SetStatusText(Name.."\\"..Nam.."\\"..ue);

data = Registry.GetValue(HKEY_LOCAL_MACHINE, "Software\\"..Name.."\\"..Nam, ue, true);

--your code

rn = rn + 1;
end
end

tres = Registry.GetKeyNames(HKEY_LOCAL_MACHINE, "Software\\"..Name.."\\"..Nam);
if tres == nil then
else
no = 1;
for k,Na in tres do

StatusDlg.SetStatusText(Name.."\\"..Nam.."\\"..Na);

three = Registry.GetValueNames(HKEY_LOCAL_MACHINE, "Software\\"..Name.."\\"..Nam.."\\"..Na);
if three == nil then
else
rn = 1;
for p,us in three do

StatusDlg.SetStatusText(Name.."\\"..Nam.."\\"..Na.."\\"..us);

data = Registry.GetValue(HKEY_LOCAL_MACHINE, "Software\\"..Name.."\\"..Nam.."\\"..Na, us, true);

--your code

rn = rn + 1;
end
end

cuatro = Registry.GetKeyNames(HKEY_LOCAL_MACHINE, "Software\\"..Name.."\\"..Nam.."\\"..Na);
if cuatro == nil then
else
n = 1;
for q,N in cuatro do

StatusDlg.SetStatusText(Name.."\\"..Nam.."\\"..Na.."\\"..N);

four = Registry.GetValueNames(HKEY_LOCAL_MACHINE, "Software\\"..Name.."\\"..Nam.."\\"..Na.."\\"..N);
if four == nil then
else
rn = 1;
for a,ur in four do

StatusDlg.SetStatusText(Name.."\\"..Nam.."\\"..Na.."\\"..N.."\\"..ur);

data = Registry.GetValue(HKEY_LOCAL_MACHINE, "Software\\"..Name.."\\"..Nam.."\\"..Na.."\\"..N, ur, true);

--your code

rn = rn + 1;
end
end

n = n + 1;
end
end

no = no + 1;
end
end

noo = noo + 1;
end
end

nooo = nooo + 1;
end
end

end

Basic()

-------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------------------
StatusDlg.SetStatusText("");
StatusDlg.Hide();