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/mach-o.h
Views: 11779
1
/*
2
* mach-o.h - Code that deals with the Mach-O file format
3
* Taken from kern-utils
4
*
5
* Copyright (c) 2012 comex
6
* Copyright (c) 2016 Siguza
7
*/
8
9
#ifndef MACH_O_H
10
#define MACH_O_H
11
12
#include <mach-o/loader.h> // load_command
13
14
/*
15
* Iterate over all load commands in a Mach-O header
16
*/
17
#define CMD_ITERATE(hdr, cmd) \
18
for(struct load_command *cmd = (struct load_command *) ((hdr) + 1), \
19
*end = (struct load_command *) ((char *) cmd + (hdr)->sizeofcmds); \
20
cmd < end; \
21
cmd = (struct load_command *) ((char *) cmd + cmd->cmdsize))
22
23
#endif
24
25