Merge remote-tracking branch 'upstream/master' into change-handle-based-api
This commit is contained in:
@@ -8,14 +8,16 @@
|
||||
|
||||
int got_sigill = 0;
|
||||
|
||||
void _interrupt(struct uc_struct *uc, uint32_t intno, void *user_data) {
|
||||
void _interrupt(struct uc_struct *uc, uint32_t intno, void *user_data)
|
||||
{
|
||||
if (intno == 6) {
|
||||
uc_emu_stop(uc);
|
||||
got_sigill = 1;
|
||||
got_sigill = 1;
|
||||
}
|
||||
}
|
||||
|
||||
int main() {
|
||||
int main()
|
||||
{
|
||||
int size;
|
||||
uint8_t *buf;
|
||||
struct uc_struct *uc;
|
||||
@@ -32,9 +34,9 @@ int main() {
|
||||
return 1;
|
||||
}
|
||||
memset (buf, 0, size);
|
||||
if (!uc_mem_map(uc, UC_BUG_WRITE_ADDR, size)) {
|
||||
if (!uc_mem_map(uc, UC_BUG_WRITE_ADDR, size, UC_PROT_ALL)) {
|
||||
uc_mem_write(uc, UC_BUG_WRITE_ADDR,
|
||||
(const uint8_t*)"\xff\xff\xff\xff\xff\xff\xff\xff", 8);
|
||||
(const uint8_t*)"\xff\xff\xff\xff\xff\xff\xff\xff", 8);
|
||||
}
|
||||
uc_hook_add(uc, &uh_trap, UC_HOOK_INTR, _interrupt, NULL);
|
||||
uc_emu_start(uc, UC_BUG_WRITE_ADDR, UC_BUG_WRITE_ADDR+8, 0, 1);
|
||||
|
||||
Reference in New Issue
Block a user