-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tools: Preserve superblock between unpacking and re-packing #19
base: master
Are you sure you want to change the base?
Conversation
I think this should be an explicit option for the paths. Exporting the superblock should be optional as it just complicates it for some users. When the superblock is imported, it should probably choose the cluster-size default. If the user explicitly picks a cluster-size that should probably overwrite the value in the superblock after importing the superblock. |
with open("fat.bin", "w+b") as f: | ||
fat_size = FATX.Filesystem._calc_fat_size(size) | ||
fat_size = FATX.Filesystem._calc_fat_size(size, 512*32) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is 512 the sector size?
Isn't 32 the number of sectors per cluster?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes and yes. I see where you are going here - extract_blocks.py
will hopefully be removed from the project soonish. Its only purpose is to provide easy accessible binary data for debugging purposes that are much much smaller then the original image and also hopefully do not contain copyrighted material. This allows me to ask users of FATX-on-a-snake to run this script and send me over the extracted files, so I can take a look. However, this is good enough for now but it will be unnecessary in the future, hence I want to remove it from the project. In order to do so I still have to gain more confidence that FATX-on-a-snake works good enough and is somewhat error resistant so it will be able to produce text-based, human-readable log output. That log can then be send over for remote debugging and will be guaranteed be free from copyright material.
My reasoning behind picking 512*32
instead of automatically calculating it is, that when this script is run, something is most-likely heavily broken. i.e. if a user attempts to open the xbox hdd from offset 0x00
it won't see the FATX
magic bytes, yet, extract_blocks.py
will happily run and extract the "should-be superblock".
Yes, agreed.
Yes.
Right.
Yeah, thought about that but hesitated. 🤔 Thanks for reaching out! |
Addresses #13
"Wörks" for now. Needs clean up.
I'm not entirely happy with the solution I came up with but I didn't want to think even more about it, already wasted enough time without progress. The change is rather little so it wouldn't hurt that much, if this solution would be replaced/changed later.
What this basically does is:
/dest/.FATX-on-a-snake/superblock.bin
/src/.FATX-on-a-snake/superblock.bin
exists, if so, it uses the given superblock. If not, it will create an empty one as usual.