Commit Graph

25 Commits

Author SHA1 Message Date
Lephenixnoir 0373ae50fe
_ic: also print claims owned by provided address 2023-08-20 20:27:52 +02:00
Lephenixnoir 2dbd910379
fxos, _if: add insufficient call analysis
We look for constants in call instruction parameters, but this only
works for jsr because the register argument in [jmp @rn] is not known to
be a constant yet (some static analysis required).
2023-08-20 20:23:30 +02:00
Lephenixnoir 44babe3baf
lib: allow declaring exclusive claims multiple times 2023-08-20 18:31:30 +02:00
Dr-Carlos 12845a1675 Improve command classification 2022-04-15 06:09:18 +09:30
Lephenixnoir 3a9a622ee3
_ic: new command to show claims on addresses 2022-04-06 18:41:41 +01:00
Lephenixnoir 23275d99c7
add infrastructure for function claiming parts of the binary
The CFG pass will soon be extended to actually emit the claims.
2022-04-05 19:35:52 +01:00
Lephenixnoir 6ae1a88bf7
_ads: register functions during discovery 2022-04-05 14:02:06 +01:00
Lephenixnoir d7b3fd0de8
add infrastructure for function passes
Ported existing passes to the new pass interface, now working properly.
2022-04-05 11:11:19 +01:00
Lephenixnoir 45888eb01c
add infrastructure for function passes (WIP) 2022-04-04 22:53:05 +01:00
Lephenixnoir 59ed0c8621
add main disassembly, ad and ads commands 2022-03-28 22:42:53 +01:00
Lephenixnoir 29cd2815ec
refactor disassembly infrastructure and passes 2022-03-28 20:59:30 +01:00
Lephenixnoir a9660da767
get rid of exceptions in the library, use explicit errors 2022-03-27 13:59:49 +01:00
Lephenixnoir 36fe7fcff4
refactor library utils 2022-03-27 12:12:53 +01:00
Lephenixnoir 245af5e993
rename Target into VirtualSpace 2021-03-16 14:43:43 +01:00
Lephenixnoir 2e58a8850b
support non-decoded instructions
This finally makes it possible to disassemble any interval without
worrying about potential errors. That's some progress.

By the way, now we can fully disassemble fx@3.10. Takes about 6 seconds
for the analysis passes, and ~9 seconds for printing on my machine.
2020-02-29 16:32:25 +01:00
Lephenixnoir c1c1be2d2c
support for mova, and more responsible OS creation 2020-02-29 11:25:03 +01:00
Lephenixnoir c5a7071dcc better manage exceptions and instruction-level passes 2020-02-28 16:19:50 +01:00
Lephenixnoir d5c5fa6aeb
implement the syscall pass, and symbol resolution
New features:
* The syscall pass now resolves syscalls for the input target, provided
  that an OS is mapped on the ROM region.
* Formalized the variations of print's arguments as a sequence (tree, to
  be precise) of /promotions/.
* Added a short notion of Symbol and SymbolTable, and a loader for them.
  Data files of type "symbol" are read as such and provide name to
  syscalls or arbitrary addresses.

Code changes:
* The disassembly operation of the command-line interface is now finally
  in its own file with more room.
* Encoded the tree structure of promotions as a sequence of (mainly
  tail-calling) inter-calling methods in the print pass.
2020-02-15 18:42:14 +01:00
Lephenixnoir 08e26aee2e
improve the semantic model and implement the pcrel pass 2020-02-15 09:22:12 +01:00
Lephenixnoir 4d9edecad9
start with the analysis passes
-> The cfg pass loads the function into memory, annotates leaders and
   jumps, and resolves delay slots.
-> The pcrel pass currently computes locations for pc-relative moves and
   jumps, but does not yet compute the pc-relative moved data.
-> The print pass displays the results of analysis with various layout
   and formatting options.
2020-02-12 07:53:00 +01:00
Lephenixnoir c499ca1f90 define a library abstraction and logging helpers
-> The Library class handles the loading and parsing of data files. This
   is because any fxos application will use this since everyone will
   have only one library.
-> Add a logging function that automatically format()s everything in
   sight with basic logging levels and a verbose mode. Standard logs are
   prefixed with __func__ for debugging purposes.
-> Allow format() to take std::string arguments for %s by statically
   extracting c_str()s.
-> Add a simple timing utility to understand which file load or
   disassembler pass takes up the time.
2020-01-26 12:48:39 +01:00
Lephenixnoir b20731c829 basic setup for running disassembly passes 2019-12-29 19:17:33 +01:00
Lephenixnoir 468495856d
implement more of the meat of the tool
* Separate OS and Target conceptually; now an OS is created on an
  existing target which must have ROM bound.
* Add a configuration file with a data library and description files
  which are automatically loaded at startup.
* As a first application, implement target descriptions. It is now
  possible (given the proper library) to type [fxos info fx@3.10] to get
  information on the fx OS version 3.10.
* Set up the pass infrastructure and the first few easy passes. This
  is still a Work In Progress and not yet called from the command-line.
* Improve the copy/move behavior of classes (C++ concerns).
* Add instruction metadata, which will make it easier to write actual
  useful analysis passes.
2019-12-28 17:18:13 +01:00
Lephenixnoir 8aaed3dd8c basic data structures for the disassembler 2019-12-20 19:33:41 +01:00
Lephenixnoir d78f7bca10 initial system: instruction load, target creation
Contains basic stuff to start working:

* Loading files and assembly instruction descriptions
* Create a 64k-entry assembly decoding table
* Standard memory regions and information
* Create targets where files can be mapped at any addresses
* Load OSes and detect a few basic things
2019-12-14 22:33:57 +01:00