From 7d59bcec42fff1484fa0b09ea211d4b9fbd39b81 Mon Sep 17 00:00:00 2001 From: Alcaro Date: Sun, 26 Jan 2020 20:07:45 +0100 Subject: [PATCH] This segfault doesn't strike me as particularly useful, also clean up and modernize some random stuff --- flips.cpp | 8 ++++---- make.sh | 4 +--- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/flips.cpp b/flips.cpp index 6a1024b..7cfe21a 100644 --- a/flips.cpp +++ b/flips.cpp @@ -974,7 +974,7 @@ struct errorinfo CreatePatchToMem(LPCWSTR inromname, LPCWSTR outromname, enum pa if (!romsmap[i]) { if (i==1) delete romsmap[0]; - return error(el_broken, "Couldn't read this ROM. What exactly are you doing?"); + return error(el_broken, "Couldn't read this ROM."); } if (shouldRemoveHeader(romname, romsmap[i]->len()) && (patchtype==ty_bps || patchtype==ty_bps_linear || patchtype==ty_bps_moremem)) { @@ -986,14 +986,14 @@ struct errorinfo CreatePatchToMem(LPCWSTR inromname, LPCWSTR outromname, enum pa else { roms[i] = file::create(romname); - lens[i] = roms[i]->len(); if (!roms[i]) { if (i==1) delete roms[0]; - return error(el_broken, "Couldn't read this ROM. What exactly are you doing?"); + return error(el_broken, "Couldn't read this ROM."); } - if (shouldRemoveHeader(romname, roms[i]->len()) && (patchtype==ty_bps || patchtype==ty_bps_linear || patchtype==ty_bps_moremem)) + lens[i] = roms[i]->len(); + if (shouldRemoveHeader(romname, lens[i]) && (patchtype==ty_bps || patchtype==ty_bps_linear || patchtype==ty_bps_moremem)) { roms[i] = new fileheader(roms[i]); } diff --git a/make.sh b/make.sh index a92fe4f..390617f 100755 --- a/make.sh +++ b/make.sh @@ -15,7 +15,7 @@ STRIP="-s" for i in "$@"; do case "$i" in --harden=yes) - FLAGS=$FLAGS' -fstack-protector-all -Wstack-protector --param ssp-buffer-size=4 -pie -fPIE -D_FORTIFY_SOURCE=2' + FLAGS=$FLAGS' -fstack-protector-strong -pie -fPIE -D_FORTIFY_SOURCE=2' true | gcc -E - -mmitigate-rop > /dev/null 2>&1 && FLAGS=$FLAGS' -mmitigate-rop' ;; @@ -37,8 +37,6 @@ case "$i" in esac done -rm flips obj/* - if [ $PROFILE = yes ]; then echo 'GTK+ (1/3)'