Ryan Hileman
d5e85cf3f9
more efficient hook removal
2016-03-25 20:25:18 -07:00
Nicolas PLANEL
1087ba9dea
[query] add UC_QUERY_PAGE_SIZE uc_query helper
...
Return the current page size used by the current arch.
Useful to call uc_mem_map() with memory/size aligned.
Signed-off-by: Nicolas PLANEL <nplanel@redhat.com>
2016-03-04 15:54:24 +11:00
Nguyen Anh Quynh
871cdb692f
Merge branch 'hook'
2016-02-17 09:37:17 +08:00
Nguyen Anh Quynh
5719481e3f
move memory_overlap() around from mem_map() to mem_map_check(). this fixes test_mem_map.c in issue #420
2016-02-11 17:53:51 +08:00
Nguyen Anh Quynh
80b0356a86
fix a comment in uc_hook_add() for UC_HOOK_INSN
2016-02-11 09:27:30 +08:00
Nguyen Anh Quynh
a7a1dcc661
uc_hook_add(): add begin & end arguments for all hook types. also update Python binding after this change
2016-02-11 08:02:13 +08:00
Nguyen Anh Quynh
5a04bcb115
allow to change PC during callback. this solves issue #210
2016-01-28 14:06:17 +08:00
Nguyen Anh Quynh
e750a4e97c
when uc_mem_exec() remove EXE permission, quit current TB & continue emulating with TB flushed. this fixes issue in PR #378
2016-01-28 00:56:55 +08:00
Nguyen Anh Quynh
48ab148d1c
Merge branch 'hook'
2016-01-26 22:52:29 +08:00
Nguyen Anh Quynh
0c2194078e
Merge branch 'hook-refactor' of https://github.com/lunixbochs/unicorn into hook
2016-01-25 20:42:56 +08:00
Ryan Hileman
cee9a7d011
fix missing HOOK_CODE bound check
2016-01-25 03:51:35 -08:00
xorstream
ec6d4d9ae0
Removed unneeded arm mode check
2016-01-24 22:36:37 +11:00
xorstream
26d3b1e7d6
Added ppc 32bit mode and added sparc mode checks to bring it in line with other archs
2016-01-24 22:27:33 +11:00
Nguyen Anh Quynh
4dbad9aa9b
add new API uc_query() to query internal status of emulator at runtime
2016-01-23 17:14:44 +08:00
Ryan Hileman
2ac1281f82
rework code/block tracing
2016-01-22 19:07:50 -08:00
Nguyen Anh Quynh
249e2ac0a0
Merge branch 'hook-refactor' of https://github.com/lunixbochs/unicorn into lunixbochs-hook-refactor
2016-01-23 10:58:37 +08:00
Ryan Hileman
0886ae8ede
rework code/block tracing
2016-01-22 18:42:27 -08:00
Ryan Hileman
93052f6566
refactor to allow multiple hooks for one type
2016-01-22 18:41:43 -08:00
Nguyen Anh Quynh
b6e9121f48
use spaces, but not tabs, for indentation
2016-01-23 09:34:02 +08:00
xorstream
678d645b80
Fix uc_mode usage in source code
2016-01-23 12:29:22 +11:00
xorstream
e9ba6ed804
Fix uc_mode usage in source code
2016-01-23 12:17:59 +11:00
xorstream
8763d426c2
Fix uc_mode usage in source code
2016-01-23 12:08:49 +11:00
xorstream
b7c43108bd
Started fixing uc_mode flag usage
2016-01-23 10:45:58 +11:00
Nguyen Anh Quynh
21c614d0af
properly verify ARM mode in uc_open(). see issue #389
2016-01-22 20:46:26 +08:00
Nguyen Anh Quynh
3d8f413ce8
new API uc_mem_regions() to retrieve the list of memory regions mapped by uc_mem_map_*()
2016-01-16 16:57:17 +08:00
Nguyen Anh Quynh
71ad9310fc
sanity check on arguments of uc_mem_map_ptr()
2016-01-12 00:59:56 +08:00
farmdve
89eac66bf7
Move sanity checks before uc->memory_map is called.
2016-01-11 18:26:23 +02:00
Nguyen Anh Quynh
7e16f7a50d
disallow mapping memory range that is already mapped. this fixes issue #350
2015-12-30 09:17:47 +08:00
Nguyen Anh Quynh
f935469658
mips: handle memory redirect for all APIs. this fixes issue #347
2015-12-28 15:19:30 +08:00
Nguyen Anh Quynh
771f9f7c3b
fix conflicts when merging map-ptr branch to master branch
2015-12-17 08:12:02 +08:00
farmdve
8b79a872d0
Fix segfault introduced in my previous commits.
2015-12-11 22:35:25 +02:00
Nguyen Anh Quynh
3c72809373
end address of mapping memory is not inclusive, and can wrap around to 0. fix issue #299
2015-12-12 01:37:13 +08:00
Nguyen Anh Quynh
74986cc59a
g_free() can handle NULL pointer
2015-12-11 11:25:35 +08:00
farmdve
3e57615c76
Fix uc_mem_unmap memory leak and in uc_close.
...
It appears the problem is that we are not calling the memory region
destructor. After modifying memory_unmap to include the destructor call
for the memory region, the memory is freed.
Furthermore in uc_close we must explicitly free any blocks that were not
unmapped by the user to prevent leaks.
This should fix issue 305.
2015-12-11 02:42:31 +02:00
Ryan Hileman
230cbd5330
add permissions to map_ptr api
2015-11-28 11:28:31 -08:00
Nguyen Anh Quynh
f4882ae1a2
simplify code by replacing mem_map_start()/mem_map_finish() in uc.c with mem_map()
2015-11-28 18:26:08 +08:00
Nguyen Anh Quynh
f57c098056
declare variables at begin of function
2015-11-28 15:56:19 +08:00
Ryan Hileman
6d21ebabea
implement host-controlled memory mapping for #261
2015-11-27 23:30:36 -08:00
Nguyen Anh Quynh
2f297bdd3a
handle some errors properly so avoid exit() during initialization. this fixes issue #237
2015-11-12 01:43:41 +08:00
Nguyen Anh Quynh
272293556a
do not abort() when memory is insufficient. this fixes issue #244
2015-11-10 11:44:29 +08:00
practicalswift
4151d1d600
Fix segfault-on-emu_stop() bug.
2015-11-03 14:34:31 +01:00
Nguyen Anh Quynh
b41db5abd9
Merge pull request #229 from practicalswift/typos
...
Fix typos. Remove trailing whitespace.
2015-10-31 10:39:35 +08:00
practicalswift
4f521c371c
Fix typos.
2015-10-30 22:32:59 +01:00
Nguyen Anh Quynh
b66a323b19
do not free MemoryRegion in memory_unmap() because it will be unref later in memory_region_unref(). this fixes issue #202
2015-10-28 01:26:59 +08:00
Nguyen Anh Quynh
3a36e327ab
support memory redirection, so the issue #217 is fixed
2015-10-27 14:37:03 +08:00
coco
dd56621bbb
fix for use after free in case of double unmap
2015-10-21 22:25:49 +02:00
Willi Ballenthin
34c7b70bcb
uc.c: fix minor typo
...
s/argumet/argument/g
2015-10-19 16:52:56 -04:00
Nguyen Anh Quynh
b1d41d414b
on some hook events, uc_hook_add() should not allow more than 1 handler. this add UC_ERR_HOOK_EXIST error type
2015-10-10 18:01:47 +08:00
Nguyen Anh Quynh
9e64cba6ec
Rename some hook related enums:
...
- UC_ERR_READ_INVALID -> UC_ERR_READ_UNMAPPED
- UC_ERR_WRITE_INVALID -> UC_ERR_WRITE_UNMAPPED
- UC_ERR_FETCH_INVALID -> UC_ERR_FETCH_UNMAPPED
- UC_MEM_READ_INVALID -> UC_MEM_READ_UNMAPPED
- UC_MEM_WRITE_INVALID -> UC_MEM_WRITE_UNMAPPED
- UC_MEM_FETCH_INVALID -> UC_MEM_FETCH_UNMAPPED
- UC_HOOK_MEM_READ_INVALID -> UC_HOOK_MEM_READ_UNMAPPED
- UC_HOOK_MEM_WRITE_INVALID -> UC_HOOK_MEM_WRITE_UNMAPPED
- UC_HOOK_MEM_FETCH_INVALID -> UC_HOOK_MEM_FETCH_UNMAPPED
- UC_HOOK_MEM_INVALID -> UC_HOOK_MEM_UNMAPPED
This also renames some newly added macros to use _INVALID postfix:
- UC_HOOK_MEM_READ_ERR -> UC_HOOK_MEM_READ_INVALID
- UC_HOOK_MEM_WRITE_ERR -> UC_HOOK_MEM_WRITE_INVALID
- UC_HOOK_MEM_FETCH_ERR -> UC_HOOK_MEM_FETCH_INVALID
- UC_HOOK_MEM_ERR -> UC_HOOK_MEM_INVALID
Fixed all the bindings Java, Go & Python.
2015-09-30 14:46:55 +08:00
Nguyen Anh Quynh
90eb8f2e72
This commit continues the PR #111
...
- Allow to register handler separately for invalid memory access
- Add new memory events for hooking:
- UC_MEM_READ_INVALID, UC_MEM_WRITE_INVALID, UC_MEM_FETCH_INVALID
- UC_HOOK_MEM_READ_PROT, UC_HOOK_MEM_WRITE_PROT, UC_HOOK_MEM_FETCH_PROT
- Rename UC_ERR_EXEC_PROT to UC_ERR_FETCH_PROT
- Change API uc_hook_add() so event type @type can be combined from hooking types
2015-09-24 14:18:02 +08:00