Skip to content

Instantly share code, notes, and snippets.

@vesim987
Last active August 28, 2022 22:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vesim987/115f7a46c3f851673d7cb2db7b0abb39 to your computer and use it in GitHub Desktop.
Save vesim987/115f7a46c3f851673d7cb2db7b0abb39 to your computer and use it in GitHub Desktop.
template<class... Y, class X>
void (*y(X z, unsigned int b)) (Y...) {
for(char* a = reinterpret_cast<char*>(z); a < reinterpret_cast<char*>(z) + 256; a++) if((*reinterpret_cast<unsigned int*>(a) & 4294967295) == b) return reinterpret_cast<void(*)(Y...)>(a);
return {};
}
int main() {
y<int, const char*, int, void(*)()>(&main, 84922879)(1, "Hello World!\n", 13, y<>(&main, 3287845192));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment