Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Please add Cheat Engine like code cave management. #1

Open
Spamm00r opened this issue Sep 12, 2023 · 6 comments
Open

Please add Cheat Engine like code cave management. #1

Spamm00r opened this issue Sep 12, 2023 · 6 comments

Comments

@Spamm00r
Copy link

Please see the discussion here:

x64dbg/x64dbg#729

Adding Cheat Engine like code cave management would make this plugin perfect. I'm imagining a option to specify the address range of the codecave and let the plugin write the new code in this codecave automatically. This will solve the problem of tracking the addresses and code inside the code cave which makes working with code caves at some point complex and which is a key advantage of Cheat Engine over x64dbg.

@m417z
Copy link
Owner

m417z commented Sep 12, 2023

I'm not familiar with Cheat Engine's code cave management, and I'm not sure I understand the feature request. You can allocate code at address X and write code like:

<X>
  ; ...
  cmp eax, ecx
  jne @label1
  ; ...
@label1:
  ; ...

Then, if you need to restart the process, you can allocate code at a new address, Y, then change X to Y in the code, and assemble the code again. It might be nice to have the allocation and the replacement automated, but as far as I understand that's not what you're suggesting.

@cexer
Copy link

cexer commented Oct 31, 2023

I'm not familiar with Cheat Engine's code cave management, and I'm not sure I understand the feature request. You can allocate code at address X and write code like:

<X>
  ; ...
  cmp eax, ecx
  jne @label1
  ; ...
@label1:
  ; ...

Then, if you need to restart the process, you can allocate code at a new address, Y, then change X to Y in the code, and assemble the code again. It might be nice to have the allocation and the replacement automated, but as far as I understand that's not what you're suggesting.

It would be greate to have the allocation and the replacement automated, please add this feature. I can't find a easy way to find/allocate unused memory space to write code at, It seems these's no tool for this, so have to manual search in code section.

@kkqy

This comment was marked as off-topic.

@m417z

This comment was marked as off-topic.

@Spamm00r
Copy link
Author

Spamm00r commented Dec 2, 2023

I'm not familiar with Cheat Engine's code cave management, and I'm not sure I understand the feature request. You can allocate code at address X and write code like:

<X>
  ; ...
  cmp eax, ecx
  jne @label1
  ; ...
@label1:
  ; ...

Then, if you need to restart the process, you can allocate code at a new address, Y, then change X to Y in the code, and assemble the code again. It might be nice to have the allocation and the replacement automated, but as far as I understand that's not what you're suggesting.

Here is an example of how to use Cheat Engine's code injection: https://youtu.be/Qfts3aGaBk4?t=235

Having the allocation and the replacement automated is exactly what I'm looking for.

I know that it is difficult in a Binary file to find a large enough code cave as it is in memory as CE does, where you can allocate sufficient memory at will.

That's why I suggest to define the code cave section yourself, by for example adding sufficient bytes at the end of the file. All I want from the suggested plugin is to take care where exactly the new code is written at in the newly created code cave. Because after some time It gets difficult to keep track of the different code sections that you added. Especially when you later add or modify the code and you need more bytes for that code than you initially thought would be necessary and you reach the next section of code and would like to move the entire section further down below to make space for the additional code. If you that manually, you have to go back and fix all the jump references to point to that new code address, otherwise they will be pointing to the old addresses where you have now put new code. I need this plugin to take care fo this itself. CE's code cave management solves this problem.

@kkqy

This comment was marked as off-topic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants