Skip to content

Commit

Permalink
Merge pull request #28 from smeng9/master
Browse files Browse the repository at this point in the history
Update unicorn version to 1.0.3
  • Loading branch information
AlexAltea committed May 31, 2021
2 parents ad96876 + 688297b commit a872af7
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 16 deletions.
14 changes: 7 additions & 7 deletions README.md
Expand Up @@ -48,12 +48,12 @@ To build the Unicorn.js library, clone the *master* branch of this repository on

1. Initialize the original Unicorn submodule: `git submodule update --init`.

2. Install the latest [Python 2.x (64-bit)](https://www.python.org/downloads/) and [Emscripten SDK 1.37.x](http://kripken.github.io/emscripten-site/docs/getting_started/downloads.html). Follow the respective instructions and make sure all environment variables are configured correctly.
- Note that older versions of the Emscripten SDK, specifically 1.39.15 and earlier, will not run successfully (see issue [#19](https://github.com/AlexAltea/unicorn.js/issues/19#issuecomment-731707398)). You can install a supported version with the command:
```bash
./emsdk install 2.0.7
```
2. Install latest [Emscripten SDK 2.0.21+](https://emscripten.org/docs/getting_started/downloads.html). Follow the respective instructions and make sure all environment variables are configured correctly.

3. Install the development dependencies with: `npm install`.
3. Install the latest [Python 3.8+](https://www.python.org/downloads/). Make sure both `python3` and `python` are callable. You can either setup alias or `apt install python-is-python3`

4. Finally, build the source with: `grunt build`.
3. Install the development dependencies with: `npm install --also=dev`.

4. Install grunt with: `npm install -g grunt`

5. Finally, build the source with: `grunt build`.
6 changes: 4 additions & 2 deletions build.py
Expand Up @@ -599,11 +599,13 @@ def compileUnicorn(targets):
cmd += ' -Os --memory-init-file 0'
cmd += ' unicorn/libunicorn.a'
cmd += ' -s EXPORTED_FUNCTIONS=\"[\''+ '\', \''.join(EXPORTED_FUNCTIONS) +'\']\"'
cmd += ' -s EXTRA_EXPORTED_RUNTIME_METHODS=\"[\''+ '\', \''.join(methods) +'\']\"'
cmd += ' -s EXPORTED_RUNTIME_METHODS=\"[\''+ '\', \''.join(methods) +'\']\"'
cmd += ' -s RESERVED_FUNCTION_POINTERS=256'
cmd += ' -s ALLOW_MEMORY_GROWTH=1'
cmd += ' -s MODULARIZE=1'
cmd += ' -s WASM=1'
cmd += ' -s WASM_ASYNC_COMPILATION=0'
cmd += ' -s WASM=0'
cmd += ' -s ENVIRONMENT="web"'
cmd += ' -s EXPORT_NAME="\'MUnicorn\'"'
if targets:
cmd += ' -o src/libunicorn-%s.out.js' % ('-'.join(targets))
Expand Down
12 changes: 6 additions & 6 deletions src/unicorn-wrapper.js
Expand Up @@ -4,7 +4,7 @@
*/

// Emscripten demodularize
MUnicorn().then(function(instance){MUnicorn = instance});
var MUnicorn = new MUnicorn();

// Number conversion modes
ELF_INT_NUMBER = 1
Expand Down Expand Up @@ -208,7 +208,7 @@ var uc = {
extra_types = ['number'];
extra_values = [extra];
var callback = (function (handle, user_data) {
return function (_, _) {
return function (_, _2) {
user_callback(handle, user_data);
}
})(this, user_data);
Expand All @@ -217,7 +217,7 @@ var uc = {
// uc_cb_hookintr_t
case uc.HOOK_INTR:
var callback = (function (handle, user_data) {
return function (_, intno, _) {
return function (_, intno, _2) {
user_callback(handle, intno, user_data);
}
})(this, user_data);
Expand All @@ -227,7 +227,7 @@ var uc = {
case uc.HOOK_CODE:
case uc.HOOK_BLOCK:
var callback = (function (handle, user_data) {
return function (_, addr_lo, addr_hi, size, _) {
return function (_, addr_lo, addr_hi, size, _2) {
user_callback(handle, addr_lo, addr_hi, size, user_data);
}
})(this, user_data);
Expand All @@ -240,7 +240,7 @@ var uc = {
(type & uc.HOOK_MEM_FETCH) ||
(type & uc.HOOK_MEM_READ_AFTER)) {
var callback = (function (handle, user_data) {
return function (_, type, addr_lo, addr_hi, size, value_lo, value_hi, _) {
return function (_, type, addr_lo, addr_hi, size, value_lo, value_hi, _2) {
user_callback(handle, type, addr_lo, addr_hi, size, value_lo, value_hi, user_data);
}
})(this, user_data);
Expand All @@ -254,7 +254,7 @@ var uc = {
(type & uc.HOOK_MEM_WRITE_PROT) ||
(type & uc.HOOK_MEM_FETCH_PROT)) {
var callback = (function (handle, user_data) {
return function (_, type, addr_lo, addr_hi, size, value_lo, value_hi, _) {
return function (_, type, addr_lo, addr_hi, size, value_lo, value_hi, _2) {
return user_callback(handle, type, addr_lo, addr_hi, size, value_lo, value_hi, user_data);
}
})(this, user_data);
Expand Down
2 changes: 1 addition & 1 deletion unicorn
Submodule unicorn updated 45 files
+2 −0 .gitignore
+84 −117 CMakeLists.txt
+2 −1 CREDITS.TXT
+26 −0 ChangeLog
+3 −2 bindings/README
+2 −1 bindings/dotnet/UnicornManaged/Const/Common.fs
+2 −1 bindings/go/unicorn/unicorn_const.go
+1 −1 bindings/java/Makefile.build
+2 −1 bindings/java/unicorn/UnicornConst.java
+2 −1 bindings/pascal/unicorn/UnicornConst.pas
+34 −0 bindings/python/unicorn/unicorn.py
+2 −1 bindings/python/unicorn/unicorn_const.py
+2 −1 bindings/ruby/unicorn_gem/lib/unicorn_engine/unicorn_const.rb
+339 −0 bindings/rust/COPYING
+27 −0 bindings/rust/Cargo.toml
+45 −0 bindings/rust/README.md
+20 −0 bindings/rust/build.rs
+146 −0 bindings/rust/src/arm.rs
+268 −0 bindings/rust/src/arm64.rs
+230 −0 bindings/rust/src/ffi.rs
+784 −0 bindings/rust/src/lib.rs
+24 −0 bindings/rust/src/m68k.rs
+156 −0 bindings/rust/src/mips.rs
+42 −0 bindings/rust/src/ppc.rs
+94 −0 bindings/rust/src/sparc.rs
+158 −0 bindings/rust/src/unicorn_const.rs
+281 −0 bindings/rust/src/x86.rs
+683 −0 bindings/rust/tests/unicorn.rs
+2 −1 include/uc_priv.h
+46 −0 include/unicorn/platform.h
+8 −1 include/unicorn/unicorn.h
+1 −1 pkgconfig.mk
+25 −11 qemu/cpu-exec.c
+2 −0 qemu/target-arm/cpu.c
+17 −11 qemu/target-arm/translate.c
+1 −1 qemu/target-arm/unicorn_arm.c
+1 −1 qemu/target-i386/fpu_helper.c
+8 −14 qemu/target-i386/translate.c
+10 −0 qemu/util/getauxval.c
+1 −1 qemu/util/qemu-error.c
+77 −1 samples/sample_arm.c
+67 −1 samples/sample_x86.c
+1 −1 tests/regress/fpu_ip.py
+39 −0 tests/regress/hook_raises_exception.py
+5 −2 uc.c

0 comments on commit a872af7

Please sign in to comment.