Commit Graph

2122 Commits

Author SHA1 Message Date
Nguyen Anh Quynh ef5e083c4d Merge branch 'master' of github.com:unicorn-engine/unicorn 2020-05-24 23:56:50 +08:00
Nguyen Anh Quynh 3a2ad04f2b refine comments on UC_QUERY_TIMEOUT 2020-05-24 23:56:35 +08:00
Nguyen Anh Quynh fbef45b18f remove UC_ERR_TIMEOUT, so timeout on uc_emu_start() is not considered error. added UC_QUERY_TIMEOUT to query exit reason 2020-05-24 23:54:45 +08:00
Catena cyber 690ada5f6a
Oss-fuzz ideal integration (#1265)
* Adds oss-fuzz badge

* Generic fix for watchpoints leak
2020-05-23 09:59:30 +08:00
Chen Huitao 17cfef0e56
fix some oss-fuzz (#1259)
* fix oss-fuzz 22107.

* fix oss-fuzz 22112.

* clean up build target.

* fix oss-fuzz 22226.

* fix oss-fuzz 22227.

* fix oss-fuzz 11640.

* fix oss-fuzz 20772.

* remove warning.

* fix oss-fuzz 10459.
2020-05-22 21:58:39 +08:00
Catena cyber 216c348c35
Oss-fuzz ideal integration (#1262)
* Fix watchpoint leak in ARM

* Builds fuzz targets with sanitizer support

* Builds fuzz targets with directory driver

* Adds script to dowlonad public corpus

* Adds CIfuzz

To checks Pull Requests with fuzzing

* Use static library for fuzz targets

* Less verbose logs for fuzz driver directory
2020-05-21 16:15:12 +08:00
chfl4gs e2d1c5bf13
Travis-CI Arm64 build (#1261)
* Travis-CI Migration (#1230)

* Travis-CI Migration

* Travis-CI addition cmake Linux

* Travis-CI cmake fix

* Travis-CI Arm64 build
2020-05-20 11:14:06 +08:00
Chen Huitao 2c66acf4ee
fix #1246 (#1254)
* fix finding python path which only has python3.

* fix #1246, arm host issue.

* skip assembler tests on non-x86 host.

* update macro of dummy value.

* fix MSVC macro.

* update dummy array value macro.

* restore to original qemu code.
2020-05-18 19:57:44 +08:00
Chen Huitao 08240d5453
fix some oss-fuzz (#1258)
* fix oss-fuzz 22107.

* fix oss-fuzz 22112.

* clean up build target.

* fix oss-fuzz 22226.

* fix oss-fuzz 22227.

* fix oss-fuzz 11640.

* fix oss-fuzz 20772.
2020-05-16 10:38:16 +08:00
Nguyen Anh Quynh 94c94cdff0 README: add Pypi download badge 2020-05-12 16:51:59 +08:00
Chen Huitao 18a187b8f8
fix some oss-fuzz (#1255)
* fix oss-fuzz 22107.

* fix oss-fuzz 22112.

* clean up build target.
2020-05-12 01:27:47 +08:00
Nguyen Anh Quynh f988a41369 x86: support read/write to ST registers 2020-05-11 00:24:58 +08:00
Nguyen Anh Quynh cf3451c37a bindings: update ARM64 registers 2020-05-10 21:51:14 +08:00
el poto rico 149121539b
[arm64] Add some cool registers (#1253)
I've added the following registers to the API:

 * PSTATE
 * Exception link registers (ELR_ELx)
 * Stack pointers registers (SP_ELx)
 * MMU (TTBRn_EL1)
 * Exception syndrom registers (ESR_ELx)
 * Faulting virtual address registers (FAR_ELx)
 * PAR (PAR_EL1)
 * MAIR (MAIR_EL1)
 * Vector base address registers (VBAR_ELx)
2020-05-10 21:50:00 +08:00
Nguyen Anh Quynh ef92e5ed71 coding style cleanup 2020-05-07 14:30:22 +08:00
BAYET 881e08da01
Fix UAF when deleting hook while in hook callback #1127 (#1130)
* Handle the cpu context save in a more pythonic way, so the context can be serialized and reuse in an other process using the same emulator architecture and modes

* Fix type error ; mistakes a size_t uint64_t ; breaks in 32bit...

* Fix the UAF situation when deleting a hook while being in a hook callback. Added an attribute 'to_delete' to hooks, and a list hooks_to_del to delay the free of the hooks

* Minor fixes ; forgot return type of clear_deleted_hooks ; do not declare variable in for predicate
2020-05-07 14:24:48 +08:00
Chen Huitao f435efd4a7
fix some oss-fuzz (#1249)
* fix oss-fuzz 21012.

* fix oss-fuzz 21741.

* fix oss-fuzz 21743.
2020-05-05 11:11:59 +08:00
Charles Ferguson f0b509c176
Ensure that hooks are unaffected by a request to stop emulation. (#1154)
This change removes the check for stop requests from the hook loop
macro.

Requests to stop emulation (uc_emu_stop) should only affect whether
the emulation stops. This isn't the case at present for the invocation
of hooks. If emulation is requested to be stopped (which is indicated
by `uc->stop_request`), the hooks will skip all execution. This means
that when the emulation stop is requested, some expected operations
may not occur before the emulation exits - leaving the system in an
inconsistent or broken state.

This is particularly obvious in the case where a CPU interrupt is
required, and a hook has been registered for such cases. The expected
operation is that the hook be called, and no CPU exception be raised
(because the hook has handled it). However, because of the short-cut
in the case where the `uc_emu_stop` function has been called out of
band (eg on another thread), this hook would not be called. In such
cases the execution would terminate with an error that an 'unhandled
CPU exception' occurred, and the hook would never have been called.

This probably affects other parts of the system, such as hooks which
handle remapping of memory on demand (UC_HOOK_MEM_READ_UNMAPPED and
friends) where the remap would not happen and instead an error about
the unmapped memory would be raised.

In all cases, it makes sense that execution continue normally until
the outer loop which controls the execution determines that the
emulation should stop. This will mean that for any given sequence of
events all the emulation operations are completed deterministically
regardless of when the stop request was received.
2020-05-05 08:36:50 +08:00
Dominik Maier 625399774c
X64 base regs (#1166)
* x86: setup FS & GS base

* Fixed base register writes for x64, removed then for x16/x32 (the don't exist there?)

* FS reg comes before GS so the base regs do so, too

* added shebang to const_generator.py

* Added base regs to and added 'all' support to const_generator

Co-authored-by: naq <aquynh@gmail.com>
2020-05-05 08:34:51 +08:00
Charles Ferguson b7e64f3c99
Fix block hooks being called twice after an early exit from execution. (#1194)
Ensure the TCG exit flag is cleared at the end of cpu_exec. This ensures
that subsequent calls are not polluted by the prior call to request an
early exit. The symptoms of the problem being addressed here are that
after a cpu_exit call triggered within a hook there may still be a
pending tcg_exit_req flag set. This then causes a block to start its
execution and then be aborted (from which point it'll continue because
there's no other condition to service). The start of the execution
causes the block hook to be called, no actual code to be run, and then
the block started again with another block hook call.

This change is discussed in ticket 1193:
    https://github.com/unicorn-engine/unicorn/issues/1193
2020-05-05 08:32:12 +08:00
Dominik Maier 9fedbd96f4
fixed leaks in test cases (#1247) 2020-05-02 18:18:18 +08:00
Nguyen Anh Quynh 1ad541cd55 delete .appveyor.yml0 2020-05-01 20:26:53 +08:00
Nguyen Anh Quynh d7e61123ac cmake: spacing 2020-05-01 20:18:07 +08:00
Nguyen Anh Quynh 0cd66bab8a fix qemu/scripts/qapi-build.sh 2020-04-30 14:00:48 +08:00
Nguyen Anh Quynh 00bbe2ce7d we do not need Python to build anymore 2020-04-30 13:58:33 +08:00
Nguyen Anh Quynh 05013b8e47 Merge branch 'master' of github.com:unicorn-engine/unicorn 2020-04-30 11:13:42 +08:00
Nguyen Anh Quynh 27167a8ccb delete unused qemu/scripts/qapi-event.py 2020-04-30 11:13:28 +08:00
Chen Huitao d5f088c85f
add host detection in CMakeLists.txt (#1244)
* fix finding python path which only has python3.

* add host detection.

* add ia64, ppc, s390 host detections.
2020-04-29 08:47:48 +08:00
Nguyen Anh Quynh 0d93f055b4 cleanup qemu/configure 2020-04-28 16:46:41 +08:00
Nguyen Anh Quynh 2b13230a4d qemu/Makefile cleanup 2020-04-28 13:50:50 +08:00
Nguyen Anh Quynh 21b5c122a3 qemu/Makefile cleanup 2020-04-28 13:34:16 +08:00
Nguyen Anh Quynh 06d741242d qemu/Makefile cleanup 2020-04-28 13:30:18 +08:00
Chen Huitao 414c230b59
fix m68k func name (#1245)
* fix finding python path which only has python3.

* fix m68k func name.
2020-04-28 09:51:45 +08:00
Nguyen Anh Quynh 9a70675975 qemu/Makefile cleanup 2020-04-28 09:39:10 +08:00
Nguyen Anh Quynh 49473d7780 Merge branch 'master' of github.com:unicorn-engine/unicorn 2020-04-28 08:58:41 +08:00
Nguyen Anh Quynh 709d081972 more qemu/Makefile* cleanup 2020-04-28 02:38:51 +08:00
Nguyen Anh Quynh dd28727e99 more qemu/Makefile* cleanup 2020-04-28 01:53:39 +08:00
Nguyen Anh Quynh cdd9340113 cleanup qemu Makefile* 2020-04-27 23:01:26 +08:00
Nguyen Anh Quynh d2c66b8386 cleanup qemu/configure 2020-04-27 20:44:11 +08:00
Chen Huitao 8905ecd5e4
move some operations after hook callback (#1243)
* fix finding python path which only has python3.

* move some operations after hook callback.
2020-04-27 19:54:58 +08:00
Nguyen Anh Quynh 5826b1fa54 Merge branch 'master' of github.com:unicorn-engine/unicorn 2020-04-27 01:51:59 +08:00
Nguyen Anh Quynh cc5bfbc844 delete unused file i386-softmmu.mak 2020-04-27 01:31:39 +08:00
chfl4gs c5adcad5a2
fix travis-ci cmake path (#1242)
* Travis-CI Migration (#1230)

* Travis-CI Migration

* Travis-CI addition cmake Linux

* Travis-CI cmake fix
2020-04-27 00:01:39 +08:00
chfl4gs bc04300591
Travis-CI - Cmake (#1241)
* Travis-CI Migration (#1230)

* Travis-CI Migration

* Travis-CI addition cmake Linux
2020-04-26 17:52:22 +08:00
Nguyen Anh Quynh 0ac28359a3 Makefile cleanup 2020-04-25 17:54:14 +08:00
Nguyen Anh Quynh 86923806f2 rename .appveyor.yml to .appveyor.yml0 2020-04-25 00:17:01 +08:00
Nguyen Anh Quynh ec59efe6d4 rename .appveyor.yml to temporarily deactive Appveyor 2020-04-24 23:43:50 +08:00
chfl4gs 17b2aa8c36
Travis-CI Migration (#1230) (#1240)
* Travis-CI Migration
2020-04-24 21:55:54 +08:00
Nguyen Anh Quynh d2571117e9 Merge branch 'master' of github.com:unicorn-engine/unicorn 2020-04-24 18:07:04 +08:00
Nguyen Anh Quynh d947b5f76f cleanup qemu Makefile 2020-04-24 18:06:21 +08:00