68 Commits

Author SHA1 Message Date
7cba0aa52c Updated lints and features to 1.52.0-nightly. 2021-03-11 16:01:19 +00:00
80d3dc9a81 Updated GameFile to the new interface.
Fixed bug with `FileReader`'s `io::Seek` impl, where it didn't actually seek the file.
Fixed bug with `DirEntry::from_reader` impl, where it didn't read the remaining entry bytes.
2021-01-23 07:19:55 +00:00
9fa368afe4 Removed unnecessary dependencies on most things.
Turned `dcb-tools` into several packages.
Revised `dcb-util` a bit.
2021-01-21 22:30:29 +00:00
0ebd141373 Implemented the custom filesystem. 2021-01-18 21:38:06 +00:00
8b650c5aad Removed old dcb-io implementation and started on new one based on the filesystem. 2021-01-17 18:14:32 +00:00
7e9dec9659 DataNode is now public.
Revised `node::InsertError`.
Logging to file is now from `Debug` on up.
2021-01-16 17:22:09 +00:00
831dc61597 Data is now classified on whether it was found heuristically or known. 2021-01-16 16:31:01 +00:00
9e95b1b87d Removed depency for anyhow in dcb-exe.
Added `dcb_util::fmt_err`.
2021-01-16 16:06:18 +00:00
eff64e3f6e Revised documentation and implementation of DataTable.
Added `Display` for `DataTable`.
2021-01-16 15:38:19 +00:00
77a811cafd Moved DataTable::get_known to exe::get_known_data_table. 2021-01-16 15:00:23 +00:00
46d634fb25 DataTable::extend now ignores duplicates. 2021-01-15 20:19:27 +00:00
ab7a0903c3 Functions and data now have # prefixes and suffixes.
Function labels cannot be equal to it's starting position now.
2021-01-14 22:48:03 +00:00
cc91e5a88e Removed unneeded #[allow(...)]. 2021-01-14 21:06:54 +00:00
c82ce251a1 Removed manual serde impl of Pos. 2021-01-14 21:03:50 +00:00
92995bc62e Added new Marker type. 2021-01-14 16:46:05 +00:00
f56ef6b136 Made Data fully immutable and removed it's *Eq impl.
Moved `DataTable::search_instruction` to `Data`.
Completely revised `DataTable`'s implementation.
Fixed duplicate and mis-typed data in `known_data`.
2021-01-14 16:22:07 +00:00
34c1f7eff9 Removed Deref impl for DataTable. 2021-01-13 23:58:23 +00:00
bbfe541a6d Fixed {Data, Func}Table::get_*.
`Directive` now implements `InstTargetFmt`.
2021-01-13 23:09:25 +00:00
930696eaec Made same changes last commit did in DataTable to FunTable. 2021-01-13 22:38:27 +00:00
25c32f977c Function table heuristics now take the known data table for filtering.
`Directive::decode_with_data` now returns a `Result`.
Fixed `DataType` not rounding strings to the next word.
`Data` now sorts by smallest first in case positions are equal.
Fixed `get_containing` in `DataTable` and added `get_starting_at`.
2021-01-13 22:33:10 +00:00
cba889642a Inst::decode now returns a Result.
Added `Diretive::decode_with_data`.
2021-01-13 21:01:07 +00:00
ffd74f60ac Added some documentation to both instruction iterators. 2021-01-12 17:28:57 +00:00
29643a72db Removed custom implementation of DataType.
Removed `DataType::AsciiChar` and added `DataType::AsciiStr`.
`inst::Inst::decode` now takes a data and func table.
2021-01-12 15:19:07 +00:00
fcd376c9a5 Both tables now get the instruction range to limit their search. 2021-01-12 03:43:46 +00:00
5390df6d72 Exe can now be sliced by a position range. 2021-01-12 03:32:05 +00:00
d9bc90882b Executable size and start positions are now dynamic.
Function labels are no longer printed at the start.
2021-01-12 03:20:13 +00:00
c443402400 Now parsing known tables before building parser. 2021-01-12 03:06:49 +00:00
83db95939a pseudo::{load, store} now implement InstTarget and InstTagetFmt. 2021-01-12 02:40:15 +00:00
12f2abc638 Relaxed requirements of implementing InstTargetFmt to allow semi-targetable instructions.
`pseudo::load_imm` now implements `InstTargetFmt`.
2021-01-12 02:35:39 +00:00
dbfdc01a2e basic::jmp now implements InstTargetFmt. 2021-01-12 02:28:22 +00:00
a559fa80a9 Added InstTarget and InstTargetFmt to format custom instructions with a target.
Removed `fmt::InstFmt::fmt_value` and `fmt::InstFmtWrapper`.
2021-01-12 02:13:00 +00:00
a892ad09f1 Removed pseudo::*Assign instructions. 2021-01-12 01:34:40 +00:00
27fc4e4a5a Removed pseudo::jmp and made basic::{cond, jmp::reg} write the pseudo instrutions. 2021-01-12 01:30:30 +00:00
220d0068a6 Improved inst::iter.
The decompiler now successfully goes through functions, data and others.
2021-01-12 01:17:02 +00:00
267cfd1cd7 Finished the co-processor instructions. 2021-01-11 19:45:57 +00:00
ec0d1bcf0c Added basic::co instructions (not finished yet).
Removed `InstFmt::mnemonic`.
2021-01-11 19:07:09 +00:00
9cc7d81e8e Added pseudo::shift_assign instructions.
Fixed `pseudo::store` instruction being implemented wrong.
2021-01-11 17:47:52 +00:00
a00fd15d49 Added pseudo::{load, store} instructions.
Fixed `basic::{load, store}` instructions reading destination and source backwards.
2021-01-11 17:25:18 +00:00
cc44af744c Fixed missing 0x when printing signed hex in some places. 2021-01-11 16:59:22 +00:00
e29c3ed4e0 Added pseudo::jmp.
Refactored `basic::{jmp, cond}`'s target calculation.
2021-01-11 16:58:20 +00:00
b72a857a8a Added pseudo::move_reg instruction. 2021-01-11 16:25:59 +00:00
db2cac8840 Added pseudo::Nop instruction. 2021-01-11 15:58:42 +00:00
195e7d9f24 Added TryInto for all enum instructions.
Added `pseudo::load_imm` instrution.
Instructions are now only decoded if aligned to a word.
2021-01-11 15:39:12 +00:00
8d08ed0d60 Directive now stores a reference to the string read.
`InstFmt` no longer requires the instruction bytes.
2021-01-11 14:41:42 +00:00
7fb0030128 Made Directive::Decode respect alignment.
Added several methods to `Pos` for alignment.
2021-01-11 14:20:20 +00:00
adf8538736 Added inst::Inst::decode and changed ParseIter to use it.
`Directive::decode` now only returns itself.
2021-01-11 14:05:10 +00:00
847e88d490 Added inst::InstSize.
Removed `Pos + i16` implementation.
Added `Pos + usize` implementation.
2021-01-11 13:45:16 +00:00
f0258052ba Now allowing clippy::indexing_slicing globally in dcb-exe. 2021-01-11 13:03:20 +00:00
a40802a84c Fixed load and store basic instruction being presented wrong. 2021-01-11 13:02:35 +00:00
affd7034e6 Added pseudo::Decodable trait for decoding pseudo instructions. 2021-01-10 15:01:16 +00:00