Trace vector decoder

Trace vector decoder

Trace vector decoder is a system that uses a microprocessor's trace mode to decode encrypted code just-in-time before it is executed and possibly re-encrypt it after the execution. It can be used to enforce copy protections for some computer systems.

Trace Vector in Motorola 68000

As an example, Motorola 68000 has a trace mode where a trace exception vector is executed before each instruction in the main program. The processor automatically changes execution to the trace exception vector before executing any instruction from the main program. The trace exception vector decodes the instruction that will be executed after the exception vector. The next time trace exception happens the old decoded location may possibly be re-encrypted.

Following code snippet is an example of a program initializing a trace exception routine.

MOVEM.L Stack,D0-D7/A0-A6 ; Initialize registersStack MOVE.L #$4E730000,-(SP) ; Start loading trace exception MOVE.L #$00000010,-(SP) ; vector into stack MOVE.L #$0004DDB9,-(SP) MOVE.L #$BD96BDAE,-(SP) MOVE.L #$B386B586,-(SP) MOVE.L #$D046D246,-(SP) MOVE.L #$0246A71F,-(SP) MOVE.L #$00023C17,-(SP) MOVE.W #$2C6F,-(SP) MOVE.L SP,($24).W ; Set trace exception vector ORI.W #$A71F,SR ; Enter trace mode NOP ; Trace vector happens now for the first time. ; Code after this line is encrypted.

A disassembly of the trace exception vector that is loaded on the stack:

TraceCode: MOVE.L (2,SP),A6 ; Load return address from ; supervisor stack. MOVE.W (SP),D6 ; Load condition codes of the main ; program. AND.W #$A71F,D6 ADD.W D6,D0 ADD.W D6,D1 EOR.L D1,D6 EOR.L D2,D6 EOR.L D6,(A6) ; Decrypt 8 bytes ahead in main EOR.L D6,(4,A6) RTE ; Return from exception
Note that registers altered in the trace vector affect the main program that is being traced. Usually registers are pushed onto stack in any exception vector, because altering them would break the main program. However, purpose of this vector is to obfuscate the code against reverse engineering.

It should also be noted that condition code register (CCR) affects the decryption process. For example, an arithmetic operation in the main program having the 0 number as a result, will cause zero flag bit to be set in CCR. This will cause the value in (SP) to be changed in the trace vector. This is done to obfuscate against reverse engineering.

List of trace vector decoder systems

*Rob Northen copylock has a trace vector decoder that was used on the Amiga platform


Wikimedia Foundation. 2010.

Игры ⚽ Поможем написать курсовую

Look at other dictionaries:

  • Viterbi decoder — A Viterbi decoder uses the Viterbi algorithm for decoding a bitstream that has been encoded using forward error correction based on a convolutional code. There are other algorithms for decoding a convolutionally encoded stream (for example, the… …   Wikipedia

  • Rob Northen copylock — is a copy protection system to prevent disk duplication with standard floppy disk drives on the Amiga, Atari ST and PC DOS platforms. It was used mainly to copy protect games from being copied by regular users.A copylocked floppy disk contains… …   Wikipedia

  • Dieselboy — For the rock band, see Diesel Boy. Dieselboy Dieselboy performing at Starscape, Baltimore, MD, July 6, 2010 Background information Birth name Dam …   Wikipedia

  • Human Imprint — infobox record label tl|hangon HUMAN IMPRINT RECORDINGS parent = System Recordings founded = 2002 founder = Damian Higgins distributor = System Recordings genre = Drum and Bass city = New York, New York, USA url =… …   Wikipedia

  • CPU cache — Cache memory redirects here. For the general use, see cache. A CPU cache is a cache used by the central processing unit of a computer to reduce the average time to access memory. The cache is a smaller, faster memory which stores copies of the… …   Wikipedia

  • Algorithmic efficiency — In computer science, efficiency is used to describe properties of an algorithm relating to how much of various types of resources it consumes. Algorithmic efficiency can be thought of as analogous to engineering productivity for a repeating or… …   Wikipedia

  • AN/FPS-16 — manned space program and the U.S. Air Force. The accuracy of Radar Set AN/FPS 16 is such that the position data obtained from point source targets has azimuth and elevation angular errors of less than 0.1 milliradian (approximately 0.006 degree)… …   Wikipedia

  • Da Vinci Systems — is a main manufacturer of high end post production color grading and film restoration systems for feature films, video production and broadcast post production facilities. It was headquartered in Coral Springs, Florida still with offices in Los… …   Wikipedia

  • List of jungle and drum'n'bass artists — This is a list of jungle and drum and bass artists. This includes artists who have either been very important to the genre or have had a considerable amount of exposure (such as in the case of one that has been on a major label, but not limited… …   Wikipedia

  • Liste D'artistes De Jungle Et Drum N Bass — Liste des artistes de jungle et drum and bass Liste des artistes Jungle et Drum and bass trié alphabétiquement par nom d artiste. Sommaire 1 0 9 2 A 3 B 4 C 5 …   Wikipédia en Français

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”