Implement mod deployment/mod loading #28

Closed
opened 2023-02-23 09:18:46 +01:00 by lucas · 1 comment
Owner
No description provided.
lucas added this to the Basic SDK and mod manager milestone 2023-02-23 09:18:46 +01:00
lucas added the
kind
feature
stage
actionable
crate/dtmm
labels 2023-02-23 09:18:46 +01:00
lucas self-assigned this 2023-02-23 09:18:46 +01:00
lucas added this to the Mod Manager project 2023-02-23 09:18:46 +01:00
Author
Owner

Currently stuck on the fact that injecting a Lua file into packages/boot works, but as soon as I try to inject a Package file, the game will just hang at startup, even before scripts/main is executed.

I have a gut feeling that it's related to not handling/writing the Bundle Database properly. Things to look into:

  • A way to debug the bundle database, e.g. a command to show its contents in a human-readable format.
  • IIRC, in certain parts the binary format appeared to contain values sorted (presumably the hash maps on murmur hashes just being written out from their internal array structure). Rust's HashMap does not guarantee any order for iteration, so I'd need to sort explicitly.
    • No apparent ordering
  • Go back into IDA and try to find stuff regarding the database there. It should be mostly the same in VT2, so the PDB there might help.
    • Hunt down the "resource hash" algorithm again.
    • Check whether their struct actually contains the three different fields, like currently implemented in sdk.
    • Try to find the 20 bytes
      • In the current file, they're all 0 again
  • In the bundle database, ensure that the Vec in stored_files only holds entries unique by name (I probably can't make it a HashSet though, as I need the specific order)
    - [ ] Check if HashSet retains order, or if there is an implementation of it that does
  • Use a patch bundle instead of injecting into the primary packages/boot
Currently stuck on the fact that injecting a Lua file into `packages/boot` works, but as soon as I try to inject a Package file, the game will just hang at startup, even before `scripts/main` is executed. I have a gut feeling that it's related to not handling/writing the Bundle Database properly. Things to look into: - [ ] A way to debug the bundle database, e.g. a command to show its contents in a human-readable format. - [x] ~~IIRC, in certain parts the binary format appeared to contain values sorted (presumably the hash maps on murmur hashes just being written out from their internal array structure). Rust's `HashMap` does not guarantee any order for iteration, so I'd need to sort explicitly.~~ - No apparent ordering - [ ] Go back into IDA and try to find stuff regarding the database there. It should be mostly the same in VT2, so the PDB there might help. - [ ] Hunt down the "resource hash" algorithm again. - [ ] Check whether their struct actually contains the three different fields, like currently implemented in `sdk`. - [x] ~~Try to find the 20 bytes~~ - In the current file, they're all `0` again - [x] In the bundle database, ensure that the `Vec` in `stored_files` only holds entries unique by `name` (I probably can't make it a `HashSet` though, as I need the specific order) ~~- [ ] Check if `HashSet` retains order, or if there is an implementation of it that does~~ - [ ] Use a patch bundle instead of injecting into the primary `packages/boot`
lucas referenced this issue from a commit 2023-02-25 19:33:43 +01:00
lucas closed this issue 2023-02-25 19:33:43 +01:00
Sign in to join this conversation.
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: bitsquid_dt/dtmt#28
No description provided.