Skip to content

Instantly share code, notes, and snippets.

@miura1729
Created December 3, 2024 11:30
Show Gist options
  • Save miura1729/46663c19e130533dad691b52eb5b7ede to your computer and use it in GitHub Desktop.
Save miura1729/46663c19e130533dad691b52eb5b7ede to your computer and use it in GitHub Desktop.
#include <stdio.h>
#include <string.h>
int baz(int i, int *j) {
printf("%d %x", i, *j);
return i;
}
void* bar(int i, int *j) {
void *foo = __builtin_apply_args();
void *nnn = malloc(512);
memcpy(nnn, foo, 512);
return nnn;
}
void kkk() {
int b = 123;
int *a = &b;
void *foo = bar(1, a);
__builtin_apply((void (*)())baz, foo, 512);
}
main() {
kkk();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment