Skip to content

[Dev Feature] Method signature scanning to handle InvalidNativeSignature exceptions.#446

Closed
do-gamer wants to merge 1 commit intodarkbot-reloaded:masterfrom
do-gamer:scan_invalid_signature
Closed

[Dev Feature] Method signature scanning to handle InvalidNativeSignature exceptions.#446
do-gamer wants to merge 1 commit intodarkbot-reloaded:masterfrom
do-gamer:scan_invalid_signature

Conversation

@do-gamer
Copy link
Contributor

Example of how it works (for the last fixed AD Offer issue):

 com.github.manolo8.darkbot.core.api.InvalidNativeSignature: Invalid flash method signature! 23(2626)1016321600
 	at com.github.manolo8.darkbot.core.api.Utils$SignatureChecker.checkSignature(Utils.java:96)
 	at com.github.manolo8.darkbot.core.api.adapters.TanosAdapter$DirectInteractionManager.callMethodChecked(TanosAdapter.java:84)
 	at com.github.manolo8.darkbot.core.api.GameAPIImpl.callMethodChecked(GameAPIImpl.java:532)
 	at com.github.manolo8.darkbot.core.objects.gui.TargetedOfferGui.close(TargetedOfferGui.java:41)
 	at com.github.manolo8.darkbot.core.objects.Gui.show(Gui.java:126)
 	at com.github.manolo8.darkbot.core.objects.gui.TargetedOfferGui.show(TargetedOfferGui.java:34)
 	at com.github.manolo8.darkbot.core.manager.GuiManager.tick(GuiManager.java:214)
 	at com.github.manolo8.darkbot.Main.validTick(Main.java:270)
 	at com.github.manolo8.darkbot.Main.tick(Main.java:233)
 	at com.github.manolo8.darkbot.Main.run(Main.java:204)
 [SignatureScan] match at index 275: 23(2626)1016321600
 [SignatureScan] match at index 283: 23(2626)1016321600

We can simply take a new index from the log
[SignatureScan] match at index 283: 23(2626)1016321600
and quickly fix the problem.

Also, to not always keep it enabled, there may be settings in the bot to enable it only if necessary.

@Pablete1234
Copy link
Member

I believe this has been the first time a method simply moved without its signature having changed at all, often its not as easy and you gotta doublecheck manually. We could also simply call methods without checking the signature, but its a security feature that it avoids calling if it changes, and a developer needs to look into it.
If anything what would help is getting tanos api to have a similar method to kekka players' that prints the methods and signatures of an object so that the work isn't restricted to windows.

@do-gamer
Copy link
Contributor Author

Thank you for clarifying. Then, this code can only be used for my own purposes in my fork in a separate branch.

I will take a look at how to print the methods in Tanos API, it would be helpful.

@do-gamer do-gamer closed this Feb 13, 2026
@do-gamer
Copy link
Contributor Author

@Pablete1234 I have explored the Tanos API library a bit and found that we already have the logs to detect the correct signature.
Debug log stored in /tmp/do_output.txt

It prints like this:

utils::log("Signature: {} == {}\n", signature, flashSignature);

Result in the log

Signature: 23(toggleVisibility)(2626?)1116321600 == 23(toggleVisibility)(2626?)1116321600
Signature: 23(2626)1016321600 == 23(2626)1016321600
Signature: 23(26)008431800 == 23(26)008431800
Signature: 26(267726?2?)42407911700 == 26(267726?2?)42407911700

But first, we need to scan the correct index, as mentioned in the pull request. If it doesn't work, we can matching the signature from /tmp/do_output.txt

Thank you for pointing my thoughts in the right direction.

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

Successfully merging this pull request may close these issues.

2 participants