Corrupt.wiki
  • Videogame corruptions
    • Introduction
    • Communities
    • Safety and Ethics of Corruptions
    • What makes a good corruption?
  • Real-Time Corruptor
    • RTC Discord
    • Download RTC
    • Beginner Guides
      • Tutorial Video Guide
      • Corruption Classroom
      • Cheat Sheet Guide
    • In-Depth Guide
      • Introduction
      • Frequently Asked Questions
      • Simple Mode
      • Concepts and Vocabulary
      • General Parameters
      • Corruption Engines
      • Emulation-centric features
      • Classic Vector Lists
      • Glitch Harvester
      • Blast Editor
      • Blast Generator
      • Virtual Memory Domains
      • VMD Generator (Advanced)
      • Cluster Engine (Advanced)
      • Hotkeys
      • Tips, tricks and quirks
    • More RTC Guides
      • RTCV Dev Startup Guide
      • Running RTCV on Linux
      • How to make Passthrough Lists
      • Sequence Loader Plugin
  • Other Corruptors
    • Classic Corruptors
      • Vinesauce ROM Corruptor
      • VineCorrupt
      • Android Vinesauce ROM Corruptor
      • Lesser known corruptors
      • Old Corruptors
    • Scares Scrambler
    • Cheat Engine
    • Web-Based Corruptors
  • Systems
    • NES
      • Corrupting the NES
      • NES Architechture
      • NES Memory Domains
    • SNES
      • Corrupting the SNES
      • SNES Architechture
      • SNES Memory Domains
      • SNES Audio Tinkering
    • Sega Genesis
      • Corrupting the Sega Genesis
      • Genesis Architecture
      • Genesis Memory Domains
      • Cracking the Checksum Routine
    • N64
      • Corrupting the N64
      • N64 Architecture
      • N64 Memory Domains
      • N64 Basic/Advanced ROM Corruption
      • N64 Expert ROM Corruption
    • Gameboy Advance
      • Corrupting the GBA
      • GBA Architecture
      • GBA Memory Domains
    • Nintendo DS
      • Corrupting the DS
      • MelonDS Memory Domains
      • MelonDS-Specific Lists
      • Rom Corruption (Deprecated)
    • Gamecube/Wii
      • Corrupting the GC/Wii
      • Dolphin Memory Domains
      • Dolphin-Specific Lists
      • Using a real Wiimote with Dolphin
      • Dolphin Narry's mod (Deprecated)
    • Playstation 1
      • Corrupting the PSX
      • Advanced corruptions
    • Playstation 2
      • Corrupting the PS2
      • PCSX2 Memory Domains
      • PCSX2-specific Lists
    • Playstation 3
      • Playstation 3 Executable Corruptions
    • Xbox 360
      • Xbox 360 Executable Corruptions (Real Console)
      • Xbox 360 Executable Corruptions (Xenia)
    • Nintendo Switch
      • Switch ROM Corruptions
    • Computers & Mobile
      • Corrupting Android Unity games
      • Corrupting Files with FileStub
      • Corrupting PC Games with ProcessStub
      • Corrupting VMware snapshots
    • Java
      • Java Corruptor Plugin
      • Corrupting Minecraft with the Java Corruptor Plugin and FileStub
      • Corrupting Project Zomboid with the Java Corruptor Plugin and FileStub
Powered by GitBook
On this page
  • Prerequisites
  • Introduction
  • Overview
  • How Do Passthrough Lists Work?
  • Naming your Lists
  • Simple Tutorial/Instruction-specific List:
  • Step 1: Finding the Opcodes
  • Step 2: Creating the List File
  • Step 2.5: Determining Endianness
  • Step 3: Adding Opcodes to the List
  • Advanced Tutorial/General Lists:
  • Conclusion

Was this helpful?

  1. Real-Time Corruptor
  2. More RTC Guides

How to make Passthrough Lists

PreviousRunning RTCV on LinuxNextSequence Loader Plugin

Last updated 1 year ago

Was this helpful?

By TomatoServal

Prerequisites

  • A basic understanding of computer architecture, including registers, opcodes, bits, etc.

  • Previous experiences with making lists for RTC

Introduction

The Vector Engine in RTC allows users to replace data structures (such as data types, instructions, etc) with other data structures inside a game. More advanced lists use a component called the BitlogicListFilter and it can do more than just a simple replacement. It can alter specific components of an instruction as well. One can use this for special lists called Passthrough Lists. In this short tutorial, I will explain how to make them for yourself in RTC.

*NOTE: You must look up the instruction set for the desired system. If you are unsure, use the following prompt in a Google search: “SYSTEM cpu.” Then, search for the architecture. In addition, you need a basic understanding of computer architecture. Now, let’s get started :)

Overview

How Do Passthrough Lists Work?

As mentioned, passthrough lists allow RTC to alter specific instruction components in a program. What does that mean?

Most CPUs need two types of information in an instruction:

  1. OPCODE - The specific operation the CPU needs to perform

  2. OPERANDS - The data the CPU manipulates during execution

Let’s say you wanted to add two numbers together: 5 and 6. On paper, you’d write it as 5+6. A CPU would interpret the addition sign as the OPCODE and the numbers as the OPERAND.

