YesNoOk
avatar

Reverse engineering Mugen with Ghidra? (Read 19904 times)

Started by Fausto Mugen, May 11, 2020, 04:32:44 am
Share this topic:
Reverse engineering Mugen with Ghidra?
#1  May 11, 2020, 04:32:44 am
  • **
  • I got tired of waiting for someone to do it for me
    • Argentina

What is Ghidra?: https://en.wikipedia.org/wiki/Ghidra

A few days ago, someone in the Spanish forum suggested using Ghidra to get Mugen's source code by reverse engineering.

I don't know if it is entirely possible, but today I did some quick tests and apparently some results are obtained.

Spoiler, click to toggle visibilty

Has anyone else tried to use this or a similar program with Mugen?
Re: Reverse engineering Mugen with Ghidra?
#2  May 14, 2020, 12:03:28 pm
  • ****
    • China
    • http://vans.trinitymugen.net/
Yes, this has been done before with Winmugen. Perhaps this Ghidra program offers better results, but as you can see (other than the strings) every single function is labeled with a generic name which offers zero context as to their purpose or use.

You would need a person which is not only completely well-versed in CNS, but also patient enough to painstakingly go through every function and try to interpret its purpose. A person with such skills (and free time) would probably choose to tackle other projects instead.

For elementary uses, you might be able to to do easy things, like modifying game-modes to be simul-only or teams-only or very silly patches. Perhaps a more useful proof of concept would be to patch the hitdef code to accept integer numbers as attributes instead of just strings, this way you would be able to use triggers such as "cond" to modify their behavior.
Re: Reverse engineering Mugen with Ghidra?
#3  November 24, 2020, 04:25:52 am
    • Venezuela
Yes, this has been done before with Winmugen. Perhaps this Ghidra program offers better results, but as you can see (other than the strings) every single function is labeled with a generic name which offers zero context as to their purpose or use.

You would need a person which is not only completely well-versed in CNS, but also patient enough to painstakingly go through every function and try to interpret its purpose. A person with such skills (and free time) would probably choose to tackle other projects instead.

For elementary uses, you might be able to to do easy things, like modifying game-modes to be simul-only or teams-only or very silly patches. Perhaps a more useful proof of concept would be to patch the hitdef code to accept integer numbers as attributes instead of just strings, this way you would be able to use triggers such as "cond" to modify their behavior.

Is it necessary to have knowledge of a specific programming language or just have knowledge of programming in mugen?

Re: Reverse engineering Mugen with Ghidra?
#4  November 24, 2020, 04:49:52 am
  • ****
    • China
    • http://vans.trinitymugen.net/
MUGEN uses its proprietary scripting language. The Ghidra provided "source" is C++ I believe.

Either way, it is a complete waste of time for a professional. It is known that the MUGEN source code is already bad, but looking at it with zero labels makes it a nightmare to navigate. Efforts are better spent programming for next-gen engines like Blugen or Ikemen GO.