Commit graph

137 commits

Author SHA1 Message Date
Lioncash b6f752970b
target/riscv: Initial introduction of the RISC-V target
This ports over the RISC-V architecture from Qemu. This is currently a
very barebones transition. No code hooking or any fancy stuff.
Currently, you can feed it instructions and query the CPU state itself.

This also allows choosing whether or not RISC-V 32-bit or RISC-V 64-bit
is desirable through Unicorn's interface as well.

Extremely basic examples of executing a single instruction have been
added to the samples directory to help demonstrate how to use the basic
functionality.
2019-03-08 21:46:10 -05:00
Catena cyber 86be817717
Fuzz
* Integration with oss-fuzz

* Use CFLAGS even for linking

as for fuzzing with asan

* Do not abort on uc_emu_start error

* Redirect fuzz output somewhere else than stdout

* Use uc_open for every fuzz instance

* Avoids timeouts from infinite loops

Limiting the number of instructions

* Moving fuzz to tests directory
2018-10-06 04:49:11 -04:00
RLib f0229bd144 Fixed register mistake in comments (#894) 2017-09-17 16:40:01 +07:00
Nguyen Anh Quynh 8f2d6cd70f samples: comment out test_i386_invalid_c6c7() 2017-06-14 16:14:36 +07:00
vardyh 944658e920 samples::x86: introduce C6/C7 validation testcase
Signed-off-by: vardyh <vardyh.dev@gmail.com>
2017-05-25 17:55:40 +08:00
zhangwm 4a62409949 arm64eb: arm64 big endian also using little endian instructions. (#816)
* arm64eb: arm64 big endian also using little endian instructions.

* arm64: using another example that depends on endians.

example:
1. store a word: 0x12345678
2. load a byte:
   * little endian : 0x78
   * big endian    : 0x12
2017-05-04 20:00:48 +08:00
xorstream fa45a42c76 Removed MSVC binding. (#808) 2017-04-27 10:21:04 +08:00
xorstream 1940bc7032 Added arm64eb sample to sample_all.sh script (#809) 2017-04-25 13:42:13 +08:00
Nguyen Anh Quynh 2bd40b9c91 update armeb & arm64eb samples 2017-04-25 12:55:26 +08:00
zhangwm 2e973a13f0 arm64eb: add support for ARM64 big endian. 2017-04-24 23:30:01 +08:00
xorstream d167f1a27a Added armbe support to MSVC branch. (#801) 2017-04-21 15:26:21 +08:00
Nguyen Anh Quynh e917c9de10 Merge branch 'master' into msvc2 2017-04-21 01:17:00 +08:00
Elias Bachaalany d10737c9f8 Added .gitignore for VS 2015 (#794) 2017-04-12 08:50:02 +08:00
Nguyen Anh Quynh 094ca80092 fix conflicts 2017-03-30 12:23:24 +08:00
Nguyen Anh Quynh b9712f0a5d add sample_armeb to sample_all.sh 2017-03-18 16:30:44 +08:00
zhangwm d2740b17ce armeb: add C sample for armeb. 2017-03-13 23:19:09 +08:00
zhangwm d8fe34a2e8 armeb: Add support for ARM big endian. 2017-03-13 22:32:44 +08:00
Nguyen Anh Quynh c01dcf0a14 fix merge conflicts 2017-03-10 21:04:33 +08:00
Nguyen Anh Quynh f2e75422e8 samples: add all sample code to sample_all.sh 2017-03-10 21:02:29 +08:00
xorstream 69ae8f7987 Fix for MIPS issue. (#733) 2017-01-23 12:39:34 +08:00
xorstream cbd0e6056c Fixed some conflicts 2017-01-23 11:35:00 +11:00
xorstream e46f86c80b Merging with current msvc. 2017-01-23 01:07:06 +11:00
xorstream 72a497bc14 Added MIPS support and projects for all samples. 2017-01-23 01:05:08 +11:00
Nguyen Anh Quynh 206819bd98 cleanup after msvc port 2017-01-22 21:27:17 +08:00
xorstream 770c5616e2 Automated leading tab to spaces conversion. 2017-01-21 12:28:22 +11:00
xorstream fac6a66860 platform.h move #3 2017-01-21 00:13:21 +11:00
xorstream 1fea4e6d87 Some small changes to clean up before pull request. 2017-01-20 22:34:14 +11:00
xorstream 002151874a Unicorn interface working with test app in 32bit and 64bit builds. 2017-01-20 17:27:22 +11:00
xorstream 1aeaf5c40d This code should now build the x86_x64-softmmu part 2. 2017-01-19 22:50:28 +11:00
Nguyen Anh Quynh bc569f5a54 rename API uc_mem_free() to uc_free(). see #662 2017-01-10 20:59:14 +08:00
Nguyen Anh Quynh fdbbdc6216 rename uc_context_free() to uc_mem_free(). see #373 2017-01-09 20:52:14 +08:00
Nguyen Anh Quynh 9a79d6fe9f Merge branch 'master' into noglib2 2016-12-27 16:48:23 +08:00
Andrew Dutcher bf2cd79a4d Windows: export a static lib that can be used outside of mingw (#699)
* Windows: export a static lib that can be used outside of mingw

* Add comments to windows_export.bat
2016-12-27 16:30:07 +08:00
Nguyen Anh Quynh b34109fb0d samples: link RT for Linux only 2016-12-24 17:48:15 +08:00
Nguyen Anh Quynh d37ae7364a samples: link RT for non-MacOS 2016-12-24 15:04:34 +08:00
Nguyen Anh Quynh feb477b2bc samples: an attempt to fix the reference error to clock_gettime(), as reported by Travis 2016-12-20 12:52:03 +08:00
Nguyen Anh Quynh 5e217a2490 fix samples/Makefile 2016-12-19 23:51:59 +08:00
Nguyen Anh Quynh 7665310daa samples: add -lrt for clock_gettime(), as suggested by Stephen 2016-12-19 23:50:21 +08:00
Chris Eagle e46545f722 remove glib dependency by provide compatible replacements 2016-12-18 14:56:58 -08:00
Nguyen Anh Quynh 33813a0781 samples: fix Makefile for Mingw 2016-11-19 23:40:38 +08:00
Nguyen Anh Quynh c4ddf4e36b fix samples/Makefile 2016-11-19 17:29:51 +08:00
Nguyen Anh Quynh 4a03f6021f fix merge conflict 2016-11-19 17:29:06 +08:00
Nguyen Anh Quynh ab9bae4f3e revert the change on verbose option for Makefile 2016-11-19 17:20:05 +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
Stephen 9f0cdc4be9 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
2016-11-11 07:45:06 -08:00
Stephen 186540e160 make cleanup 2016-11-06 16:27:24 -08:00
mahin 83c9eb9c2c changed 02hhx —> 02x in sample_x86_32_gdt_and_seg_regs.c 2016-11-02 03:50:53 +08:00
Adrian Herrera e1a2cb5fe8 [samples] Added uc_context_* sample 2016-10-31 11:56:32 +01:00
Stephen bc08bfda67 Unit testing in CI (#651)
- in appveyor, install clang and cmake in cygwin, enable package upgrades, and build cmocka and enable testing for gcc only
- in `gitignore`, ignore generated cmocka folder
- in travis, use brew in osx to install cmocka, and enable testing for gcc and clang on os x and linux
- in `Makefile`, change to use `uname -s` to determine os type
- make `install-cmocka-linux.sh`, a simple shell script to download and install cmocka on linux
- in `bindings/Makefile`, enable `make -c` to call subdirectory makefiles instead of `cd [dir] && make` and include environment variables for runtime access to generated libraries
- in `samples/Makefile`, change to use `uname -s` to determine os type, remove `clean_bins` from `all` command, and include `Werror` for compile strictness
- in `tests/unit/Makefile`, add `cflags` for compile time access to cmocka headers and library, include execute vars for runtime access to cmocka and unicorn libs
- in `tests/unit/test_tb_x86.c`, comment out assert that would not compile
2016-10-22 00:21:10 +08:00
esanfelix fce82b9532 Fixed ARM sample to properly run THUMB code #638 2016-09-20 10:15:58 +02:00