Giter Site home page Giter Site logo

Comments (3)

Henne avatar Henne commented on June 25, 2024

Hi xOr,

this process has been done manually by me, since I know C and x86 assembly very well.
The code, I have translated, was not optimized by the compiler, so it was a straight forward process.
I also have the compiler, Borland C++ 3.1, which has been used to compile that binary.
So I did the following for each function separately of the original binary:

  1. analyze the code of the function
  2. write that code in C
  3. compile the C code again with Borland C++ 3.1
  4. compare the binary code of the rewritten function with the binary code of the original
  5. When they differ goto 1. When they are the same DONE.

There are no DOSBox pseudo instructions, a rewritten function is executed natively on the host processor.

I've hooked into the two call instructions of the software DOSBox-CPU.
If a function I have rewritten is called:

  1. I get the parameters from the stack
  2. call my rewritten function with the parameters
  3. place the return value of the function into register AX
  4. skip the emulation of that function call

Otherwise DOSBox emulates that function call.

But I think, that will not help you for masm2c, since you are doing something general with that.
I had only a special case.

I hope to find time next month to reactivate Bright-Eyes,
and I'll try out masm2c on one function which I did not managed to translate correctly.

Feel free to ask, if you want more details.

from bright-eyes.

xor2003 avatar xor2003 commented on June 25, 2024

Thanks mostly clear and interesting. I will try to prepare Borland C++ Dos as target of my translator.

from bright-eyes.

xor2003 avatar xor2003 commented on June 25, 2024

Testing resulting code on Dos might be easier before porting sound, graphics, etc to SDL.
The problem is reversed code is a code modification and no tests available.
Good solution for it is binary equality as in your case.

from bright-eyes.

Related Issues (19)

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.