diff options
| author | spv420 <unomilliono@gmail.com> | 2022-05-31 19:51:14 -0400 |
|---|---|---|
| committer | spv420 <unomilliono@gmail.com> | 2022-05-31 19:51:14 -0400 |
| commit | b040db45dfc9ef9a902e48bc2718a94cd099f505 (patch) | |
| tree | 7b361fbd03f866b225473a54f837ec388f9fa4fb /tools/defines.c | |
| parent | fe765137cd79a671dc3e6932bb867ef333611e73 (diff) | |
I live in a constant state of fear and misery
Do you miss me anymore?
And I don't even notice
When it hurts anymore
Anymore
Anymore
Anymore
Diffstat (limited to 'tools/defines.c')
| -rw-r--r-- | tools/defines.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/tools/defines.c b/tools/defines.c new file mode 100644 index 0000000..4c499b3 --- /dev/null +++ b/tools/defines.c @@ -0,0 +1,28 @@ +#include <stdint.h> +#include <stdio.h> +#include <dlfcn.h> +//#include <CoreFoundation/CoreFoundation.h> + +uintptr_t get_dyld_shc_slide(void) { + return _dyld_get_image_vmaddr_slide(1); +} + +uint32_t dlsym_cf(char* s) { + return dlsym(dlopen("/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation", RTLD_NOW), s) - get_dyld_shc_slide(); +} + +void fuck(char* s) { + printf("var %s_addr = 0x%08x;\n", s, dlsym_cf(s)); +} + +int main(int argc, char* argv[]) { + printf("#define PRINTF_ADDR 0x%x\n", dlsym(RTLD_DEFAULT, "printf")); +// printf("%x %x %x %x %x %x %x %x\n", RTLD_NOW, dlsym_cf("kCFTypeDictionaryKeyCallBacks"), 0x41414141);//, &kCFTypeDictionaryValueCallBacks, kCFNumberSInt32Type); + fuck("CFDictionaryCreateMutable"); + fuck("kCFTypeDictionaryKeyCallBacks"); + fuck("kCFTypeDictionaryValueCallBacks"); +// fuck("kCFNumberSInt32Type"); + fuck("CFDictionarySetValue"); + fuck("CFNumberCreate"); + return 0; +} |
