#ifndef _MACH_O_GETSECT_H_
#define _MACH_O_GETSECT_H_
#include <stdint.h>
#include <mach-o/loader.h>
#ifdef __cplusplus
extern "C" {
#endif
extern char *getsectdata(
const char *segname,
const char *sectname,
unsigned long *size);
extern char *getsectdatafromFramework(
const char *FrameworkName,
const char *segname,
const char *sectname,
unsigned long *size);
extern unsigned long get_end(void);
extern unsigned long get_etext(void);
extern unsigned long get_edata(void);
#ifndef __LP64__
extern const struct section *getsectbyname(
const char *segname,
const char *sectname);
extern uint8_t *getsectiondata(
const struct mach_header *mhp,
const char *segname,
const char *sectname,
unsigned long *size);
extern const struct segment_command *getsegbyname(
const char *segname);
extern uint8_t *getsegmentdata(
const struct mach_header *mhp,
const char *segname,
unsigned long *size);
#else
extern const struct section_64 *getsectbyname(
const char *segname,
const char *sectname);
extern uint8_t *getsectiondata(
const struct mach_header_64 *mhp,
const char *segname,
const char *sectname,
unsigned long *size);
extern const struct segment_command_64 *getsegbyname(
const char *segname);
extern uint8_t *getsegmentdata(
const struct mach_header_64 *mhp,
const char *segname,
unsigned long *size);
#endif
extern char *getsectdatafromheader(
const struct mach_header *mhp,
const char *segname,
const char *sectname,
uint32_t *size);
extern const struct section *getsectbynamefromheader(
const struct mach_header *mhp,
const char *segname,
const char *sectname);
extern const struct section *getsectbynamefromheaderwithswap(
struct mach_header *mhp,
const char *segname,
const char *sectname,
int fSwap);
extern char *getsectdatafromheader_64(
const struct mach_header_64 *mhp,
const char *segname,
const char *sectname,
uint64_t *size);
extern const struct section_64 *getsectbynamefromheader_64(
const struct mach_header_64 *mhp,
const char *segname,
const char *sectname);
extern const struct section *getsectbynamefromheaderwithswap_64(
struct mach_header_64 *mhp,
const char *segname,
const char *sectname,
int fSwap);
#ifdef __cplusplus
}
#endif
#endif