|
||||||
| Assembly A machine oriented language in which mnemonics are used to represent each machine language instruction. |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
|
|||
|
Mutating Code? (ASM w/ C++)
I tried to write a very simple mutating program the other day, but it keeps failing. Because my program uses addresses that are hardcoded in (I know, bad practice), you compiling the code would likely result in runtime errors anyway.
Therefore, my question is: does anybody have an example of an extremely simple self-modifying ASM program? I'd also like to know if there's a way that doesn't involve hardcoded addresses. My program was basically: Code:
unsigned int testvar = 0;
__asm
{
write code that made testvar=0xFFFFFFFF;
execute code;
}
cout << testvar << endl;
|
|
||||
|
Re: Mutating Code? (ASM w/ C++)
If your goal is to do this in C++, you may want to check out Boost Lambda. You could also try having a scripting language interpreter.
I haven't played with self-modifying code, however.
__________________
CodeCall Blog | CodeCall Wiki | Shareware Programming is a branch of mathematics. My CodeCall Blog | My Personal Blog |
|
||||
|
Re: Mutating Code? (ASM w/ C++)
Then try writing to a data segment. Try using malloc or something. Operating systems typically block this sort of behavior for security reasons, by the way.
__________________
Cannot delete '002pgin': There is not enough free disk space. Delete one or more files to free disk space, and then try again. |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Evolutionary Design and Acyclic componentization | Kernel | News | 0 | 02-22-2009 11:40 AM |
| Functional Programming Unit Testing - Part 4 | Kernel | News | 0 | 12-21-2008 07:20 PM |
All times are GMT -5. The time now is 06:54 AM.
Amrosama.cc
Arekbulski.cc
Debtboy.cc
Guest.cc
Jaan.cc
James.cc
Mathx.cc
Tsz.cc
Vswe.cc