1

My choice of words in the title might be poor, I apologize: english is not my primary language and I have no idea how to word it better.

I have a game executable to which I applied several changes, changes can be small replacements of integer values here and there, but also jumps to code caves, as well as adding a new section where I could put longer pieces of code.

It is essentially a mod, and I'd like to distribute it without worrying about legality; so in short I'd like to avoid distributing the whole executable and just put all of my changes inside something like a DLL. I have no experience in writing a DLL, but what I understand is that I should be able to compile functions inside the DLL then somehow call them from the executable, and my hope would be that I don't need to modify the executable itself. Can someone confirm this?

So my understanding is that for every change I made in my mod, I should copy the whole functions that contains the changes (available to me as assembly only), then I probably should compile them in the DLL.

Would that be a good way to go about it?

1
  • Do you need to apply the changes dynamically? Many old school game patches (and cracks) used binary diff files. These can be generated from the original EXE and your patched version. The output contains only the byte differences, so no concerns about distributing a copyrighted file.
    – David
    Commented Oct 6, 2020 at 22:05

1 Answer 1

1

I have no experience in writing a DLL, but what I understand is that I should be able to compile functions inside the DLL then somehow call them from the executable, and my hope would be that I don't need to modify the executable itself. Can someone confirm this?

This is correct. Check out https://docs.microsoft.com/en-us/windows/win32/dlls/dllmain, common thing to do is making a new thread (CreateThread) in the process on DLL_PROCESS_ATTACH, or hook a game function.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.