macdependency/MachO/loadcommand.h
Mike Lischke 972fcb3094 Overhaul of the application to avoid it crashing on macOS Sierra.
- Applied all recommended XCode (8) settings.
- Removed boost and replaced that code by standard functions.
- Implemented name mangling via abi::__cxa_demangle instead of running an external process to use c++filt.
- Enabled C++11. Min deployment target is now OSX 10.7.
- Some code clean up (e.g. formatting, std namespace).
2016-11-19 16:23:39 +01:00

32 lines
792 B
C++

#ifndef LOADCOMMAND_H
#define LOADCOMMAND_H
#include "macho_global.h"
class MachOHeader;
class MachOFile;
class EXPORT LoadCommand
{
protected:
LoadCommand(MachOHeader* header);
public:
static LoadCommand* getLoadCommand(unsigned int cmd, MachOHeader* header);
virtual ~LoadCommand();
virtual unsigned int getSize() const = 0;
// is smaller than getSize() because it only returns the size of the command structure
// only necessary if command uses getLcData()
virtual unsigned int getStructureSize() const { return 0; }
protected:
MachOHeader* header;
MachOFile& file;
const unsigned int offset;
const char* getLcDataString(unsigned int offset) const;
private:
mutable char* lcData;
void readLcData() const;
};
#endif // LOADCOMMAND_H