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

Improve .exe matching accuracy #303

Merged
merged 8 commits into from
Nov 4, 2024

Conversation

roblabla
Copy link
Member

@roblabla roblabla commented Nov 3, 2024

This PR:

  • Reorders the object files to roughly match the order in the original binary
  • Adds /opt:ref to delete unused functions, which is necessary as the compiler auto-generates some unused symbols otherwise.
  • Implements Supervisor::DeletedCallback, to avoid some functions from getting removed by /opt:ref
  • Cleans up unused functions in FileSystem.hpp
  • Reorders functions in AnmVm.obj and Stage.obj.

We want the linker to eliminate unused symbols, as otherwise we'll get
some extra functions getting included in our binary. Normally, /opt:ref
is enabled by default. However, since we add the /DEBUG flag to get a
PDB, /opt:noref actually gets enabled by default, so we need to override
this.
Those two functions aren't actually th06 functions, but the CRT _chdir
and _mkdir functions.
@roblabla roblabla force-pushed the perfect-bin-match-asciimanager branch from a075d52 to d6cfb3f Compare November 4, 2024 22:47
@roblabla roblabla merged commit 970e5a8 into happyhavoc:master Nov 4, 2024
6 checks passed
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.

1 participant