Git Product home page Git Product logo

retrogram's People

Contributors

kmeisthax avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

tykel

retrogram's Issues

Fork points should be made at the point of lowest entropy in the trace

Let's say we encounter a jump table, like so:

ld a, [JMP_PARAM]
ld hl, JMP_TABLE
add a, l
ld l, a
ld a, h
adc a, 0
ld h, a
ld a, [hli]
ld h, [hl]
ld l, a
jp [hl]

Right now tracing will hit the last line of the stream and then bail as the entropy of jp [hl] is maximal. It can literally go anywhere if you don't know the value of the jump table's parameter, which goes from 8 to 9 to 16 to up to 25 bits of entropy as to where the jump lands. If we instead forked at the start on the value of a, then we'd only have 8 bits total (although with still plenty of invalid values, which we'd have to discover by some other means).

In order to do entropy minimization, we need to actually track data values through the trace, as well as have a way to analyze data dependencies (so we can discard irrelevant forks).

Repeated manual entrypoint creation results in incorrect label parenting

When a new parent label is created in between a parent and it's child, the child's parent is not updated to the new parent.

Example: In Telefang, disassemble $A2A - this creates a child block at $A3D. Then disassemble $A34 - the label .LOC_A3D will still be parented to ENTER_A2A despite not being actually local anymore.

More generally we should enforce a restriction that all local labels must be parented to the last parent block; and furthermore prevent creation of local labels on symbols that have nonlocal crossreferences. Some assemblers do not allow you to use non-local symbols as global symbols (e.g. ENTER_A34.LOC_A3D)

Analysis in banks yields excessively contextualized pointers

In Telefang, disassemble 4:4000. The resulting code will have excessively contextualized pointers, like so:

ENTER_4_4000:
    ld a, [$PR_4!c3e1]
    ld hl, 16394
    call $PR_4!e97
    jp [hl]

The PR_4 is the internal string form of a ROM context on this platform; those are WRAM and HOME pointers though, so their contexts should be stripped when analyzing.

Remove type parameters from `ProjectDatabase`

ProjectDatabase, which is our in-memory representation of retrogram.db, should not be specific to one architecture type. It should be architecture-agnostic, so that programs from multiple architectures can be analyzed in the same database.

Database<AR> should be separated into an architecture-erased trait that includes Any and a concrete database type. ProjectDatabase will store boxed, type-erased databases and use Any to type-check AR for methods that need to interact with an architecture.

Add trait for platforms and remove the `file` requirement from `with_architecture!`.

Platform constructors should have a trait Platform which allows handing the constructor a filesystem and getting a memory bus out of it. This should be roughly equivalent to the existing construct_platform methods, but with the ability to hand more than one file to the constructor.

with_architecture! can then lose the file parameter, as not all architecture-specific code needs to have a working memory bus.

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.