Code Monkey home page Code Monkey logo

Comments (7)

paintdream avatar paintdream commented on May 26, 2024 2

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...

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.

from dontstarveluajit.

paintdream avatar paintdream commented on May 26, 2024

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.

from dontstarveluajit.

hyiltiz avatar hyiltiz commented on May 26, 2024

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 x86-64 platform and the compiler is what we need match up against? Here is the result of objdump -all-headers dontstarve_steam: https://termbin.com/orqc though not sure if it contains anything useful.

from dontstarveluajit.

paintdream avatar paintdream commented on May 26, 2024

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 x86-64 platform and the compiler is what we need match up against? Here is the result of objdump -all-headers dontstarve_steam: https://termbin.com/orqc though not sure if it contains anything useful.

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):

  1. Compile linux version of the mod. Startup with linux build world saves much of your time.
  2. Run the game with the mod and it crashes. Capture the log that it prints out.
  3. Fix the function mismatch (marked by "Missing") one by one via assembly code comparison (totally almost 100+ functions starts with lua_ or luaL or luaopen) with:
    a) modify comparsion algorithm.
    b) do some modification on lua51 project so it can generate matching machine code.

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.

from dontstarveluajit.

paintdream avatar paintdream commented on May 26, 2024

objdump

objdump shows that it exports no lua functions. Machine code matching is the only approach.

from dontstarveluajit.

hyiltiz avatar hyiltiz commented on May 26, 2024

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...

from dontstarveluajit.

paintdream avatar paintdream commented on May 26, 2024

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) {
// luaC_checkGC(L); // One call to checkGC was removed
}

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.

from dontstarveluajit.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.