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

thcrap_tsa: Support translation of hardcoded strings #15

Closed
nmlgc opened this issue Jul 6, 2013 · 1 comment
Closed

thcrap_tsa: Support translation of hardcoded strings #15

nmlgc opened this issue Jul 6, 2013 · 1 comment

Comments

@nmlgc
Copy link
Contributor

nmlgc commented Jul 6, 2013

Hardcoded strings

Description

"Hardcoded strings" here means "immutable strings stored at a constant address in memory". This allows us to do a lookup solely based on the address.

Prerequisites

None. Also needs to work with #3, though.

Implementation

This consists of four parts:

  1. Basic lookup function based on a string's address
  2. Hooks for TextOut, MessageBox and possibly other Win32 API functions calling the lookup function
  3. Breakpoint to call the lookup function (unnecessary; hardcoded strings are either fully constant (which means our hooks take care of them anyway) or format strings (see below).)
  4. Custom sprintf handler

No. 4 is necessary because some of these hardcoded strings are sprintf format strings, and we shouldn't trust on the game's own buffers being large enough.

@nmlgc
Copy link
Contributor Author

nmlgc commented Jul 14, 2013

Marked as a bug because the "buffer overflow fixes" in base_tsa actually remove a sprintf call, breaking a lot of result screens in the process:

Here's some breakage in the "overall" result screen.

nmlgc pushed a commit that referenced this issue Jul 14, 2013
Currently without owner support, as that requires #15 to be visible anyway.
Closes #11.
@nmlgc nmlgc closed this as completed in 06089df Aug 8, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant