Skip to content
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

Some questions about the asmodean tools #1

Open
shangjiaxuan opened this issue Jul 12, 2018 · 4 comments
Open

Some questions about the asmodean tools #1

shangjiaxuan opened this issue Jul 12, 2018 · 4 comments
Labels
question Further information is requested

Comments

@shangjiaxuan
Copy link

I'm sorry to post a issue concerning others' code here, but it seems that this is the only place I found that uses asmodean's code.

The problem is: I cannot find any header files the source code references, and I couldn't guess how certain functions work without them, especially functions in the "as::" namespace.

The question is: How did you work around it? I would really need some help in understanding the code...

Thanks SO much for looking at this off-topic issue anyway.

@trigger-segfault trigger-segfault added the question Further information is requested label Jul 12, 2018
@trigger-segfault
Copy link
Owner

trigger-segfault commented Jul 12, 2018

Good question, and I'm happy to answer with what information I have. I of course encountered the same issues. The as-util.h file included with the exkifint download was in fact not the header file that was actually used to compile exkifint.cpp and hgx2bmp.cpp.

> this is the only place I found that uses asmodean's code - This is probably pretty accurate. Any GitHub page I found that referenced Asmodean's code only included the source files that were packaged with the binaries and instead relied on the binaries to do the actual work.

It took quite a bit of searching to find most of the missing header/c/cpp file combos but here's where I found the code that I ended up using. A lot of results I found were similar but didn't seem to function the exact same way so I tried to get closer matches. Now I'll be honest, I'm pretty average at web searching, but in this case I fared pretty well, although it took a lot of keyword guessing and time.

As for as-util.h, if I recall correctly, it wasn't too much of an issue because most of the functionality wasn't too hard to guess and easy to implement on my own.

write_bmp has slightly different functionality from Asmodean Util B but I'll explain what each extra parameter does.

  • align Presumably padding the strides (a row of pixels) to by a multiple of 4 bytes.
  • flip Flip the image vertically (This is important because some archived image formats are always stored upside-down)

I've included the solution I used as I worked my way through the code. Do note that some functionality was changed/removed/ignored/forced/or outright improved in order to meet my goals quicker: ExkifintWork.zip (VS2017)

If you have any more questions about the code (no matter how nitpicky), then feel free to throw them my way in this issue thread. If you have questions about other Asmodean extractors then I may be able to help out with that too, I'm definitely not happy at the lack of open source, especially when so many of Asmodean's programs would benefit from community improvement. (For example, I fixed an issue with the hgx2bmp animations where it would miss some of the files because the `.hgx. format was a little more complex than anticipated. (I never figured out how it worked, I just hacked my way to the next image section)

@shangjiaxuan
Copy link
Author

Thanks SO much for helping out! I'm really not much of a pro in programming (my major is in physics...), but I'm sure I will put the resource to good use,.

I'm still learning the tricks for now(eg. I've just learned a bit about the use of "#pragma pack(1)" preprocessor), but I think I will try to do my part as much as I can.

Thanks again for explaining the functions, the sources to look for, and the offer to help. It means a lot to me.

PS: It turns out that the "Asmodean Util B" is from a chinese programming forum "CSDN", and it seems that visiting it from within China doesn't come up with a lot of adds. (May be a side effect of the great firewall of China...)

@monyarm
Copy link

monyarm commented Nov 29, 2021

Sorry for necroing, but i've been wondering how you have your code MIT licensed, when asmodean didn't license his code? I'm facing an issue myself, since I want to include some of his code in my GPLv2 licensed project.

@trigger-segfault
Copy link
Owner

@monyarm to be honest, I didn't think too much about it back then. I've seen a ton of projects on GitHub including asmodean tools/source code, so I wouldn't worry too much over it.

Maybe leave a text file in the folder containing their code that explains its separate from the rest of the project/license (or however it would be best to word that). But I'm not an expert with licensing, so I'm not sure what the safest "correct" choice would be (if there even is a correct way to include unlicensed code).


If you want to be really cautious, then you could reference anything you want from my CatSystem2 C# library or Sprite Viewer tool or Python3 library which have replacements for asmodean code (though it's not in C/C++ and they're both a bit of a mess). Also note the C# library doesn't account for older .int archive formats with 32-byte names.

There's also GARbro which has replacements for the .int archive code, though there are still some unmerged issues with HG-3/HG-2 image support.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants