Go Back   CodingForums.com > :: Computing & Sciences > Computer Programming

Before you post, read our: Rules & Posting Guidelines

Closed Thread
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 05-16-2007, 09:51 PM   PM User | #1
SHY
New Coder

 
Join Date: Apr 2005
Location: Kosice, Slovakia
Posts: 36
Thanks: 2
Thanked 0 Times in 0 Posts
SHY is an unknown quantity at this point
exe code injection assignment

hey,
we got a pretty tough assignment for this semester which we thought we could handle with ease but unfortunately its the exact oposite and now we are desperate.
we are supposed to make a virus-like thing that injects its code into .exe files in its working directory. the custom code should just display some kind of a messagebox and proceed with the stuff that the exe file does regularly. the other part of the assignment is to make a antivirus-like application that would just find and remove the code from altered exe files.
so we have to inject the code somewhere into the exe file and rewrite the addresses so that our code would be executed before the original stuff.
unfortunately, every single example of code injection we found online includes a pretty large amount of asm code (we are supposed to code it in C and/or C++) that we have no idea about.
is there any way to do this in C/C++? im not sure how hard is this to someone with a good knowledge of asm, but ive found a topic on a forum where a guy posted his asm code that was doing an advanced version of what we are trying to accomplish - the custom code didnt just display a message box, it also downloaded a gif file from internet. and the guy stated that he made it out of boredom. so i assume that this might not be a problem for someone with a proper knowledge of a problem.
im not directly asking someone to help us with it (even tho id appreciate if someone did), id just like to get some directions for clues that might help us.
the best thing probably would be if its possible to do it in C.
__________________
"Programming is an art form that fights back."
SHY is offline  
Old 05-16-2007, 10:38 PM   PM User | #2
liorean
The thread killer


 
Join Date: Feb 2003
Location: Umeå, Sweden
Posts: 5,575
Thanks: 0
Thanked 84 Times in 75 Posts
liorean will become famous soon enoughliorean will become famous soon enough
C/C++ are turing complete, so of course it's possible. However, code injection modifies machine code. Assembly, depending a bit on which kind of assembly, is quite close to machine code, so writing a code injection mechanism in assembly is considerably easier than writing it in a higher level language where you don't really know what kind of machine code will be generated. In other words, the actual code injection mechanism is much tricker to write in C/C++.

Anyway, this is the type of thing that can really be abused, and I don't really want to see code for it in our archives. So, closing thread.
liorean is offline  
Closed Thread

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 03:47 PM.


Advertisement
Log in to turn off these ads.