Posted on Leave a comment

Guide to Creating Custom Firmware for DMA Cards

custom dma firmware guide

Welcome! If you’re looking to create your own custom firmware for DMA cards, you’ve come to the right place. There’s a lot of misinformation and gatekeeping surrounding this topic, often because people sell firmware for hundreds of dollars. This guide aims to demystify the process and provide you with the tools and knowledge needed to create custom firmware and avoid anti-cheat detection.

Prerequisites

Before diving in, ensure you have the following tools and resources:

Initial Customization

Step 1: Setting Up Your Environment

  1. Install Vivado and Visual Studio: Follow the standard installation process for both tools.
  2. Download the Firmware Source: Clone or download the firmware source code from the provided GitHub link.

Step 2: Customizing the Firmware

  1. Open the Firmware Project:
    • Launch Visual Studio and open the PCIeSquirrel folder.
  2. Search and Modify Functions:
    • Press CTRL+F to search for specific lines of code.
    • Locate rw[20] <= 1; in the pcileech_pcie_cfg_a7.sv file.
    • Change lines 208 and 209 to:verilogCopy coderw[20] <= 1; rw[21] <= 1;
    • Modify the Device Serial Number (DSN) on line 215:verilogCopy coderw[127:64] <= 64'h00000000xxxxxxxx; // +008: cfg_dsn Change xxxxxxxx to a unique identifier.

Generating the Project

Step 3: Building the Vivado Project

  1. Open the TCL Shell:
    • Navigate to the project folder using cd.bashCopy codecd C:/Users/XXXX/Desktop/PCIeSquirrel
    • Generate the Vivado project:bashCopy codesource vivado_generate_project.tcl -notrace
  2. Open the Project in Vivado:
    • Double-click the pcileech_squirrel.xpr file to open it in Vivado.

Customizing Within Vivado

Step 4: Modifying PCIe Parameters

  1. Navigate to the IP Core:
    • In the project manager, open the file tree to pcileech_squirrel_top\i_pcileech_pci_a7.
    • Double-click i_pcie_7x_0 to customize the IP.
  2. Update Device IDs:
    • In the IDs tab, modify the following parameters to match your desired device:
      • Vendor ID: 10EB
      • Device ID: 3029
      • Revision ID: 09
      • Subsystem Vendor ID: 10EB
      • Subsystem ID: 0008
    • Adjust class codes if mimicking a different device type.
  3. Lock the IP Core:
    • In the TCL Console, lock the core:tclCopy codeset_property is_managed false [get_files pcie_7x_0.xci]

Advanced Customization

Step 5: Changing BAR Address and MSI/PCI Pointers

  1. Modify BAR Address:
    • Search for bar_0 in Visual Studio:jsonCopy code"bar_0": [ { "value": "FFFFF000", "resolve_type": "generated", "usage": "all" } ],
    • Change the address to mimic a physical device.
  2. Update MSI/PCI Pointers:
    • Run synthesis in Vivado to generate strings.
    • In Visual Studio, search and modify MSI/PCI pointers.

Final Steps

Step 6: Building the Firmware

  1. Generate Bitstream:
    • In Vivado, select Generate Bitstream.
    • Once complete, locate the firmware file: pcileech_squirrel_top.bin.

Flashing the Firmware

Step 7: Flashing the DMA Card

  1. Prepare for Flashing:
    • Ensure the DMA card is connected to the JTAG port.
  2. Use OpenOCD for Flashing:
    • Open the command prompt and navigate to the flash_screamer folder.bashCopy codecd Desktop/flash_screamer
    • Flash the firmware:bashCopy code..\openocd\bin\openocd.exe -f flash_screamer_squirrel.cfg
  3. Verify Successful Flashing:
    • Confirm the firmware has been flashed by checking for the Found flash device message.

Frequently Asked Questions

  • Which DMA card should I get? For budget-friendly options, choose 35T. For faster and newer cards, go for 75T.
  • What firmware do I need for my DMA card? 35T uses Squirrel, and 75T uses EnigmaX1.
  • Can I flash the same firmware on a new card? Yes, as long as the prototype chip is the same.
  • What are the minimum specs for my second computer? USB 3.0 and at least 6GB RAM.
  • How do I flash my firmware? Use OpenOCD or the relevant tool for your specific DMA card model.

Congratulations on completing the custom firmware for your DMA card! Remember, this guide is for educational purposes, you are responsible for anything that happens to your card or computer.

Credit to garagedweller at UnknownCheats for the original guide.

Leave a Reply