Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Cleanups! Move mac specific includes to a single file.
- Loading branch information
Showing
7 changed files
with
129 additions
and
229 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
/* | ||
* ___________ __ __ | ||
* \_ _____/__ ____/ |_____________ _____/ |_ | ||
* | __)_\ \/ /\ __\_ __ \__ \ _/ ___\ __\ | ||
* | \> < | | | | \// __ \\ \___| | | ||
* /_______ /__/\_ \ |__| |__| (____ /\___ >__| | ||
* \/ \/ \/ \/ | ||
* _____ .__ ________ | ||
* / \ _____ ____ | |__ \_____ \ | ||
* / \ / \\__ \ _/ ___\| | \ ______ / | \ | ||
* / Y \/ __ \\ \___| Y \ /_____/ / | \ | ||
* \____|__ (____ /\___ >___| / \_______ / | ||
* \/ \/ \/ \/ \/ | ||
* | ||
* (c) 2012, fG! - reverser@put.as - http://reverse.put.as | ||
* | ||
* An IDA plugin to extract Mach-O binaries inside code or data segments | ||
* | ||
* -> You are free to use this code as long as you keep the original copyright <- | ||
* | ||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" | ||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE | ||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | ||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | ||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | ||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | ||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | ||
* POSSIBILITY OF SUCH DAMAGE. | ||
* | ||
* mac_includes.h | ||
* | ||
*/ | ||
|
||
#ifndef ExtractMachO_mac_includes_h | ||
#define ExtractMachO_mac_includes_h | ||
|
||
// OS X includes | ||
#ifdef __MAC__ | ||
|
||
#include <mach-o/loader.h> | ||
#include <mach-o/fat.h> | ||
#include <mach-o/reloc.h> | ||
#include <mach-o/nlist.h> | ||
|
||
#else | ||
#include "loader.h" | ||
|
||
#define FAT_MAGIC 0xcafebabe | ||
#define FAT_CIGAM 0xbebafeca /* NXSwapLong(FAT_MAGIC) */ | ||
|
||
struct fat_header { | ||
uint32_t magic; /* FAT_MAGIC */ | ||
uint32_t nfat_arch; /* number of structs that follow */ | ||
}; | ||
|
||
struct fat_arch { | ||
int cputype; /* cpu specifier (int) */ | ||
int cpusubtype; /* machine specifier (int) */ | ||
uint32_t offset; /* file offset to this object file */ | ||
uint32_t size; /* size of this object file */ | ||
uint32_t align; /* alignment as a power of 2 */ | ||
}; | ||
|
||
#endif | ||
|
||
#endif |
Oops, something went wrong.