@lunarood would you like to make a contract?
Conversation
Notices
-
Embed this notice
Foone🏳️⚧️ (foone@digipres.club)'s status on Thursday, 20-Feb-2025 03:58:26 JST Foone🏳️⚧️
- Haelwenn /элвэн/ :triskell: likes this.
-
Embed this notice
Luna Rood (lunarood@mastodon.gamedev.place)'s status on Thursday, 20-Feb-2025 03:58:27 JST Luna Rood
@foone Wait a second... How did you get your hands on the very thing I'm working on right now?
Leave my entropy alone! It's there for a reason, ok!? 😤
-
Embed this notice
Foone🏳️⚧️ (foone@digipres.club)'s status on Thursday, 20-Feb-2025 03:58:28 JST Foone🏳️⚧️
it "decompressed" to the compressed input, but with 3 bytes missing from the beginning and an extra "G" at the end.
-
Embed this notice
Foone🏳️⚧️ (foone@digipres.club)'s status on Thursday, 20-Feb-2025 03:58:28 JST Foone🏳️⚧️
if you decompress a file and it gets smaller, you fucked up.
(or it has really high entropy and your compression algorithm has a big header)
-
Embed this notice
Foone🏳️⚧️ (foone@digipres.club)'s status on Thursday, 20-Feb-2025 03:58:29 JST Foone🏳️⚧️
alright, I ported over enough of the decompression algorithm for it to run for the first time!
Did it work? NO OF COURSE NOT! but running is at least PROGRESS
-
Embed this notice
Foone🏳️⚧️ (foone@digipres.club)'s status on Thursday, 20-Feb-2025 03:58:30 JST Foone🏳️⚧️
okay it was recompiled/reassembled: some globals are in different locations.
but it's 100% the same code.
-
Embed this notice
Foone🏳️⚧️ (foone@digipres.club)'s status on Thursday, 20-Feb-2025 03:58:31 JST Foone🏳️⚧️
I finally went and confirmed something I assumed:
The compression routines from Bible Builder and Captain Bible are identical. like, I'm not even sure they were even recompiled identical.
-
Embed this notice
Foone🏳️⚧️ (foone@digipres.club)'s status on Thursday, 20-Feb-2025 03:58:32 JST Foone🏳️⚧️
I should build an x86 usb device. It's stupid because I literally am on an x86 machine, but SOMEONE didn't think 16bit backwards compatibility was important. Philistines!
-
Embed this notice
Foone🏳️⚧️ (foone@digipres.club)'s status on Thursday, 20-Feb-2025 03:58:33 JST Foone🏳️⚧️
My everything hurts, I'm starving and can't eat, my brain is fogged, and I have a lot of stuff to do today that's important.
Clearly it's time to write my own x86 emulator, again
-
Embed this notice
Foone🏳️⚧️ (foone@digipres.club)'s status on Thursday, 20-Feb-2025 03:58:34 JST Foone🏳️⚧️
I'm gonna have two of these Memory objects for DS and ES, and since I haven't implemented it I'm gonna PRAY the fact that those two segments are partially overlapping doesn't matter
-
Embed this notice
Foone🏳️⚧️ (foone@digipres.club)'s status on Thursday, 20-Feb-2025 03:58:34 JST Foone🏳️⚧️
if it does end up mattering, I'm gonna cry a lot, then implement OVERLAPPING MEMORY RANGE EMULATION
-
Embed this notice
Foone🏳️⚧️ (foone@digipres.club)'s status on Thursday, 20-Feb-2025 03:58:35 JST Foone🏳️⚧️
but this'll make it way easier to port the decompiled decompression routine without having to understand how it works.
which I don't
-
Embed this notice
Foone🏳️⚧️ (foone@digipres.club)'s status on Thursday, 20-Feb-2025 03:58:36 JST Foone🏳️⚧️
so basically I removed type safety from python, kinda.
-
Embed this notice
Foone🏳️⚧️ (foone@digipres.club)'s status on Thursday, 20-Feb-2025 03:58:37 JST Foone🏳️⚧️
okay I wrote a module to let me define some memory and then define multiple variables of different types in it, and it's all backed by the same set of bytes and you can read and write from any of them and they'll all work.
-
Embed this notice
Foone🏳️⚧️ (foone@digipres.club)'s status on Thursday, 20-Feb-2025 03:58:38 JST Foone🏳️⚧️
I haven't even completed this script enough for it to run, and already I'm thinking about completely rewriting it. The way I structured it is proving to be too hard to implement the last bits into.
-
Embed this notice
Foone🏳️⚧️ (foone@digipres.club)'s status on Thursday, 20-Feb-2025 03:58:38 JST Foone🏳️⚧️
I might even switch to my terrible "implement bochcpu-lib emulation from python to just emulate the original code" idea to avoid having to actually finish this
-
Embed this notice
Foone🏳️⚧️ (foone@digipres.club)'s status on Thursday, 20-Feb-2025 03:58:39 JST Foone🏳️⚧️
anything to avoid having to reverse decompression
-
Embed this notice
Foone🏳️⚧️ (foone@digipres.club)'s status on Thursday, 20-Feb-2025 03:58:40 JST Foone🏳️⚧️
I caught myself thinking "at this rate, maybe I should just write an x86 machine code to python transpiler" and that's really too much
-
Embed this notice
Foone🏳️⚧️ (foone@digipres.club)'s status on Thursday, 20-Feb-2025 03:58:40 JST Foone🏳️⚧️
my brain is constantly coming up with weirder and worse solutions to this "reverse the decompression" problem because I HATE REVERSING DECOMPRESSION and it leads me to constantly try to think of ways to make it easier by not doing it
-
Embed this notice
Foone🏳️⚧️ (foone@digipres.club)'s status on Thursday, 20-Feb-2025 03:58:41 JST Foone🏳️⚧️
if I instead tell it bp_parameter is a word, it just stops decompiling an iVar7 variable at all, and uses bp_parameter itself
-
Embed this notice
Foone🏳️⚧️ (foone@digipres.club)'s status on Thursday, 20-Feb-2025 03:58:42 JST Foone🏳️⚧️
what the fuck does unaff_00000015 mean, ghidra?
an unaffected... 15 constant?
-
Embed this notice
Foone🏳️⚧️ (foone@digipres.club)'s status on Thursday, 20-Feb-2025 03:58:42 JST Foone🏳️⚧️
it was caused because this function takes a parameter in BP. You're not supposed to do that, but you can. There's no x86 cops.
but ghidra for some reason thought it was a undefined, which is a 1-byte type. BP is a 16-bit register. So instead of just using the parameter directly, it decompiled the code as doing this:
iVar7 = CONCAT11(unaff_00000015, bp_parameter)
-
Embed this notice
Foone🏳️⚧️ (foone@digipres.club)'s status on Thursday, 20-Feb-2025 03:58:43 JST Foone🏳️⚧️
okay I have rewritten 90% of the decompression routine I don't understand in python. I just need to do the recursive function, but this is giving me a migraine. So hopefully I can do the remaining 10% later
-
Embed this notice
Foone🏳️⚧️ (foone@digipres.club)'s status on Thursday, 20-Feb-2025 03:58:44 JST Foone🏳️⚧️
trying to get back to compression hacking and I can't find the source. there's some files named "decomp" in my hack folder for this game, but they're all assembly, because of my hack with using the game to extract its own files.
I finally find it: crying.py
I should have guessed! -
Embed this notice
Foone🏳️⚧️ (foone@digipres.club)'s status on Thursday, 20-Feb-2025 03:58:44 JST Foone🏳️⚧️
AHHH HOW DO I SUPPORT HAVING AN ARRAY THAT'S ALSO SOME LOCAL VARIABLES IN PYTHON WITHOUT DRIVING MYSELF MAD?
-
Embed this notice
Foone🏳️⚧️ (foone@digipres.club)'s status on Thursday, 20-Feb-2025 03:58:45 JST Foone🏳️⚧️
32kb ought to be enough for anyone!
-
Embed this notice
Foone🏳️⚧️ (foone@digipres.club)'s status on Thursday, 20-Feb-2025 03:58:46 JST Foone🏳️⚧️
oh goody the recursive function is using tagged pointers.
15 bit pointers... -
Embed this notice
Foone🏳️⚧️ (foone@digipres.club)'s status on Thursday, 20-Feb-2025 03:58:47 JST Foone🏳️⚧️
you of course can't really do this in C
but you can in x86 assembly: pop your own return address into a temp register, then do the cleanup for your parent function, then return. now you return to what your parent function was called from!
-
Embed this notice
Foone🏳️⚧️ (foone@digipres.club)'s status on Thursday, 20-Feb-2025 03:58:48 JST Foone🏳️⚧️
OH GOD I THINK IT USES A DOUBLERETURN
-
Embed this notice
Foone🏳️⚧️ (foone@digipres.club)'s status on Thursday, 20-Feb-2025 03:58:48 JST Foone🏳️⚧️
double return is a secret feature never included in C, where you can do "returnreturn;" and it returns from your parent function
-
Embed this notice
Foone🏳️⚧️ (foone@digipres.club)'s status on Thursday, 20-Feb-2025 03:58:49 JST Foone🏳️⚧️
I don't mean to alarm anyone, but I just realized the decompression algorithm doesn't return. ever.
-
Embed this notice
Foone🏳️⚧️ (foone@digipres.club)'s status on Thursday, 20-Feb-2025 03:58:50 JST Foone🏳️⚧️
WHAT DO YOU MEAN PART OF THE DECOMPRESSION ALGORITHM IS RECURSIVE
-
Embed this notice
Foone🏳️⚧️ (foone@digipres.club)'s status on Thursday, 20-Feb-2025 03:58:50 JST Foone🏳️⚧️
ghidra is asking me philosophical computer science questions, like "can you have two distinct variables with the same data type and stored in the same location?"
either that or it's just completely confused disassembling this function
-
Embed this notice
Foone🏳️⚧️ (foone@digipres.club)'s status on Thursday, 20-Feb-2025 03:58:51 JST Foone🏳️⚧️
oh hey, multi-return! that's not something you can do in C! (I mean, at least not elegantly
someone wrote some assembly.
-
Embed this notice
Foone🏳️⚧️ (foone@digipres.club)'s status on Thursday, 20-Feb-2025 03:58:52 JST Foone🏳️⚧️
yeah the DAT format is similar enough that my bible builder tools can open it
-
Embed this notice
Foone🏳️⚧️ (foone@digipres.club)'s status on Thursday, 20-Feb-2025 03:58:52 JST Foone🏳️⚧️
but the way I cheated at compression isn't gonna work here, not without redoing all that work.
UGH I hate compression algorithms
-
Embed this notice
Foone🏳️⚧️ (foone@digipres.club)'s status on Thursday, 20-Feb-2025 03:58:53 JST Foone🏳️⚧️
1 Corinthians 15:4-6 is really the Hookshot of Captain Bible
-
Embed this notice
Foone🏳️⚧️ (foone@digipres.club)'s status on Thursday, 20-Feb-2025 03:58:54 JST Foone🏳️⚧️
I restored an earlier save (for cheat-finding reasons) continued playing, then realized I had to backtrack because I forgot to pick up the Proverbs 22:15 so now I can't get through this door
-
Embed this notice
Foone🏳️⚧️ (foone@digipres.club)'s status on Thursday, 20-Feb-2025 03:58:55 JST Foone🏳️⚧️
this, btw, is the only game I know of where your boss prays with your character before you go on the mission.
-
Embed this notice
Foone🏳️⚧️ (foone@digipres.club)'s status on Thursday, 20-Feb-2025 03:58:55 JST Foone🏳️⚧️
also I think this game is technically a metroidvania? it's just one where the keys you pick up are bible verses
-
Embed this notice
Foone🏳️⚧️ (foone@digipres.club)'s status on Thursday, 20-Feb-2025 03:58:56 JST Foone🏳️⚧️
hopefully that won't happen this time.
but on an unrelated note I've already figured out where the game stores your X/Y position on the map, it's at 1E06:0 for X, and 1E06:2 for Y
-
Embed this notice
Foone🏳️⚧️ (foone@digipres.club)'s status on Thursday, 20-Feb-2025 03:58:57 JST Foone🏳️⚧️
oh yeah, the thing that nerdsniped me last time: the fact you can only see the map by hitting a button.
With my form of ADHD, that's a pain... so I go "hey why don't I just hack it so I can see my position while I'm walking around the overworld?" and I get bogged down in that until I run out of fixation
-
Embed this notice
Foone🏳️⚧️ (foone@digipres.club)'s status on Thursday, 20-Feb-2025 03:58:58 JST Foone🏳️⚧️
it looks to use a very similar DAT format to Bible Builder, including .ART chunks. I've not looked into the details of the formats yet though, so they may be different.
-
Embed this notice
Foone🏳️⚧️ (foone@digipres.club)'s status on Thursday, 20-Feb-2025 03:58:58 JST Foone🏳️⚧️
Bible Builder was 1992, Captain Bible was 1994.
-
Embed this notice
Foone🏳️⚧️ (foone@digipres.club)'s status on Thursday, 20-Feb-2025 03:58:59 JST Foone🏳️⚧️
Separate thread (from Bible Builder) for hacking on Captain Bible in Dome of Darkness