Blame src/headers/pe_get_image_dos_hdr_addr.c

feffc7
/*****************************************************************************/
feffc7
/*  pemagination: a (virtual) tour into portable bits and executable bytes   */
b6ea9a
/*  Copyright (C) 2013--2017  Z. Gilboa                                      */
feffc7
/*  Released under GPLv2 and GPLv3; see COPYING.PEMAGINE.                    */
feffc7
/*****************************************************************************/
feffc7
feffc7
#include <psxtypes/psxtypes.h>
feffc7
feffc7
#include <pemagine/pe_consts.h>
feffc7
#include <pemagine/pe_structs.h>
feffc7
#include <pemagine/pemagine.h>
feffc7
fef53e
de5b30
struct pe_raw_image_dos_hdr * pe_get_image_dos_hdr_addr(const void * base)
feffc7
{
de5b30
	struct pe_raw_image_dos_hdr * dos;
feffc7
de5b30
	dos = (struct pe_raw_image_dos_hdr *)base;
feffc7
fef53e
	return ((dos->dos_magic[0] == 'M') && (dos->dos_magic[1] == 'Z'))
fef53e
		? dos : 0;
feffc7
}