-
Notifications
You must be signed in to change notification settings - Fork 18
Add support for macOS? #11
Comments
Simple recompilation may not work, since machine code matching is compiler dependent and must be reworked for different platforms. I'm happy to see someone else could do it... The key reason for lack of macOS version is that I have no mac devices. Also, as you know, they are so expensive for the people lived in China that nearly all players here are playing game on Windows. |
Yes, I can see most of your use base do not require macOS support, but Apple products are quite prevalent in some other countries. I am not well versed enough to do manual machine code matching myself but if you are willing to write up a detailed instructions for the steps required, I'd give it a try. If it is any useful info., I am running Debian testing in an old MacBook Pro, and it works. So |
This is a hard and boring work. But you may try it with following steps (maybe interesting at the first time if you have never done it before):
As you know, the 3.b) step requires various experiences on compiler, you must use the same compiler as Klei and find out the modifications by Klei via disassembled machine code. After reimplementing theses changes to lua51 project, you can check the newly generated machine code by running game again. If it's matched, then move to next missing function and repeat the instructions. |
objdump shows that it exports no lua functions. Machine code matching is the only approach. |
Is it possible to automate some part of step 3, maybe in a loop, run the game, grep first missing function, prompt to select from a few matching rules and append that rule to a file. Once done, we can then refine that file into the lua51 project and build it... I have no idea if what I am saying here is even feasible as I've never done stuff like that... |
Unfortunetly it's impossible to select serveral candidates automatically. Once matching failed, it turns out that klei modified some functions, for example: int _cdecl lua_XXXXX(lua_State* L) { It would generate totally different machine code at first serveral bytes and invalidates all candidates you find out... When I was developing windows version, I searched them by some reverse engineering techniques (such as tracing back from resolved ones) and finally get them all resolved. |
In fact I'm a not experienced in reverse engineering so I've no better approaches but do it with brute force. My interest is in rendering optimization but it cannot be done due to lack of source. |
Since it works in Linux Desktop, maybe getting it to work on macOS probably only needs a recompilation with clang (if the original binary was built with clang for macOS) and maybe some more minor tweaks of some constants?
The text was updated successfully, but these errors were encountered: