Skip to content

Instantly share code, notes, and snippets.

@gavz
Forked from aaaddress1/memcpy32.cpp
Created May 3, 2024 22:13
Show Gist options
  • Select an option

  • Save gavz/03356b388e1c18327382f395b92d29a9 to your computer and use it in GitHub Desktop.

Select an option

Save gavz/03356b388e1c18327382f395b92d29a9 to your computer and use it in GitHub Desktop.
memcpy32.cpp
// memcpy 32bit by aaaddress1@chroot.org
#include <stdint.h>
#include <stdio.h>
#include <windows.h>
int main(void) {
int dummy(0x41414242);
char buf[8] = {0};
((void(cdecl *)(DWORD, DWORD, DWORD))"\x8B\x7C\x24\x04\x8B\x74\x24\x08\x8B\x4C\x24\x0C\xF3\xA4\xC3")((size_t)buf, (size_t)&dummy, sizeof(dummy));
puts(buf);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment