Definition Files/Plug-Ins

Moocow

Member
Joined
Jan 7, 2007
Messages
8
Programming Experience
Beginner
Hey, i've been trying to create a program which can use definitions/modules like a simple text file, which, if it contains "kill C:/virus.exe" or "deldir C:/virus/" it would do it, when the program runs it. An example plug-in would be:

VB.NET:
kill C:/virus.exe
deldir C:/virus.exe
WriteToWindow Hello World

So far it can process one command :p - only the first line

So far it looks like this:

VB.NET:
[SIZE=2]
[/SIZE][SIZE=2][COLOR=#0000ff]Private[/COLOR][/SIZE][SIZE=2] [/SIZE][SIZE=2][COLOR=#0000ff]Sub[/COLOR][/SIZE][SIZE=2] Button1_Click_1([/SIZE][SIZE=2][COLOR=#0000ff]ByVal[/COLOR][/SIZE][SIZE=2] sender [/SIZE][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][SIZE=2] System.Object, [/SIZE][SIZE=2][COLOR=#0000ff]ByVal[/COLOR][/SIZE][SIZE=2] e [/SIZE][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][SIZE=2] System.EventArgs) [/SIZE][SIZE=2][COLOR=#0000ff]Handles[/COLOR][/SIZE][SIZE=2] Button1.Click[/SIZE][SIZE=2][COLOR=#008000]
[/COLOR][/SIZE][SIZE=2][/SIZE][SIZE=2][COLOR=#0000ff]Dim[/COLOR][/SIZE][SIZE=2] MyStr [/SIZE][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][SIZE=2] [/SIZE][SIZE=2][COLOR=#0000ff]String[/COLOR][/SIZE][SIZE=2] = TextBox1.Text.Substring(4)[/SIZE][SIZE=2][COLOR=#008000]
[/COLOR][/SIZE][SIZE=2][/SIZE][SIZE=2][COLOR=#0000ff]Dim[/COLOR][/SIZE][SIZE=2] A [/SIZE][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][SIZE=2] [/SIZE][SIZE=2][COLOR=#0000ff]String
[/COLOR][/SIZE][SIZE=2]A = System.IO.File.ReadAllText(MyStr)
[/SIZE][SIZE=2][COLOR=#0000ff]Dim[/COLOR][/SIZE][SIZE=2] TextAfterCommand [/SIZE][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][SIZE=2] [/SIZE][SIZE=2][COLOR=#0000ff]String[/COLOR][/SIZE][SIZE=2] = A.Substring(4)
[/SIZE][SIZE=2][COLOR=#0000ff]If[/COLOR][/SIZE][SIZE=2] A.Contains([/SIZE][SIZE=2][COLOR=#800000]"kill"[/COLOR][/SIZE][SIZE=2] & TextAfterCommand) [/SIZE][SIZE=2][COLOR=#0000ff]Then
[/COLOR][/SIZE][SIZE=2]System.IO.File.Delete(TextAfterCommand)
Writetowindow([/SIZE][SIZE=2][COLOR=#800000]"Script Deleting File "[/COLOR][/SIZE][SIZE=2] & TextAfterCommand)
[/SIZE][SIZE=2][COLOR=#0000ff]End[/COLOR][/SIZE][SIZE=2] [/SIZE][SIZE=2][COLOR=#0000ff]If
[/COLOR][/SIZE][SIZE=2][/SIZE][SIZE=2][COLOR=#0000ff]If[/COLOR][/SIZE][SIZE=2] A.Contains([/SIZE][SIZE=2][COLOR=#800000]"WriteToWindow"[/COLOR][/SIZE][SIZE=2] & TextAfterCommand) [/SIZE][SIZE=2][COLOR=#0000ff]Then
[/COLOR][/SIZE][SIZE=2]Writetowindow(TextAfterCommand)
[/SIZE][SIZE=2][COLOR=#0000ff]End[/COLOR][/SIZE][SIZE=2] [/SIZE][SIZE=2][COLOR=#0000ff]If
 
[/COLOR][/SIZE][SIZE=2][/SIZE][SIZE=2][COLOR=#0000ff]If[/COLOR][/SIZE][SIZE=2] A.Contains([/SIZE][SIZE=2][COLOR=#800000]"Deldir"[/COLOR][/SIZE][SIZE=2] & TextAfterCommand) [/SIZE][SIZE=2][COLOR=#0000ff]Then
[/COLOR][/SIZE][SIZE=2]System.IO.Directory.Delete(TextAfterCommand)
Writetowindow([/SIZE][SIZE=2][COLOR=#800000]"Script deleting directory"[/COLOR][/SIZE][SIZE=2] & TextAfterCommand)
[/SIZE]



What i'd is to simply any another "If blah blah" to add more functionality, like CreateMsgBox. But like i said, only the top line processes (and crashes) and deldir does nothing... i think i need to change MyStr, but it's confusing me...
 
Back
Top