-
Notifications
You must be signed in to change notification settings - Fork 238
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
Add editor for the EXTN chunk #4
Comments
Thanks! That will definitely be useful. According to https://pcy.ulyssis.be/undertale/unpacking-corrected, Altar.NET also has a vague implementation of that structure, but I never looked for it. If you are looking for something to analyze, do you happen to know what EMBI is? It seems to have been introduced in GMS2 and it was empty when I checked iirc. My guess from the name is EmbeddedItem, although that doesn't really explain what it could be. |
So I did some more reading of decompiled and obfuscated compiler code to attempt to figure out what EMBI is... It appears to stand for "embedded images", and has something to do with some strange texture page (the texture page is created at the beginning of compilation, and seems to be empty?). No matter what I did in a test project, I literally could not get EMBI to have any real content. Nevertheless, here's what I found based off of the code:
It doesn't seem to be commonly used if at all... I saw some strings that said things like "front", "back", and "res" but I still have no idea. My initial guess was that it could contain splash images, but that exports as a standalone PNG file. Unless it's different on other platforms, or there are other kinds of images I'm neglecting. (Edit: I just wanted to make it clear that the array is not of type List<T>; it doesn't use pointers) |
Just to add to this, despite the fact that Undertale Switch used some other previously unused data, this chunk appears to be unused. There's the name and then 16 bytes, none of which appear to have any significant value |
Tested 22ef7c1 and it seems to work on an example project I made with an extension with a DLL and GML placeholder, along with some various functions to test enumerators and lists (the data was all correct in the debugger). Re-exporting it seemed to somehow make the chunk smaller by 16 bytes(?) but it seemed to still have the correct data. |
If you are testing on the latest versions of GMS1.4, the chunk got smaller because the paddings have changed and I didn't implement this yet because I don't know which version exactly it changed on. |
Oh, okay, that makes a lot more sense. But that was testing with GMS2 actually (probably the same reason though). Maybe I should test with 1.4, though I only have the latest one and I bet it's the same. (Edit: I disabled the ROOM chunk serialization so that I could re-export it.) |
Yeah, GMS2 has that padding change too. The latest version of GMS1.4 has that too. I know that 1.4.1773 definitely doesn't. |
And in case they do ever go down, they are now here too: https://archive.org/details/GMStudio1.4.x 1.4.1773 and 1.4.9999 are only 2 versions apart, so I tested both of them and it turns out 9999 is the only one with the new padding, going to implement it now |
Paddings implemented in 8d54bc2 |
I wanted to reopen this but then I noticed I never closed it :P
(no, this is not the instructions, the instructions got compiled to a standard script instead) |
Just tried replacing this data with zeroes, the extension still works fine, the init function got called as it should. #define __webextension_init
__webextension_set_device(window_device()) |
Interesting... Possibly something changed between 1.4 and 2. Could that be some strange padding? Not really sure, I may look into this later if I find the time. |
So I actually managed to figure out what that data at the end was. Basically at the end of the EXTN chunk, for each extension, 16 bytes of data are appended. They seem to have something to do with some "product ID" on the extensions, being some kind of unique identifier? Anyway I added support for this in the last commit in #30. |
About EMBI |
By the way, just fixed a pretty important bug in #76 for this. |
The only remaining issue is the lack of a UI? Can I get a confirmation? |
My mistake, I did not mean to close this. Example gave with extensions: Fromto VM |
An extension editor in the GUI now exists, is this issue resolved? |
Closing due to the implementation of an extension editor into UndertaleModTool |
With some analysis of the latest GameMaker compiler and some testing of my own, I managed to figure out exactly how the EXTN chunk is formatted. It's actually pretty simple. I may do some more of this for another chunk later on.
Here are the notes I took down, sorry if it's a little messy (indentation should be pretty obvious?):
So, anyway, I guess this issue could be used to track the implementation of the EXTN chunk in the tool/lib, unless this isn't meant to be where this is done.
The text was updated successfully, but these errors were encountered: