News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Self modifying code

Started by anuradha, July 17, 2007, 06:26:49 AM

Previous topic - Next topic

anuradha

Hi guys!

can any one tell me how to write a self modifying Code????

Thanks :bg

Draakie

Hi anuradha,

SelfModifying code is generally used for either
A) Virus or Trojan etc. creation
B) RunTime code obfoscation - anti-debugging methods

and rarely for :

Highly optimized code specific algorithmic implimentations....

I think I saw some examples of the latter here on the board. In principle it boils down to the generic nature (opcode based) of
assembler instructions or their machine based opcode mnenomonics thingies. :P

(I'am probably gonna get spanked for such a crappy answer)
Draakie :P
Does this code make me look bloated ? (wink)

TNick

Hello! Maybe, if you tell us why you need to write such code, we can provide proper help. Not to mention that, if you play for a while with Assembly, it will became obvious... :)

Nick

anuradha

Hi
First thank you all for the replies

It has been 6 moths passed since I start to learn assembly
There is lot of things that I don't know. The goal of this question is not to
Do above things but to get a general knowledge. If I really need to do those things
I know exactly where to ask. Any way it is a bad idea to put such a question after all.

Any way once again thank you all for replies. :boohoo:

Jimg

Don't let these guys scare you off.  It's a valid technique and lots of fun.  See this link http://www.masm32.com/board/index.php?topic=2785.0

Draakie

Hi Jimg,   ::) was'nt trying to scare anyone. TNick and I were merely trying to find out the WHAT,WHERE, & HOW....

Did I not mention that it can & is used, but rarely, for valid persuits
Even so, Polymorphic code should however be used carefully IMHO - and is not for the novice - and as you
mentioned is quite alot of "FUN" - especially when it goes wrong. :bdg 

Thanks for the link though  :green

(I imagine I also mentioned that there was examples here someplace - was hinting at the SEARCH function - and
obviously missed the mark (spank).........)
Does this code make me look bloated ? (wink)

TNick

Quote from: Draakie on July 18, 2007, 05:08:42 AM
Thanks for the link though  :green
:bdg

Yap, didn't want to scare anyone. Just want to point that you need a certain stack of knowledge to do this. And, when you have that knowledge, it will became obvious (some methods, at least). After all, there are just 0's and 1's, some memory and some instructions.   :toothy
So, what's the logical step, then?! :green2

Regards,
Nick

hutch--

Just a nopte on this topic, Sluggy's comment on the topic that Jim has posted is still a valid one here. Keep the questions and data on topic and legal or see it disappear faster than Haley's comet.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

evlncrn8

haleys comet returns every 75/76 years though :)

hutch--

Does it mean that the person who made the offending posting will hold their breath for 75 years ?  :bg
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

evlncrn8

naw, i think you'd ban them before that wouldnt you?  :bdg

hutch--

Not if they really and truly held their breath.  :bg
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

P1

Vista has made improvements against SMC.

So it's going to be very limited as a current usable coding technique.

Regards,  P1   :8)

Jimg

I've always felt that the difference between a computer and a glorified calculator is the ability to change it's own code.  But I have have no doubt that Microsoft would prefer that everyone just have MS calculators rather than real computers.

anunitu

I remember this was comman in 6502 asm coding, I saw it a lot in the commadore64, mostly because of lack of memory. with 64k, you had to find a way to tighten your code. Even early PC coding memory was tight.


Anunitu