/*****************************************************************************/ /* pemagination: a (virtual) tour into portable bits and executable bytes */ /* Copyright (C) 2013,2014,2015 Z. Gilboa */ /* Released under GPLv2 and GPLv3; see COPYING.PEMAGINE. */ /*****************************************************************************/ #include #include #include #include struct pe_raw_image_dos_hdr * pe_get_image_dos_hdr_addr(const void * base) { struct pe_raw_image_dos_hdr * dos; dos = (struct pe_raw_image_dos_hdr *)base; return ((dos->dos_magic[0] == 'M') && (dos->dos_magic[1] == 'Z')) ? dos : 0; }