Skip to content

Commit

Permalink
Bump version and generate bindings
Browse files Browse the repository at this point in the history
  • Loading branch information
wtdcode committed Sep 21, 2024
1 parent 6c4a3fd commit 67f08b1
Show file tree
Hide file tree
Showing 21 changed files with 220 additions and 56 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ endif()
set(CMAKE_C_STANDARD 11)

set(UNICORN_VERSION_MAJOR 2)
set(UNICORN_VERSION_MINOR 0)
set(UNICORN_VERSION_PATCH 2)
set(UNICORN_VERSION_MINOR 1)
set(UNICORN_VERSION_PATCH 0)

include(cmake/bundle_static.cmake)

Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "unicorn-engine"
version = "2.0.2"
version = "2.1.0"
authors = ["Ziqiao Kong", "Lukas Seidel"]
documentation = "https://github.com/unicorn-engine/unicorn/wiki"
edition = "2021"
Expand Down
17 changes: 11 additions & 6 deletions bindings/dotnet/UnicornEngine/Const/Common.fs
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ open System
[<AutoOpen>]
module Common =
let UC_API_MAJOR = 2
let UC_API_MINOR = 1

let UC_API_MINOR = 0
let UC_API_PATCH = 2
let UC_API_EXTRA = 1
let UC_API_PATCH = 0
let UC_API_EXTRA = 255
let UC_VERSION_MAJOR = 2
let UC_VERSION_MINOR = 1

let UC_VERSION_MINOR = 0
let UC_VERSION_PATCH = 2
let UC_VERSION_EXTRA = 1
let UC_VERSION_PATCH = 0
let UC_VERSION_EXTRA = 255
let UC_SECOND_SCALE = 1000000
let UC_MILISECOND_SCALE = 1000
let UC_ARCH_ARM = 1
Expand Down Expand Up @@ -80,6 +80,7 @@ module Common =
let UC_ERR_HOOK_EXIST = 19
let UC_ERR_RESOURCE = 20
let UC_ERR_EXCEPTION = 21
let UC_ERR_OVERFLOW = 22
let UC_MEM_READ = 16
let UC_MEM_WRITE = 17
let UC_MEM_FETCH = 18
Expand Down Expand Up @@ -145,10 +146,14 @@ module Common =
let UC_CTL_TB_FLUSH = 10
let UC_CTL_TLB_FLUSH = 11
let UC_CTL_TLB_TYPE = 12
let UC_CTL_TCG_BUFFER_SIZE = 13
let UC_CTL_CONTEXT_MODE = 14

let UC_PROT_NONE = 0
let UC_PROT_READ = 1
let UC_PROT_WRITE = 2
let UC_PROT_EXEC = 4
let UC_PROT_ALL = 7
let UC_CTL_CONTEXT_CPU = 1
let UC_CTL_CONTEXT_MEMORY = 2

