?
Solved

Where/how to begin programming

Posted on 2006-05-31
12
Medium Priority
?
1,480 Views
Last Modified: 2012-06-21
Hello,

I am willing to learn programming. I can do some simple batch files but i really need to go advanced. What i am into is writing removal scripts. First for some softwares and then for some malware infections to begin programing.

1- What language should i start learning ? Which language would be the most efficient and easier( doesnt necessarily need to be very easy- i like challenges-) to use to 1) remove files 2) remove registry entries 3) modify registry entries

2- What are the good softwares would allow me to monitor changes created by the malware infections in the system. I have been using regmon and filemon and for the installations i am using installwatchpro. Would you have any recommendations ?

Thank you for your time.
0
Comment
Question by:Purple_Sky
  • 3
  • 2
  • 2
  • +4
12 Comments
 
LVL 15

Assisted Solution

by:mish33
mish33 earned 400 total points
ID: 16804669
Hi Purple_Sky,

I recommend Python (http://www.python.org).
You can start with "Dive into Python" (http://diveintopython.org)

Cheers!
0
 
LVL 24

Accepted Solution

by:
fridom earned 400 total points
ID: 16805018
Difficult to judge really. You'll get as many answers as answerers. And you have choosen to get into an edge where you have to know very much about the lowest level you can get (nearly) So if you realyl want to work in that area you have to learn Assembler and C. C is the programming language used to build nearly all the current operating systems in use. The whole win API is based on C. You can do nearly everything on a Windows box with C and probably some inline Assembler.

However you requirements do not indicate that you really want to go that deep. E.g removign files can be done with every language under the sun (run locall of course). Working with the registry are just a handful C functions so even if you language do not have them wrapped up for you then you can do that quite easy on you own.

The Python tip is fair one. And it's really a matter of taste. I once did some Python programming, but I dislike it for trivial reasons; there are so many "magic" things to implement to get OO. Why e.g. must an creator look like this
__init__ ?, it's support for functional programming is relative meager.

However it is quite easy to read and there are books available for learning it. Quite some interesting software has been written in it. However you might check the following alternatives also:
1) Perl www.perl.org   One can argue that Perl is somehow part of the "Internet" since it's beginning. It has a very large library available. Perls scripts however tend to look quite "cryptic". See e.g the postings of ozo, he uses Perls for everything and beyond.

2) Ruby www.ruby-lang.org. My favourite of the mentioned Scripting language. I can do whatever Python or Perl can but looks much for readable to my eyes then Perl is on paris with Python. Better solved is the while object oriented programming stuff in it then in either Python or Perl. It offers quite a bunch elements for functional programming, but is on pari in with Perl IMHO.

3) Tcl/tk http://www.tcl.tk/ Very simply to some extend, really great for taking string apart and put them back together. Used as main scripting language in the AOLServer and integral part of OpenACS http://www.openacs.org. Comes with the "legendary" expect facilites for steering command line applications.
And it's tk part is partly the "GUI"-Toolkit for all the other programming language mentioned here. The Tcl/TK stuff works on Windows, Unices and Macs AFAIKT. So if you want to put together a few GUI frontends to you stuff, TK Is quite an option.

Does not have any OO-Facilities built-in, but offers a range of extension for doing OO Programming. One "advantage" over the others it that you can write software which writes tcl/tk for you. Of course you can generate Python, Perl or Ruby also but it's not as easy as for Tcl/tk

If you feel that you simply want to learn something fast, you should try Smalltalk also. You can start you journey into it with squeak www.squeak.org.

Howver there are other languages worth having a look
Ocaml  
Pike
Rebol
Icon
Haskell,
Scheme
Common Lisp
Forth
Prolog etc

Regards
Friedrich

0
 
LVL 7

Assisted Solution

by:wnross
wnross earned 400 total points
ID: 16805062
For system snapshots configsafe is probably the simplest to use and administer: IBM used to ship it on all their systems about 6 years ago
and I loved it.

You can get it now from http://www.imaginelan.com/configsafe/ for about $35.00 USD.

As for stepping up from batch scripting, thats easy: perl or visual basic
perl is a high speed powerful language, the ActiveState implementation ($0.00) has full support for the windows Registry.
http://www.activestate.com/Products/ActivePerl/

The nice thing about perl is that it is extremely powerful and well supported on pretty much any platform (Windows/Solaris/AIX/Linux/...)

The other approach is Visual Basic embedded in Windows Script Host.  Since WSH is installed on all microsoft platforms from windows 2000 up,
the support is readily available.  "VB" is reasonably easy to get started in and there are several tutorials to get you started

Eg:

------------- CUT HERE -----------------
Dim list
for each Process in GetObject("winmgmts:").InstancesOf("Win32_Process")
    list = list & Process.Handle & _
           " " & Process.Name & _
           " " & Process.CommandLine  & _
           " " & Process.KernelModeTime & vbCrLf
next
WScript.Echo list
------------- CUT HERE -----------------

Save this as c:\procs.vbs and double click it, it will list all running processes on your machine

