Skip to content

Conversation

@Sorachi00
Copy link

Dialogue hook works normally:
nie_GdsZyZyIHz

Other texts hook is an optional toggle with F1 because the game generates a lot of text in many different ways

Only dialogue box is hooked
Refactor dialogue handling to avoid duplicate text processing and improve text cleaning.
An option was added to display text that is not part of the dialogues.

I implemented it as an option that can be toggled because it generates a lot of text constantly.
dialogue: true, // Always ON
extra: false
};

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Those hooks will break after a single update and people will complain. You should make patterns so that it works when the game update

https://frida.re/docs/javascript-api/#memory:~:text=Memory.scan(address%2C%20size%2C%20pattern%2C%20callbacks)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, right. I started with AoB and totally forgot about that when I tried to get the extra text working. I will fix it. Thanks

Comment on lines +61 to +69
setInterval(() => {
if (GetAsyncKeyState(0x70) & 0x8000) {
if (!keysPressed.F1) {
keysPressed.F1 = true;
hookStates.extra = !hookStates.extra;
console.log(`[F1] extra: ${hookStates.extra ? 'ON' : 'OFF'}`);
}
} else keysPressed.F1 = false;
}, 100);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd suggest creating an option, maybe with libUI.js, so people can decide whether to have their F1 key have extra functionality or not, since this isn't expected behavior for the average script.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did it that way because I was not able to find separated hooks for every textbox, and that specific hook shows almost all the non-dialogue text. But when there is no "extra" text on screen like the menu or tutorial it start puking random strings from, I guess, near NPCs. Any advice?

Comment on lines 13 to 25
const handler = (msg) => {
try {
if (typeof trans !== 'undefined' && trans && typeof trans.send === 'function') {
trans.send(msg, -100);
} else if (typeof send === 'function') {
send(msg);
} else {
console.log(msg);
}
} catch (e) {
console.log(msg);
}
};
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the purpose of all these checks for trans and send?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, ignore that. Some code I left behind when asked chatgpt what was the use of that handler. Chatgpt really likes adding checks. I'm going to fix it next commit, is const handler = trans.send(s => s, -100); enough right?

@Sorachi00
Copy link
Author

    { name: 'dialogue', pattern: "48 8B CB E8 ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? 48 8B 06 48 8B CE", hookOffset: 0, register: 'r9', category: 'dialogue'},
    { name: 'extra', pattern: "48 8B CB E8 6B 9D 4D FF", hookOffset: 0, register: 'r8', category: 'extra' },

I changed the addresses by patterns but I'm not really confident about the second one. That function is strange.

And I just realized there was a major update recently, so once the download finishes, I’ll confirm whether the patterns are stable.

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.

3 participants