2 changes: 1 addition & 1 deletion bindings/dotnet/UnicornEngine/UnicornEngine.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<Copyright>Copyright © Antonio Parata 2016</Copyright>
<RepositoryUrl>https://github.com/unicorn-engine/unicorn</RepositoryUrl>
<PackageDescription>.NET bindings for unicorn</PackageDescription>
<VersionPrefix>2.0.2-rc1</VersionPrefix>
<VersionPrefix>2.1.0</VersionPrefix>
<VersionSuffix>$(VersionSuffix)</VersionSuffix>
<ProjectGuid>0c21f1c1-2725-4a46-9022-1905f85822a5</ProjectGuid>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
Expand Down
2 changes: 1 addition & 1 deletion bindings/dotnet/UnicornSamples/UnicornSamples.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<AssemblyName>UnicornSamples</AssemblyName>
<Copyright>Copyright © Antonio Parata 2016</Copyright>
<RepositoryUrl>https://github.com/unicorn-engine/unicorn</RepositoryUrl>
<Version>2.0.2-rc1</Version>
<Version>2.1.0</Version>
<ProjectGuid>{B80B5987-1E24-4309-8BF9-C4F91270F21C}</ProjectGuid>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
</PropertyGroup>
Expand Down
17 changes: 11 additions & 6 deletions bindings/go/unicorn/unicorn_const.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ package unicorn
// For Unicorn Engine. AUTO-GENERATED FILE, DO NOT EDIT [unicorn_const.go]
const (
API_MAJOR = 2
API_MINOR = 1

API_MINOR = 0
API_PATCH = 2
API_EXTRA = 1
API_PATCH = 0
API_EXTRA = 255
VERSION_MAJOR = 2
VERSION_MINOR = 1

VERSION_MINOR = 0
VERSION_PATCH = 2
VERSION_EXTRA = 1
VERSION_PATCH = 0
VERSION_EXTRA = 255
SECOND_SCALE = 1000000
MILISECOND_SCALE = 1000
ARCH_ARM = 1
Expand Down Expand Up @@ -75,6 +75,7 @@ const (
ERR_HOOK_EXIST = 19
ERR_RESOURCE = 20
ERR_EXCEPTION = 21
ERR_OVERFLOW = 22
MEM_READ = 16
MEM_WRITE = 17
MEM_FETCH = 18
Expand Down Expand Up @@ -140,10 +141,14 @@ const (
CTL_TB_FLUSH = 10
CTL_TLB_FLUSH = 11
CTL_TLB_TYPE = 12
CTL_TCG_BUFFER_SIZE = 13
CTL_CONTEXT_MODE = 14

PROT_NONE = 0
PROT_READ = 1
PROT_WRITE = 2
PROT_EXEC = 4
PROT_ALL = 7
CTL_CONTEXT_CPU = 1
CTL_CONTEXT_MEMORY = 2
)
21 changes: 21 additions & 0 deletions bindings/java/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
cmake_minimum_required(VERSION 3.1)

find_package(JNI)

if (JNI_FOUND)
message (STATUS "JNI_INCLUDE_DIRS=${JNI_INCLUDE_DIRS}")
message (STATUS "JNI_LIBRARIES=${JNI_LIBRARIES}")
else()
message(FATAL_ERROR "JNI not found, please try to update JAVA_HOME accordingly")
endif()

add_library(unicorn_java SHARED unicorn_Unicorn.c)

message("${CMAKE_CURRENT_SOURCE_DIR}/bindings/java/target/headers")

if (NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/target/headers")
message(FATAL_ERROR "bindings/java/target/headers not generated, please generate them firstly")
endif()

target_include_directories(unicorn_java PRIVATE target/headers ${JNI_INCLUDE_DIRS})
target_link_libraries(unicorn_java PRIVATE unicorn ${JNI_LIBRARIES})
3 changes: 3 additions & 0 deletions bindings/java/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ unicorn_Unicorn.o: unicorn_Unicorn.c target/headers/unicorn_Unicorn.h
libunicorn_java$(LIB_EXT): $(OBJS)
$(CC) -o $@ $(LDFLAGS) $(OBJS) $(LIBS)

gen_const:
cd .. && python3 const_generator.py java

clean:
rm -f libunicorn_java$(LIB_EXT)
rm -f $(OBJS)
Expand Down
2 changes: 1 addition & 1 deletion bindings/java/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>org.unicorn-engine</groupId>
<artifactId>unicorn</artifactId>
<version>2.0</version>
<version>2.1.0</version>

<name>unicorn</name>
<url>https://www.unicorn-engine.org</url>
Expand Down
15 changes: 9 additions & 6 deletions bindings/java/src/main/java/unicorn/UnicornConst.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@

public interface UnicornConst {
public static final int UC_API_MAJOR = 2;
public static final int UC_API_MINOR = 1;

public static final int UC_API_MINOR = 0;
public static final int UC_API_PATCH = 2;
public static final int UC_API_EXTRA = 1;
public static final int UC_API_PATCH = 0;
public static final int UC_API_EXTRA = 255;
public static final int UC_VERSION_MAJOR = 2;
public static final int UC_VERSION_MINOR = 1;

public static final int UC_VERSION_MINOR = 0;
public static final int UC_VERSION_PATCH = 2;
public static final int UC_VERSION_EXTRA = 1;
public static final int UC_VERSION_PATCH = 0;
public static final int UC_VERSION_EXTRA = 255;
public static final int UC_SECOND_SCALE = 1000000;
public static final int UC_MILISECOND_SCALE = 1000;
public static final int UC_ARCH_ARM = 1;
Expand Down Expand Up @@ -144,11 +144,14 @@ public interface UnicornConst {
public static final int UC_CTL_TLB_FLUSH = 11;
public static final int UC_CTL_TLB_TYPE = 12;
public static final int UC_CTL_TCG_BUFFER_SIZE = 13;
public static final int UC_CTL_CONTEXT_MODE = 14;

public static final int UC_PROT_NONE = 0;
public static final int UC_PROT_READ = 1;
public static final int UC_PROT_WRITE = 2;
public static final int UC_PROT_EXEC = 4;
public static final int UC_PROT_ALL = 7;
public static final int UC_CTL_CONTEXT_CPU = 1;
public static final int UC_CTL_CONTEXT_MEMORY = 2;

}
17 changes: 11 additions & 6 deletions bindings/pascal/unicorn/UnicornConst.pas
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
interface

const UC_API_MAJOR = 2;
UC_API_MINOR = 1;

UC_API_MINOR = 0;
UC_API_PATCH = 2;
UC_API_EXTRA = 1;
UC_API_PATCH = 0;
UC_API_EXTRA = 255;
UC_VERSION_MAJOR = 2;
UC_VERSION_MINOR = 1;

UC_VERSION_MINOR = 0;
UC_VERSION_PATCH = 2;
UC_VERSION_EXTRA = 1;
UC_VERSION_PATCH = 0;
UC_VERSION_EXTRA = 255;
UC_SECOND_SCALE = 1000000;
UC_MILISECOND_SCALE = 1000;
UC_ARCH_ARM = 1;
Expand Down Expand Up @@ -78,6 +78,7 @@ interface
UC_ERR_HOOK_EXIST = 19;
UC_ERR_RESOURCE = 20;
UC_ERR_EXCEPTION = 21;
UC_ERR_OVERFLOW = 22;
UC_MEM_READ = 16;
UC_MEM_WRITE = 17;
UC_MEM_FETCH = 18;
Expand Down Expand Up @@ -143,12 +144,16 @@ interface
UC_CTL_TB_FLUSH = 10;
UC_CTL_TLB_FLUSH = 11;
UC_CTL_TLB_TYPE = 12;
UC_CTL_TCG_BUFFER_SIZE = 13;
UC_CTL_CONTEXT_MODE = 14;

UC_PROT_NONE = 0;
UC_PROT_READ = 1;
UC_PROT_WRITE = 2;
UC_PROT_EXEC = 4;
UC_PROT_ALL = 7;
UC_CTL_CONTEXT_CPU = 1;
UC_CTL_CONTEXT_MEMORY = 2;

implementation
end.
107 changes: 107 additions & 0 deletions bindings/python/.gdb_history
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
q
rr
r
bt
b tcg.c:3075
r
p ts
p *ts
bt
q
b translate.c:4810
r
q
r
b translate.c:4810
frame level 5
frame level 7
q
r
bt
q
r
bt
q
r
bt
b translate.c:4810
r
p/x s->pc
n
n
n
n
n
n
n
n
p/x aflag
n
n
n
p/x dflag
n
n
n
n
p/x f
n
s
n
n
n
n
n
n
n
n
n
n
n
n
n
n
n
q
r
bt
q
r
bt
frame level 7
p/x op
p op
p *op
q
b tcg_optimize
r
b tcg_optimize_x86_64
r
n
s
s
s
q
r
exit
b tcg_dump_ops
r
b tcg_dump_ops
b tcg_dump_ops_x86_64
r
b tcg_optimize_x86_64
r
b tcg_optimize_x86_64
r
b tcg_optimize_x86_64
r
b print_log
r
b print_log
r
f fprintf
q
b write
r
bt
q
2 changes: 1 addition & 1 deletion bindings/python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
UC_DIR = SRC_DIR if os.path.exists(SRC_DIR) else os.path.join(ROOT_DIR, '../..')
BUILD_DIR = os.path.join(UC_DIR, 'build_python')

VERSION = "2.0.2"
VERSION = "2.1.0"

if SYSTEM == 'darwin':
LIBRARY_FILE = "libunicorn.2.dylib"
Expand Down
Loading

0 comments on commit 67f08b1

Please sign in to comment.