Commit Graph

244 Commits

Author SHA1 Message Date
lazymio
87a391d549
Inline uc_tracecode when there is only exactly one hook 2021-11-21 16:44:39 +01:00
lazymio
8c2bc394bc
No need to save jmp_buf and uc in contexts
This reverts #1335 in fact
2021-11-16 21:18:27 +01:00
lazymio
247ffbe0e8
Support nested uc_emu_start calls 2021-11-16 21:07:03 +01:00
lazymio
640251e1aa
Leave out size parameter in callback 2021-11-09 00:21:34 +01:00
lazymio
56fcc07a7c
Add EXTRA field to uc_version 2021-11-08 22:51:49 +01:00
lazymio
35017a614f
Slightly change UC_CTL_TB_REMOVE_CACHE 2021-11-08 22:09:33 +01:00
lazymio
cd02c25802
Fix bug in remove cache and update comments 2021-11-04 21:29:55 +01:00
lazymio
025e32df4a
Init uc on cpu model read 2021-11-04 20:00:01 +01:00
lazymio
3aa2788586
Format 2021-11-04 18:39:52 +01:00
lazymio
ebe1f83293
Initialize UC when reading page size 2021-11-04 18:39:38 +01:00
lazymio
dfbffa44ec
Support changing cpu model for ARM 2021-11-04 18:37:10 +01:00
lazymio
28013c13be
Don't init on page size read 2021-11-04 18:29:42 +01:00
lazymio
3e4b4af7d3
Support change page size 2021-11-04 17:03:30 +01:00
lazymio
6b5529fcb7
Merge pull request #1458 from bet4it/patch
Port some patches from Unicorn1 to Unicorn2
2021-11-03 20:59:42 +01:00
lazymio
bcf85be86d
Add a new hook type UC_HOOK_TCG_OPCODE 2021-11-03 01:46:24 +01:00
lazymio
eb75d459f0
Add a regression test for invalidating empty TB and have a better solution 2021-11-03 01:07:06 +01:00
Bet4
aaf340d9e4 Merge branch 'dev' into patch 2021-11-02 18:36:22 +08:00
lazymio
b7e82d460c
Expose more TB related stuff 2021-11-01 22:11:43 +01:00
lazymio
fb45b287ba
Add multiple exits mechanism and tests&samples 2021-11-01 14:00:43 +01:00
lazymio
a888835962
Fix mingw64 and win32 build 2021-11-01 11:02:44 +01:00
lazymio
f3cb4feec4
Fix build on Windows 2021-11-01 10:39:31 +01:00
lazymio
3dd2e0f95d
Basic implementation of uc_ctl 2021-11-01 00:39:36 +01:00
lazymio
b07baede63
Format 2021-10-31 21:07:30 +01:00
lazymio
84abf1d3a4
A stronger test and handle addr_end = 0 2021-10-31 21:01:55 +01:00
lazymio
090686f8ed
uc_ctl proposal (#1473)
* Add uc_ctl

* Add comments

* Slightly changed for bindings generation

* Generate bindings
2021-10-30 10:45:32 +08:00
lazymio
e62b0ef255
Add clang-format and format code to qemu code style 2021-10-29 12:44:49 +02:00
Aurimas Blažulionis
160045a910
Binary search mapped blocks 2021-10-20 20:49:55 +01:00
Bet4
5f40667d91 Support querying architecture mode besides arm (#1389) 2021-10-11 11:39:23 +08:00
lazymio
76a1b4661c
Fix a memory leak due to wrong free order 2021-10-06 10:11:04 +02:00
mio
df5daed522
Manually fix for #219 2021-10-03 23:27:12 +02:00
Nguyen Anh Quynh
aaaea14214 import Unicorn2 2021-10-03 22:14:44 +08:00
Bet4
811e77c7aa
Support querying architecture mode besides arm (#1389) 2021-04-26 00:31:29 +08:00
w4kfu-synacktiv
21ec6e8f83
Add ARM BE8 support (#1369)
Co-authored-by: w4kfu <gw4kfu@gmail.com>
2021-03-31 21:22:35 +08:00
Brian Foley
dbc6cc27c7
Fix compile if HAS_ARM is defined but HAS_ARM_EB isn't (#1338) 2020-10-07 11:42:14 +08:00
lazymio
1044403d38
Implement uc_context_free (#1336)
* Implement uc_context_free

* Use uc_context_free for python bindings

* Format code

* Simplify code

* Move next,context inside while loop

* Add my name to CREDITS.TXT
2020-09-24 22:28:55 +08:00
lazymio
4441394258
Fix context saving (#1335)
* Fix context size

* Make UcContext convertible to bytes and picklable

Fix when updaing context

* Test context pickling

* Fix double free when the context is pickled from bytes
2020-09-24 00:53:23 +08:00
Nguyen Anh Quynh
2e0f753e6f save cpu->jmp_env in saving context, so uc_emu_start() can be reentrant. also improved Python binding on handling context 2020-06-05 20:12:44 +08:00
BrunoPujos
6cad700b69
fix recursive UC_HOOK_MEM callbacks for cross pages access (#1113)
Co-authored-by: bruno <bruno>
Co-authored-by: Nguyen Anh Quynh <aquynh@gmail.com>
2020-05-25 16:22:28 +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
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
ζeh Matt
3a3bc0c22d Timeout error (#1173)
* Implement timeout state and new error for such case

* Adjust test_i386_loop sample

* Adjust test_i386_loop test
2019-12-29 00:16:54 +08:00
BAYET
8987ad0fff Handle serialization of cpu context save (#1129)
* 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...
2019-09-07 19:09:17 +08:00
Fish
626d72d6df Two fixes to get unicorn build better with MSVC. (#1136)
* Change MSVC keywords.

typename, class, and class are all keywords for MSVC. Adding a suffix for
all of them allows a successful compilation under VC 2017 (15.9).

* Switch from /ZI to /Zi to avoid crashes at longjmp in debug builds.
2019-09-05 00:53:37 +08:00
Chen Huitao
23a426625f check arguments, return error instead of raising exceptions. (#1125)
* check arguments, return error instaed of raising exceptions. close #1117.

* remove empty lines. remove thr underscore prefix in function name.
2019-08-23 17:05:13 +08:00
Aldo Mazzeo
d38c8fb27f Don't duplicate a uc_mem_map_ptr'd memory region when splitting it (#1028) (#1030) 2019-03-07 09:05:26 +08:00
Nguyen Anh Quynh
4d0157eb4a x86: fix #968. also fix potential bug of not clearing high bytes when updateing EIP 2018-07-26 15:19:23 +08:00
Nguyen Anh Quynh
58e1f03f12 Revert "x86: fix #968"
This reverts commit 91033dd0f0.
2018-07-25 17:04:35 +08:00
Nguyen Anh Quynh
91033dd0f0 x86: fix #968 2018-07-25 13:34:15 +08:00
Ficture Seven
ac9da14b3f uc_mem_unmap returns proper error code & fixes #863 (#864) 2017-08-01 18:59:55 +08:00