Passthrough lists preserve specific components of these instructions. You can denote these bits/bytes using the (#) character in the list file. As such, you can swap key components of opcodes called by the processor. For example, you can alter the registers in a load instruction, replacing important data with garbage. Such lists allow for more unique results compared to the typical [Limiter: Load -> Value: NOP].

Don’t mistake the (#) symbol for the (?) symbol. A (?) assigns a random value to the bit, allowing for a potential change. The (#) prevents this scenario from happening. To prevent any further confusion, I will refer to the (#) character as the static symbol and the (?) character as the variable symbol.

Naming your Lists

Whenever you make a list, its name should be easy to understand. The corrupter should be able to answer the following three questions, which I will refer to as identifiers:

  1. Which system should I use?

  2. Which instructions will this list target?

  3. How will this list affect the targeted instructions?

The first two identifiers follow similar guidelines as listed in the simple tutorial. The last one relates to passthrough lists specifically.

When naming your list, provide all these identifiers as concisely as possible. You can give it any name if it explains the list’s function. If you feel the name needs more explanation, you can utilize comments in the list file (I'll explain later).

Simple Tutorial/Instruction-specific List:

In the following tutorial, I will make a [MIPS]_BC_REGISTER list. This list aims to replace the registers that conditional branch instructions execute, e.g., branch if equal, branch if greater than, etc. We will disregard any “jump” instructions, as they execute regardless of any condition or state. This list applies to all systems that utilize a MIPS instruction set, which contains the N64, PS1, and PS2.

Step 1: Finding the Opcodes

First, we must search for the instruction set online. The website must include opcodes, which is a string of binary numbers in the following format: 100100100101. Do NOT use any assembly code in the following format: beq rs,rt,OFFSET.

The rs, rt, and offset fields in the following example represent variables that can change (registers, addresses, etc.). These are the exact fields we will target later on in this demonstration. Once you find a valid website, you can create your lists.

Step 2: Creating the List File

To start, we must create the file where we store lists. You must access the “VERSIONS” folder of RTC on your computer. Go to the following location: RTCV_XXX\RTCV\RTC\LISTS. Next, create a new text file, name it appropriately, and open it. Then, paste @BitlogicListFilter at the top of the file.

NOTE: You can use comments in these lists by starting a line with //. They help explain the function of your list and highlight what you still need to do.

PRO TIP: You can go to your RTCV Versions folder by right-clicking the version in your Launcher and then selecting “Open Folder.”

Step 2.5: Determining Endianness

RTC formats list entries in Little Endian format by default. You can add an underscore at the beginning of your text file if you want all instructions to use a Big Endian format. It makes copying easier since most websites show them in this format. However, plans are in place to change this system. Personally, I format my lists in Little Endian to future-proof them. As such, I will use this format in the example list in Step 3.

To convert between the formats, you must put all bytes in reverse order. Below is a table representing data values in both endian formats:

In this example, we have a 16-bit word, both in hexadecimal(0x) and binary(0b). The most-significant byte is highlighted in green, while the least-significant byte is highlighted in red. The two bytes change locations, depending on their endianness.

Step 3: Adding Opcodes to the List

Now that we have our website and lists, we may add our opcodes to the passthrough list. We must locate all conditional branch instructions on the site and copy them into the list. Note that for each entry, we must include 0b if our items are in binary and 0x if they’re in binary.

Below is the instruction in question:

In this example, the register fields (rs and rt) are 5 bits long, while the offset field is 16 bits long. Since we want to change the registers, we will replace every register bit with a variable symbol in the list. For the offset, we will replace every offset bit with the static symbol. This will prevent these bits from changing when using the list. After inserting the new characters, our current list file will look like this:

However, if you notice, our entry is in Big Endian format. If we want to convert the following into Little Endian, we must reverse the order of bytes. As a result, we get the following:

Using this method, we can convert the remaining conditional branch opcodes to get the following file:

We have now created the lists. To use it, place [MIPS]_BC_REGISTER as both the limiter and value list.

That concludes the simple tutorial. You can use this method for any system. However, you can do more with passthrough lists than just this.

Advanced Tutorial/General Lists:

You don’t NEED to use passthrough lists with themselves. You can use it with ANY list as the limiter. Therefore, you can utilize standard RTC lists in tandem with passthrough lists, resulting in fewer lists.

In this section, you will need two lists:

  1. A regular list with all conditional branches

  2. A passthrough list swapping the registers.

We can utilize the list in the simple tutorial for both with some changes. For our first list, we will copy [MIPS]_BC_REGISTER in the current directory and rename it to [MIPS]_BC. Then, we will open the text document and replace all static symbols with variable symbols. When you finish, it should look like the following:

Creating our second list will require different changes. We will, again, copy [MIPS]_BC_REGISTER in the current directory but rename it to [MIPS]_ReplaceRegister. Next, we will open the file. However, we will delete all opcodes except for beq. Finally, we will replace all numbers with the static symbol. When you finish, the second list should look like this:

You are now ready to use these lists. Just place [MIPS]_BC as the limiter list and [MIPS]_ReplaceRegister as the value list.

This method is more complicated and abstract compared to the simple tutorial. Yet, it is also more practical. CPUs follow a universal arrangement for each instruction. Regarding MIPS, there are three instruction types: R-Type, I-Type, and J-Type. Conditional branches fall under the I-Type, which includes a 6-bit opcode, two 5-bit registers, and a 16-bit immediate/offset value.

Our register replacement list will work for all I-Type instructions. To make our list more universal, I can rename it [MIPS]_ReplaceRegister_Itype to highlight this fact.

Creating lists by type rather than opcode will require fewer lists. There is a common instruction arrangement for each CPU. You will need to research your desired system thoroughly to find it, but you will surely reap the benefits.

Conclusion

To conclude, passthrough lists are very versatile. Using the static symbol (#), they can target and change specific instruction components. You can either use them with themselves or in tandem with regular lists.

There are many ways to make passthrough lists than the ones mentioned in this tutorial. Try to experiment with them on your own. Happy testing :)

One final PROTIP: If you need to flip the endianness of an entire list, you can add _ at the beginning of the filename to make RTC auto-flip the endianness when loading it.