Commit Graph

167 Commits

Author SHA1 Message Date
Lephenixnoir 0ffc5f38f6
af, afs: mark project dirty on creation, not analysis 2024-01-15 18:57:36 +01:00
Lephenixnoir 10e7334524
view: show syscall numbers even when the function has a name 2024-01-15 18:56:46 +01:00
Lephenixnoir 593d486185
fxos: fix basic block duplication bug 2024-01-15 18:55:55 +01:00
Lephenixnoir 51ee6fd6ff
af, afs: add recursive function search option (-r) 2024-01-11 20:03:11 +01:00
Lephenixnoir 7a656c3b3e
fxos: show memory usage after project load 2024-01-11 19:47:06 +01:00
Lephenixnoir 64a3df8e17
fxos: faster project loading through functions
- Compute analysis on-demand
- Faster function exploration, due to:
  * Cache basic block's index in function
  * Preallocate memory for 4 blocks per function
  * Preallocate 32 instructions per superblock
  * Assume functions do not cross vspace region boundaries
  * Improve cutSuperblockAt() with lower-level code
2024-01-11 12:42:15 +01:00
Lephenixnoir 80d6001417
fxos: save binary objects (currently functions) in project 2024-01-08 21:10:12 +01:00
Lephenixnoir f5ad03152d
fxos: internalize assembly tables, for real this time 2024-01-07 19:35:10 +01:00
Lephenixnoir 9b817fe808
fxos: improve analysis of move-register when value is known 2023-12-26 16:07:36 +01:00
Lephenixnoir eacdf9da99
fxos: cleaner function abstraction + analysis of delay slots
* Update documentation about functions API
* Clean up rough edges, including instruction iterators, basic block
  ending types, and calls that were misleading about the structure
* Fix the static analysis code not accounting for delay slots
* Improve/enrich the program diff structure
2023-12-26 15:43:00 +01:00
Lephenixnoir 944745d0e3
fxos: print call targets in [d -a] 2023-11-29 17:33:44 +01:00
Lephenixnoir ed902db2d8
fxos: first useful analysis + quite a few cleanups 2023-11-29 16:33:14 +01:00
Lephenixnoir 255e31ab8f
fxos: make AsmArgument -> AsmOperand more analysis-friendly 2023-11-29 16:33:14 +01:00
Lephenixnoir 068898c2d6
fxos: switch to symbolic opcodes in AsmInstruction 2023-11-29 16:33:14 +01:00
Lephenixnoir 74fade0042
fxos: generate defs from insn table + some renaming 2023-11-29 16:33:13 +01:00
Lephenixnoir c299a5f1b6
fxos: print (still WIP) analysis results
Looking good.
2023-11-14 01:19:46 +01:00
Lephenixnoir ff2e9c2072
fxos: prototype analysis, C++20 views 2023-11-13 23:43:48 +01:00
Lephenixnoir d65515b9ad
fxos: replace function analysis with new objects
This affects ad and ads, which are now called af (Analysis: Functions)
and afs, and produce binary objects instead of entries in the soon-to-
be-removed disassembly.
2023-11-05 19:57:59 +01:00
Lephenixnoir 7f2fc40ac6
fxos: replace parts of base library with syscall defs
These are not used yet to create functions and are just visible in isc.
2023-11-05 19:57:58 +01:00
Lephenixnoir 9ed14e9fa7
fxos: remove now-unused old "symbols" storage
This is being replaced by:
- Binary objects for functions, variables, etc. (WIP)
- Hardcoded tables for syscalls and their prototypes. (TODO)
2023-11-04 11:14:03 +01:00
Lephenixnoir 1df2a14c06
fxos: assembly visualization for new functions 2023-11-04 11:05:22 +01:00
Lephenixnoir bbfb96bb1a
fxos: fix a very suspicious dangling reference 2023-11-04 11:05:22 +01:00
Lephenixnoir 06a9d7e5af
fxos: make Binary::OSAnalysis const (slight hack) 2023-11-04 10:30:56 +01:00
Lephenixnoir 6b4a122866
fxos: new function interface + cfg construction, to be tested 2023-10-07 22:54:30 +02:00
Lephenixnoir ede0a79b33
fxos: remove claims from Disassembly 2023-10-07 15:08:23 +02:00
Lephenixnoir f2c1ce50fe
fxos: binary-based passes, print pass -> basic asm view 2023-10-07 12:36:30 +02:00
Lephenixnoir b7569df076
shell: merge bc/brm into bs, add binary renaming 2023-09-25 22:39:58 +02:00
Lephenixnoir b0911cb092
shell: merge ibs into ib -a 2023-09-25 21:36:35 +02:00
Lephenixnoir dffc3c7b02
shell: go back to unix shell-like options 2023-09-25 21:36:25 +02:00
Lephenixnoir 2a3f1845de
fxos: remove vspace as a session abstraction
And rewrite all existing commands to read from a binary instead.

