Commit Graph

41 Commits

Author SHA1 Message Date
David CARLIER
72f7598387 Tests, fixes on third platform. (#1168)
MT linkage fix mainly.
2019-12-29 00:18:40 +08:00
Stephen
7f116846c0 MSYS test (#852)
* MSYS test

using new cmocka msys package

* Update .appveyor.yml

* temp package install

before real ones get uploaded to db

* Update .appveyor.yml

* Update .appveyor.yml

* Update .appveyor.yml

* Update Makefile

* Update test_x86_shl_enter_leave.c

* Update Makefile

* Update threaded_emu_start.c

* Update .appveyor.yml

* remove unused install
2017-06-25 10:11:35 +08:00
xorstream
cbd0e6056c Fixed some conflicts 2017-01-23 11:35:00 +11:00
xorstream
724c765028 Merging with current msvc 2 2017-01-23 01:07:50 +11:00
Nguyen Anh Quynh
f9f184e719 test: fix missng pthread functions 2017-01-21 22:29:07 +08:00
me
87e8532e67 regress: link on Linux with -lrt 2016-12-26 14:16:56 +08:00
Chris Eagle
e46545f722 remove glib dependency by provide compatible replacements 2016-12-18 14:56:58 -08:00
Stephen
75d90aff52 Make cleanup (#666)
* make cleanup

* Update .travis.yml
Update eflags_nosync.c
Update sigill2.c
Update ro_mem_test.c
Update ro_mem_test.c
Update nr_mem_test.c
Update mem_fuzz.c
Update mem_double_unmap.c
Update emu_stop_in_hook_overrun.c
Update eflags_nosync.c
remove unused
Update Makefile
Update Makefile
Update Makefile
Update Makefile
Update Makefile
Update Makefile
Update Makefile
Update mem_64_c.c
Update mem_64_c.c
Update Makefile
Update Makefile
Update Makefile
Update Makefile
Update Makefile
Update Makefile
Update .travis.yml
try android ndk build
Update unicorn.py
Update unicorn.py
Update Makefile
Update unicorn.py
Update unicorn.py
remove an untrue comment

if a dll/so/dylib gets loaded at runtime is dependent on many different factors, primarily the LD/DYLD paths. Those do not always include the current working directory
Update Makefile
Update .appveyor.yml
Update .travis.yml
Update Makefile
Update .appveyor.yml
Fix bad sample

* Update Makefile

* Update Makefile

* Update install-cmocka-linux.sh

* remove verbose option from tar

* add upgrade to pacman for cmake

* pacman double update, needed to get new packages

* enable cmocka unit testing

* rejigger commands to fail on any step

should get fails in msys builds for cmocka

* fix quote

* make cmocka in cygwin only

* add msys cache
2016-11-19 17:17:48 +08:00
Hors
0fc3861699 Update Makefile 2016-08-19 23:32:19 +02:00
Nguyen Anh Quynh
4084a385c2 regress: add mem_64_c.c from issue #523 by Chris Eagle 2016-04-24 22:53:30 +08:00
Nguyen Anh Quynh
cc6cbc5cf7 Merge branch 'memleak' into m2 2016-04-18 12:48:13 +08:00
practicalswift
06a64dc3b0 Add six crash cases (2 * ARM + 4 * M68K)
* 001-bad_condition_code_0xe.c (ARM)
* 002-qemu__fatal__unimplemented_control_register_write_0xffb___0x0.c (M68K)
* 003-qemu__fatal__wdebug_not_implemented.c (M68K)
* 004-segmentation_fault_1.c (ARM)
* 005-qemu__fatal__illegal_instruction__0000___00000404.c (M68K)
* 006-qemu__fatal__illegal_instruction__0421___00040026.c (M68K)

```
$ ./001-bad_condition_code_0xe # ARM
uc_emu_start(…)
Bad condition code 0xe
Aborted

$ ./002-qemu__fatal__unimplemented_control_register_write_0xffb___0x0 # M68K
uc_emu_start(…)
hook_code(…) called
qemu: fatal: Unimplemented control register write 0xffb = 0x0

Aborted

$ ./003-qemu__fatal__wdebug_not_implemented # M68K
uc_emu_start(…)
qemu: fatal: WDEBUG not implemented
Aborted

$ ./004-segmentation_fault_1 # ARM
uc_emu_start(…)
hook_code(…) called
Segmentation fault

$ ./005-qemu__fatal__illegal_instruction__0000___00000404 # M68K
uc_emu_start(…)
qemu: fatal: Illegal instruction: 0000 @ 00000404
Aborted

$ ./006-qemu__fatal__illegal_instruction__0421___00040026 # M68K
uc_emu_start(…)
hook_code(…) called
qemu: fatal: Illegal instruction: 0421 @ 00040026
Aborted
```
2016-04-09 15:27:20 -04:00
Nguyen Anh Quynh
b69feb8d0b Merge branch 'master' into memleak2 2016-02-15 15:52:10 +08:00
coco
1e13777c91 added memory fuzzer and 2 resulting testcases 2016-02-04 19:57:20 +01:00
Nguyen Anh Quynh
20b01a6933 fix merge conflict 2016-02-01 12:08:38 +08:00
Nguyen Anh Quynh
7de48f2f75 regress: add emu_clear_errors to .gitignore 2016-01-12 01:02:45 +08:00
Nguyen Anh Quynh
2a269acac1 regress: add memleak_xxx.c to test memleak issue 2016-01-10 23:56:14 +08:00
Spl3en
c9f6648877 Add sysenter_hook_x86 to tests/regress/Makefile and sysenter_hook_x86 to .gitignore. 2015-12-24 18:25:35 +01:00
farmdve
784b8066e2 Add test for pre-instruction hook being called more times. 2015-12-22 12:33:36 +02:00
xorstream
7c1297662c Added test for MIPS branch likely instructions. 2015-12-20 16:07:54 +11:00
xorstream
fa4fd72c5f Added test for uc_emu_stop() in code hook not always stopping the emu at the current instruction. 2015-12-20 14:59:29 +11:00
xorstream
6aa33e8359 Added test for uc_open() and uc_emu_start() being called by different threads. 2015-12-16 13:08:33 +11:00
xorstream
f111d7d1ca Added support for building tests from MinGW. 2015-12-16 12:59:30 +11:00
univm
845392de1e Test for stack hooking. 2015-12-12 00:48:46 +02:00
farmdve
0d98607121 Unmapped memory is not freed.
While uc_mem_unmap does unmap memory regions from Unicorn, it does not
free the memory. It accumulates over time when reusing a single Unicorn
instance.
2015-12-10 00:08:07 +02:00
xorstream
7f04b0f772 Added MIPS delay slot code hook test.
Tests that the code hook gets called for instructions in the branch delay slot for MIPS cpu.
2015-12-09 18:06:53 +11:00
practicalswift
31e32d1734 Crash case: Jump to invalid address (0x0), sparc32 2015-12-02 21:55:13 +01:00
practicalswift
23aa6aa9a6 Add invalid_read_in_tb_flush_x86_64 to .gitignore and Makefile 2015-12-02 07:15:44 +01:00
practicalswift
7a1067ad4a Crash case: Invalid read of size 4 when tracing (MIPS32). See #282 2015-11-30 23:44:49 +01:00
practicalswift
75a325e8c6 Crash case: Invalid read of size 8 in tb_flush_x86_64. 2015-11-29 23:00:34 +01:00
practicalswift
36948320ce invalid_read_in_cpu_tb_exec_x86_64 → invalid_write_in_cpu_tb_exec_x86_64 2015-11-17 08:44:38 +01:00
practicalswift
ad5c2eb9c6 Crash case: Invalid write of size 4 in cpu_tb_exec_x86_64. 2015-11-16 23:19:23 +01:00
practicalswift
5b34660b3f Add test case to Makefile and .gitignore. Add disassembly. 2015-11-15 17:31:06 +01:00
Ryan Hileman
f93e342177 add mem_map_large regression (for #223) 2015-11-11 22:52:18 -08:00
farmdve
726f45b33d Attempting to set some bits in the Unicorn EFLAGS doesn't work.
When attempting to set all flags except trap flag, the EFLAGS value
should be 0x00244ED7, I've tested this on Windows and here
https://ideone.com/WQAvk1 which is presumably Linux.

Unicorn however has the value 0x00000ED7, bits 11-21 are not set. Bit 21
is the ID bit indicating whether or not CPUID is available.
2015-11-10 00:49:01 +02:00
farmdve
7f3c567ae5 X86 zero-byte opcode causes Unicorn to crash.
The opcode 0x00 translates as `add byte ptr ds:[eax],al`, which leads to
a segfault in Unicorn.

Using a debugger, I believe the crash is located in
`qemu/translate-all.c` in function `page_flush_tb_1`, more specifically
this code `pd[i].first_tb = NULL;`
2015-11-05 14:41:15 +02:00
farmdve
894739515e X86 EFLAGS not synced properly.
these commits should fix my previous ones.
2015-11-04 09:38:57 +02:00
Nguyen Anh Quynh
7553c9c1c2 tests: add mips_kseg0_1 to Makefile to compile it 2015-10-27 11:25:34 +08:00
coco
dd56621bbb fix for use after free in case of double unmap 2015-10-21 22:25:49 +02: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
danghvu
3c1d65ea66 Reorganize test directories 2015-09-21 20:47:45 -05:00