Skip to content

Instantly share code, notes, and snippets.

@josephcsible
Created June 18, 2022 18:41
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 josephcsible/6cee041b524ca89d4d4671dfc04cab22 to your computer and use it in GitHub Desktop.
Save josephcsible/6cee041b524ca89d4d4671dfc04cab22 to your computer and use it in GitHub Desktop.
global memcpy64, _memcpy64
section .text
memcpy64:
_memcpy64:
push edi
push esi
call 0x33:.heavensgate
pop esi
pop edi
ret
BITS 64
.heavensgate:
mov rdi, [esp + 20]
mov rsi, [esp + 28]
mov rcx, [esp + 36]
mov eax, edi
mov rdx, rdi
shr rdx, 32
rep movsb
retf
#include <stdint.h>
#ifdef __cplusplus
extern "C"
#endif
uint64_t memcpy64(uint64_t dest, uint64_t src, uint64_t n);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment