Add code to handle non-readable memory
This commit is contained in:
@@ -4,7 +4,7 @@ LDFLAGS = -L.. -lunicorn
|
||||
TESTS = map_crash map_write
|
||||
TESTS += sigill sigill2
|
||||
TESTS += block_test
|
||||
TESTS += ro_mem_test
|
||||
TESTS += ro_mem_test nr_mem_test
|
||||
|
||||
all: $(TESTS)
|
||||
|
||||
|
||||
@@ -1,3 +1,24 @@
|
||||
/*
|
||||
|
||||
non-writable memory test case
|
||||
|
||||
Copyright(c) 2015 Chris Eagle
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
version 2 as published by the Free Software Foundation.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
*/
|
||||
|
||||
#include <inttypes.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
@@ -61,7 +82,7 @@ static bool hook_mem_invalid(uch handle, uc_mem_type type,
|
||||
printf(">>> Missing memory is being WRITTEN at 0x%"PRIx64 ", data size = %u, data value = 0x%"PRIx64 "\n",
|
||||
address, size, value);
|
||||
return false;
|
||||
case UC_MEM_WRITE_RO:
|
||||
case UC_MEM_WRITE_NR:
|
||||
printf(">>> RO memory is being WRITTEN at 0x%"PRIx64 ", data size = %u, data value = 0x%"PRIx64 "\n",
|
||||
address, size, value);
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user