TerryCavanagh / VVVVVV

The source code to VVVVVV! http://thelettervsixtim.es/
Other
7k stars 559 forks source link

Add magic string to the start of the `game` global #931

Closed iliana closed 1 year ago

iliana commented 1 year ago

Changes:

The -addresses command-line option added in 64be99d4 helps autosplitters on platforms where VVVVVV is not built as a position-independent executable. macOS has made it increasingly difficult, or impossible, to build binaries without PIE.

Adding an obvious string to search for will help tools that need to deal with versions of VVVVVV built with PIE. The bytestring to search for is [vVvVvV]game, followed by four null bytes (to avoid finding it in the program code section). This identifies the beginning of the game object; addresses to other objects can be figured out by relative offsets printed by -addresses, since ASLR can only change where the globals begin.

Partially f i x e s #928; it may still be advisable to figure out how to explicitly disable PIE on Windows/Linux.

Legal Stuff:

By submitting this pull request, I confirm that...

InfoTeddy commented 1 year ago

I'll merge if you reword the description so it doesn't automatically close #928.

iliana commented 1 year ago

Done (although I think GitHub lets you clear that over on the sidebar on the PR, too!)

InfoTeddy commented 1 year ago

Ah, I didn't know that. I'll merge when CI passes.