mirror of
https://github.com/yuzu-emu/unicorn.git
synced 2025-07-16 05:37:49 +00:00
revert regress/map_crash.c back to original code
This commit is contained in:
parent
79effb2df5
commit
ebaa542702
|
@ -1,7 +1,5 @@
|
||||||
.PHONY: all clean
|
CFLAGS += -I../include
|
||||||
|
LDFLAGS = -L.. -lunicorn
|
||||||
CFLAGS+=-I../include
|
|
||||||
LDFLAGS=-L.. -lunicorn
|
|
||||||
|
|
||||||
TESTS = map_crash
|
TESTS = map_crash
|
||||||
|
|
||||||
|
|
|
@ -4,27 +4,27 @@
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
#define UC_BUG_WRITE_SIZE 13000
|
#define UC_BUG_WRITE_SIZE 13000
|
||||||
//#define UC_BUG_WRITE_ADDR 0x1000
|
#define UC_BUG_WRITE_ADDR 0x1000 // fix this by change this to 0x2000
|
||||||
#define UC_BUG_WRITE_ADDR 0x2000
|
|
||||||
|
|
||||||
int main() {
|
int main() {
|
||||||
int size;
|
int size;
|
||||||
uint8_t *buf;
|
uint8_t *buf;
|
||||||
uch uh;
|
uch uh;
|
||||||
uc_err err = uc_open (UC_ARCH_X86, UC_MODE_64, &uh);
|
uc_err err = uc_open (UC_ARCH_X86, UC_MODE_64, &uh);
|
||||||
if (err) {
|
if (err) {
|
||||||
fprintf (stderr, "Cannot initialize unicorn\n");
|
fprintf (stderr, "Cannot initialize unicorn\n");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
size = UC_BUG_WRITE_SIZE;
|
size = UC_BUG_WRITE_SIZE;
|
||||||
buf = malloc (size);
|
buf = malloc (size);
|
||||||
if (!buf) {
|
if (!buf) {
|
||||||
fprintf (stderr, "Cannot allocate\n");
|
fprintf (stderr, "Cannot allocate\n");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
memset (buf, 0, size);
|
memset (buf, 0, size);
|
||||||
uc_mem_map (uh, UC_BUG_WRITE_ADDR, size);
|
if (!uc_mem_map (uh, UC_BUG_WRITE_ADDR, size)) {
|
||||||
uc_mem_write (uh, UC_BUG_WRITE_ADDR, buf, size);
|
uc_mem_write (uh, UC_BUG_WRITE_ADDR, buf, size);
|
||||||
uc_close (&uh);
|
}
|
||||||
return 0;
|
uc_close (&uh);
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue