CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
rapid7

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.

GitHub Repository: rapid7/metasploit-framework
Path: blob/master/external/source/exploits/CVE-2016-4655/arch.h
Views: 11780
1
/*
2
* arch.h - Code to deal with different architectures.
3
* Taken from kern-utils
4
*
5
* Copyright (c) 2014 Samuel Groß
6
* Copyright (c) 2016-2017 Siguza
7
*/
8
9
#ifndef ARCH_H
10
#define ARCH_H
11
12
#include <mach-o/loader.h> // mach_header, mach_header_64, segment_command, segment_command_64
13
#include <Foundation/Foundation.h> // NSLog
14
15
#define IMAGE_OFFSET 0x2000
16
#define MACH_TYPE CPU_TYPE_ARM64
17
#define ADDR "%016lx"
18
#define SIZE "%lu"
19
#define MACH_HEADER_MAGIC MH_MAGIC_64
20
#define MACH_LC_SEGMENT LC_SEGMENT_64
21
#define MACH_LC_SEGMENT_NAME "LC_SEGMENT_64"
22
#define KERNEL_SPACE 0x8000000000000000
23
typedef struct mach_header_64 mach_hdr_t;
24
typedef struct segment_command_64 mach_seg_t;
25
typedef struct section_64 mach_sec_t;
26
typedef struct load_command mach_lc_t;
27
28
#define LOG(str, args...) \
29
do \
30
{ \
31
NSLog(@"" str "\n", ##args); \
32
} while(0)
33
34
#endif
35
36