WSH Has a pretty big bang for your buck, but perl has MUCH more industry support
Cheers
-Bill

0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 32

Assisted Solution

by:r-k
r-k earned 400 total points
ID: 16805680
If you want to invest some time and do programming as a profession, then definitely start with C++ and perhaps look into C#. I am assuming you want to mainly stay with the Windows platform.
0
 
LVL 20

Assisted Solution

by:Venabili
Venabili earned 200 total points
ID: 16806021
>>1- What language should i start learning ?
This depends on what your final purposes are... I personally started with Pascal because that is what was required at school :) Then C and C++ in the univercity, now I consider myself a Java developer (although I write on a lot of others). But whatever you decide - it is important to learn the basis... once you get them, learning a new language is not that bad....

>> 1) remove files
Any :)
>> 2) remove registry entries
Well... I would say any although languages like Java do not really have a good way to do this ( other from calling a OS-native code in most cases written in C)
>> 3) modify registry entries
Same as above

Basically there is no such thing as the perfect language. :)
0
 
LVL 6

Assisted Solution

by:saravananvg
saravananvg earned 200 total points
ID: 16806157
Hello Sir,

  If it has to be platform independent, you're probably looking at Java.

Now, if you want to use C++, you could.  However, you'd have to be very careful how you did things.  You'd have to use something like wxWidgets for your GUI and very strictly standardized C++; probably using the gnu compiler to ensure compatibility between windows and linux (are you throwing in mac, too?).  You'd want to compile and run your app on each OS while in development to make sure that your app sitll works as you work on it.  And all of this might be more hassle than it's worth.  Here's some info: http://en.wikipedia.org/wiki/WyoGuide

IMHO, a "compile once, run anywhere" app is still probably going to take you down the java road...

and also check the following site which helps you to decide between VB and Delphi

http://www.delphizine.com/opinion/2000/01/di200001fn_o/di200001fn_o.asp

with regards,
padmaja.
0
 
LVL 7

Expert Comment

by:wnross
ID: 16806568
padmaja: most of the languages describe are "write once run anywhere" Perl,Python,TCL, etc...

You definately do not want to do system admin work with C/C++ or Java.  

Some samples: Deleting Files

Perl
-------------------delete.pl ------------
unlink("C:\\Documents and Settings\\All Users\\virus.exe");
------------------- CUT HERE ---------------

Visual Basic with Windows Script Host
------------------ delete.vbs ---------------
Set fso = CreateObject("Scripting.FileSystemObject")
Set aFile = fso.GetFile("C:\Documents and Settings\All Users\virus.exe")
aFile.Delete
------------------- CUT HERE ---------------

Using the registry:
Perl
------------------- listentries.pl ---------------------
use Win32::Registry;

my $hive = "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run";
my ($hkey, %value_list, $key);

$HKEY_LOCAL_MACHINE->Open($hive,$hkey);

$hkey->GetValues(\%value_list);
print "$hive values\n";
foreach $value (keys %value_list) {
      print "$value\n";
}
$hkey->Close();
------------------- CUT HERE ---------------

Visual Basic with Windows Script Host
------------------ listentries.vbs ---------------
Set WshShell = WScript.CreateObject("WScript.Shell")

WScript.Echo WshShell.RegRead("HKCU\Software\Microsoft\Windows\CurrentVersion\Run\MSMSGS")
------------------- CUT HERE ---------------
(Note that VBS does not allow you to directly list what entries there are, but perl does)
0
 
LVL 20

Expert Comment

by:Venabili
ID: 16807276
And delete file Java:
(new File("filename")).delete();

Registries are tough in Java but the simple deletion is not a problem at alll....
0
 
LVL 4

Author Comment

by:Purple_Sky
ID: 16807910
Thank you all for the great advices.

Initially I am not planing to go very hardcore with the programing BUT if I like enjoy it ( i am sure I will ) why not. i am planing to stick with the windows platform.

Seems like I am going to start with perl, python and/or vbs then advance to C++ and Java as needed.

Are there any other monitoring tools you can recommend ?

Again thank you for your time and all informing replies.
0
 
LVL 7

Expert Comment

by:wnross
ID: 16808331
Besides configsafe?  The closest i've seen is Norton's GoBack, but it doesn't tell you what changed where configsafe does.

Any ideas out there?
0
 
LVL 4

Author Comment

by:Purple_Sky
ID: 16808917
Thank you all :)
0
 
LVL 32

Expert Comment

by:r-k
ID: 16812382
Thanks. You can't go wrong with the utilities from Sysinternals. They also have an excellent page with useful programming tips: http://www.sysinternals.com/Information.html

Also highly recommended: http://www.codeproject.com/ and http://www.codeguru.com/
0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you don't know how to downgrade, my instructions below should be helpful.
If you are a mobile app developer and especially develop hybrid mobile apps then these 4 mistakes you must avoid for hybrid app development to be the more genuine app developer.
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
Screencast - Getting to Know the Pipeline

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question