From c8b201dd2ad041eda3147b59abaacb2d2359c6d5 Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Sun, 9 Oct 2005 20:06:50 +0000 Subject: Check the header of dehacked files and make sure we only load valid dehacked files. Subversion-branch: /trunk/chocolate-doom Subversion-revision: 182 --- src/deh_main.c | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/src/deh_main.c b/src/deh_main.c index ef06f095..0f252b77 100644 --- a/src/deh_main.c +++ b/src/deh_main.c @@ -1,7 +1,7 @@ // Emacs style mode select -*- C++ -*- //----------------------------------------------------------------------------- // -// $Id: deh_main.c 174 2005-10-08 20:14:38Z fraggle $ +// $Id: deh_main.c 182 2005-10-09 20:06:50Z fraggle $ // // Copyright(C) 2005 Simon Howard // @@ -21,6 +21,10 @@ // 02111-1307, USA. // // $Log$ +// Revision 1.6 2005/10/09 20:06:50 fraggle +// Check the header of dehacked files and make sure we only load valid +// dehacked files. +// // Revision 1.5 2005/10/08 20:14:38 fraggle // Dehacked "Sound" section support // @@ -54,6 +58,8 @@ #include "deh_defs.h" #include "deh_io.h" +static char deh_signature[] = "Patch File for DeHackEd v3.0\n"; + // deh_ammo.c: extern deh_section_t deh_section_ammo; // deh_cheat.c: @@ -196,6 +202,21 @@ boolean DEH_ParseAssignment(char *line, char **variable_name, char **value) return true; } +static boolean CheckSignature(deh_context_t *context) +{ + int i; + + for (i=0; i