Giter Site home page Giter Site logo

ecu-defmig's Introduction

ECU-DefMig

Basic CLI tool for inferring ECU definitions from a known similar rom.

Description

Let's say you read the rom for your ECU, but it's not listed on the known definitions page. ; however, someone has shared an experimental ECU definitions file for an ECU that closely matches yours.

The shared defs file puts names to map and axis storage addresses:

<table name="Primary Open Loop Fueling A" storageaddress="114424" sizex="13" sizey="8">
  <table type="X Axis" storageaddress="1143D0" />
  <table type="Y Axis" storageaddress="114404" />
</table>

... But if you can get a rom for this known ECU, plug it into ScoobyRom(SR), and export as a RomRaider xml file, you'll see that it contains more information about each table:

<table type="3D" name="Record 0xBC460" category="Unknown 3D" storagetype="uint8" endian="big" sizex="13" sizey="8" storageaddress="0x114424">
  <!-- min: 0  max: 0.28125  average: 0.09127104 -->
  <scaling units="" expression="x*0.0078125" to_byte="x/0.0078125" format="0.000" fineincrement="0.01" coarseincrement="0.1" />
  <table type="X Axis" name="" storagetype="float" storageaddress="0x1143D0">
    <!-- 0.3 to 1.5 -->
    <scaling units="" expression="x" to_byte="x" format="0.00" fineincrement="1" coarseincrement="5" />
  </table>
  <table type="Y Axis" name="" storagetype="float" storageaddress="0x114404">
    <!-- 1700 to 4000 -->
    <scaling units="" expression="x" to_byte="x" format="0.00" fineincrement="1" coarseincrement="5" />
  </table>
  <description>
  </description>
</table>

Doing the same for your rom yields a similar file. ECU-DefMig puts names to the SR tables by mapping storage addresses with the known defs file and then compares table attributes, scaling elements, and comments between the mapped SR file and your unmapped SR file to infer definitions for your unknown ECU rom.

... Or at least, that's the idea, you should probably do a manual 1:1 comparison in SR between all the inferred tables as a sanity check before writing anything to your ECU.

Install Node.js 10+ & Dependencies

npm install

Usage

$ node ./main.js --help
usage: main.js [-h] [-v] [--source SOURCE] [--source-sr SOURCE_SR]
               [--target TARGET] [--target-sr TARGET_SR]


ECU-DefMig

Optional arguments:
  -h, --help            Show this help message and exit.
  -v, --version         Show program's version number and exit.
  --source SOURCE       Source RomRaider XML definitions
  --source-sr SOURCE_SR
                        Source ScoobyRom RomRaider XML maps
  --target TARGET       Target RomRaider XML definitions to generate
  --target-sr TARGET_SR
                        Target ScoobyRom RomRaider XML maps

Issues

2D tables with only a Y-axis are ignored by ScoobyRom, this tool only exports 3D tables and 2D tables along the X-axis.

ecu-defmig's People

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.