The transition to the new data model is *not* complete because a bunch
of data is still hidden in the "Disassembly" inside the binary's virtual
space instead of being managed by the binary itself. Removing these is
the next step.
2023-09-24 20:52:37 +02:00
Lephenixnoir fcdcdba423
fxos: create, select, remove, save and load binaries
This includes migrating them from legacy vspaces, which currently
migrates the bindings but not the symbol definitions.
2023-09-24 16:37:08 +02:00
Lephenixnoir 9d7c87ac3d
fxos: rename Instruction -> OldInstruction 2023-09-24 10:45:40 +02:00
Lephenixnoir 0c52cfca27
shell: load fxosrc files into flat legacy vspace info 2023-09-23 22:50:35 +02:00
Lephenixnoir e52b8411b3
fix my damn protocol for testing builds
I consistently checked that commits built by stashing all other
changes... but forgot to stash untracked files.
2023-09-23 21:37:01 +02:00
Lephenixnoir 12d41ac823
shell: refactor main loop 2023-09-23 21:36:14 +02:00
Lephenixnoir 356d09e52d
fxos: add new project logic (without any data in them)
Projects are now created, saved, reloaded. Next step is to provide the
pm command to migrate old vspaces to them, and then start getting rid of
the old abstractions.
2023-09-23 20:21:08 +02:00
Lephenixnoir 6edbd1dba1
fxos: more BSON utilities 2023-09-23 19:07:31 +02:00
Lephenixnoir c0820b59f0
fxos: refactor AbstractMemory into <fxos/vspace.h> 2023-09-16 11:49:56 +02:00
Lephenixnoir 56a4800bbd
fxos: add a small BSON serialization library
(I tested it obviously)
2023-09-09 23:19:10 +02:00
Lephenixnoir a4cda4cb66
fxos: rename Function -> OldFunction
This prepares the introduction of a new program model different enough
from the original that I'd rather build it on the side than
progressively update the current one.
2023-09-03 19:20:45 +02:00
Lephenixnoir b5d7947958
fxos: set optimization level depending on build type 2023-09-03 19:19:13 +02:00
Lephenixnoir 3e620280c0
fxos: add a CMake option to post-process compiler logs 2023-09-03 19:11:44 +02:00
Lephenixnoir 6406f05eb2
shell: fix crash for commands without a long description 2023-09-03 19:03:48 +02:00
Lephenixnoir 47764a61eb
fxos: refactor AsmInstruction categories into assembly table tags 2023-08-27 23:25:35 +02:00
Lephenixnoir 61c3714404
shell: fix syntax error + autocompletion exception
Somehow there were two types of syntax errors, and the autocompletion
code was not catching the correct one.
2023-08-23 16:20:29 +02:00
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 df4bba2c1a
fxos: analyze pcrel in cfg (for future call analysis)
This will not cover advanced stuff that relies on static analysis, but
we don't care at the moment.
2023-08-20 19:42:06 +02:00
Lephenixnoir 12e6cd45a4
_am: add search for OS main menu function 2023-08-20 18:52:34 +02:00
Lephenixnoir 0f23fec85d
shell: fix double syntax errors aborting program
Type e.g. "e 1 + 2 * 3". The first "+" throws a syntax error
(parentheses are needed around expressions) and the "*" another one
during the final exhaust_until_separator phase, which wasn't protected
by a try/catch.
2023-08-20 18:31:30 +02:00