fix conflicts

This commit is contained in:
Nguyen Anh Quynh
2022-01-28 10:30:51 +08:00
992 changed files with 411332 additions and 181405 deletions

16
.clang-format Normal file
View File

@ -0,0 +1,16 @@
BasedOnStyle: LLVM
IndentWidth: 4
UseTab: Never
BreakBeforeBraces: Linux
AllowShortIfStatementsOnASingleLine: Never
AllowShortCaseLabelsOnASingleLine: false
AllowShortBlocksOnASingleLine: Empty
AllowShortFunctionsOnASingleLine: Empty
AllowShortLoopsOnASingleLine: false
IndentCaseLabels: false
ColumnLimit: 80
SortIncludes: false
AllowShortLambdasOnASingleLine: Inline
AlwaysBreakBeforeMultilineStrings: false
BreakStringLiterals: true
PointerAlignment: Right

83
.github/workflows/Crate-publishing.yml vendored Normal file
View File

@ -0,0 +1,83 @@
name: Crate 📦 Distribution
on:
push:
paths-ignore:
- ".gitignore"
- "docs/**"
- "README"
- "CREDITS.TXT"
- "COPYING_GLIB"
- "COPYING.LGPL2"
- "AUTHORS.TXT"
- "CHANGELOG"
- "COPYING"
pull_request:
env:
UNICORN_VERSION: dev
jobs:
build:
runs-on: ${{ matrix.config.os }}
name: ${{ matrix.config.name }}
strategy:
fail-fast: false
matrix:
config:
- {
os: windows-latest,
arch: x64,
name: 'Windows x86_64'
}
- {
os: windows-latest,
arch: x32,
name: 'Windows x86'
}
- {
os: ubuntu-latest,
arch: x64,
name: 'Ubuntu x86_64'
}
- {
os: macos-latest,
arch: x64,
name: 'macOS x86_64'
}
steps:
- uses: actions/checkout@v2
- name: '🛠️ Set up Rust'
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
default: true
- name: '🛠️ Add msbuild to PATH'
if: contains(matrix.config.os, 'win')
uses: microsoft/setup-msbuild@v1.0.3
with:
vs-version: '16.5'
- name: '🛠️ Win build dependencies'
if: contains(matrix.config.os, 'win')
shell: bash
run: |
choco install ninja cmake
- name: '🚧 Cargo test'
if: "!startsWith(github.ref, 'refs/tags')"
env:
UNICORN_LOCAL: uc
run: |
cd bindings/rust && cargo test
- name: '📦 Cargo Publish'
if: startsWith(github.ref, 'refs/tags') && contains(matrix.config.os, 'ubuntu')
env:
TOKEN: ${{ secrets.cratesio_token }}
UNICORN_VERSION: dev
run: |
cd bindings/rust && cargo login $TOKEN && cargo test && cargo publish

123
.github/workflows/PyPI-publishing.yml vendored Normal file
View File

@ -0,0 +1,123 @@
name: PyPI 📦 Distribution
on:
push:
paths-ignore:
- ".gitignore"
- "docs/**"
- "README"
- "CREDITS.TXT"
- "COPYING_GLIB"
- "COPYING.LGPL2"
- "AUTHORS.TXT"
- "CHANGELOG"
- "COPYING"
pull_request:
jobs:
build:
runs-on: ${{ matrix.config.os }}
name: ${{ matrix.config.name }}
strategy:
fail-fast: false
matrix:
config:
- {
os: windows-latest,
arch: x64,
python-ver: '3.8',
name: 'win_amd64'
}
- {
os: windows-latest,
arch: x32,
python-ver: '3.8',
name: 'win32'
}
- {
os: ubuntu-latest,
arch: x64,
python-ver: '3.8',
name: 'manylinux2014_x86_64'
}
- {
os: ubuntu-latest,
arch: x32,
python-ver: '3.8',
name: 'manylinux2014_i686'
}
- {
os: ubuntu-latest,
arch: x64,
python-ver: '3.8',
name: 'sdist'
}
- {
os: macos-latest,
arch: x64,
python-ver: '3.8',
name: 'macos_x86_64'
}
steps:
- uses: actions/checkout@v2
- name: '🛠️ Set up Python'
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.config.python-ver }}
- name: '🛠️ Add msbuild to PATH'
if: contains(matrix.config.name, 'win')
uses: microsoft/setup-msbuild@v1.0.3
with:
vs-version: '16.5'
- name: '🛠️ Win build dependencies'
if: contains(matrix.config.name, 'win')
shell: bash
run: |
choco install ninja cmake
- name: '🛠️ Install dependencies'
run: |
pip install setuptools wheel
- name: '🚧 Build distribution'
shell: bash
run: |
if [ ${{ matrix.config.name }} == 'win32' ]; then
cd bindings/python && python setup.py build -p win32 sdist bdist_wheel -p win32
rm dist/*.tar.gz
elif [ ${{ matrix.config.name }} == 'manylinux2014_i686' ]; then
docker run --rm -v `pwd`/:/work dockcross/manylinux2014-x86 > ./dockcross
chmod +x ./dockcross
./dockcross bindings/python/build_wheel.sh
elif [ ${{ matrix.config.name }} == 'manylinux2014_x86_64' ]; then
docker run --rm -v `pwd`/:/work dockcross/manylinux2014-x64 > ./dockcross
chmod +x ./dockcross
./dockcross bindings/python/build_wheel.sh
elif [ ${{ matrix.config.name }} == 'sdist' ]; then
cd bindings/python && python setup.py sdist
else
cd bindings/python && python setup.py bdist_wheel
fi
- name: '📤 Upload artifact'
uses: actions/upload-artifact@v2
with:
path: ${{ github.workspace }}/bindings/python/dist/*
publish:
needs: [build]
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags')
steps:
- uses: actions/download-artifact@v2
with:
name: artifact
path: dist
- name: '📦 Publish distribution to PyPI'
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.pypi_pass }}

440
.github/workflows/build-uc2.yml vendored Normal file
View File

@ -0,0 +1,440 @@
name: Build UC2
on:
push:
paths-ignore:
- ".gitignore"
- "docs/**"
- "README"
- "CREDITS.TXT"
- "COPYING_GLIB"
- "COPYING.LGPL2"
- "AUTHORS.TXT"
- "CHANGELOG"
- "COPYING"
pull_request:
env:
CI: true
jobs:
Windows:
runs-on: ${{ matrix.config.os }}
name: ${{ matrix.config.name }}
strategy:
fail-fast: false
matrix:
config:
- {
os: windows-latest,
arch: x64,
python-arch: x64,
python-ver: '3.8',
name: 'windows-x64 MINGW64',
mingw: MINGW64,
mingw-arch: x86_64,
artifact: 'windows_mingw64.7z',
build_type: 'Debug',
archiver: '7z a',
generators: 'Ninja'
}
- {
os: windows-latest,
arch: x64,
python-arch: x64,
python-ver: '3.8',
name: 'windows-x64 MINGW32',
mingw: MINGW32,
mingw-arch: i686,
artifact: 'windows_mingw32.7z',
build_type: 'Debug',
archiver: '7z a',
generators: 'Ninja'
}
- {
os: windows-latest,
arch: x64,
python-arch: x64,
python-ver: '3.8',
name: 'windows-x64 MSVC 64bit',
msvc-arch: x64,
artifact: 'windows_msvc64.7z',
build_type: 'Debug',
archiver: '7z a',
generators: 'Visual Studio 16 2019'
}
- {
os: windows-latest,
arch: x86,
python-arch: x86,
python-ver: '3.8',
name: 'windows-x86 MSVC 32bit',
msvc-arch: x86,
artifact: 'windows_msvc32.7z',
build_type: 'Debug',
archiver: '7z a',
generators: 'Visual Studio 16 2019'
}
compiler: [ gcc ]
steps:
- uses: actions/checkout@v2
- name: '🛠️ Win MINGW setup'
if: contains(matrix.config.mingw, 'MINGW')
uses: msys2/setup-msys2@v2
with:
msystem: ${{ matrix.config.mingw }}
install: >-
git
mingw-w64-${{ matrix.config.mingw-arch }}-cmake
mingw-w64-${{ matrix.config.mingw-arch }}-ninja
mingw-w64-${{ matrix.config.mingw-arch }}-cmocka
mingw-w64-${{ matrix.config.mingw-arch }}-${{ matrix.compiler }}
mingw-w64-${{ matrix.config.mingw-arch }}-toolchain
- name: '🛠️ Win MSVC 64 setup'
if: contains(matrix.config.name, 'MSVC 64')
uses: microsoft/setup-msbuild@v1
- name: '🚧 Win MSVC 64 build'
if: contains(matrix.config.name, 'MSVC 64')
shell: bash
run: |
choco install ninja cmake
ninja --version
cmake --version
mkdir build
cmake \
-S . \
-B . \
-DCMAKE_BUILD_TYPE=${{ matrix.config.build_type }} \
-G "${{ matrix.config.generators }}" \
-DCMAKE_INSTALL_PREFIX:PATH=instdir
cmake --build . --config ${{ matrix.config.build_type }}
cmake --install . --strip --config ${{ matrix.config.build_type }}
ctest -VV -C ${{ matrix.config.build_type }}
mv Debug instdir
- name: '🛠️ Win MSVC 32 setup'
if: contains(matrix.config.name, 'MSVC 32')
uses: ilammy/msvc-dev-cmd@v1
with:
arch: x86
- name: '🚧 Win MSVC 32 build'
if: contains(matrix.config.name, 'MSVC 32')
shell: bash
run: |
choco install ninja cmake
ninja --version
cmake --version
mkdir build
cmake \
-S . \
-B . \
-A "win32" \
-DCMAKE_BUILD_TYPE=${{ matrix.config.build_type }} \
-G "${{ matrix.config.generators }}" \
-DCMAKE_INSTALL_PREFIX:PATH=instdir
cmake --build . --config ${{ matrix.config.build_type }}
cmake --install . --strip --config ${{ matrix.config.build_type }}
ctest -VV -C ${{ matrix.config.build_type }}
mv Debug instdir
- name: '🚧 Win MINGW build'
if: contains(matrix.config.mingw, 'MINGW')
shell: msys2 {0}
run: |
if [ ${{ matrix.config.mingw }} == 'MINGW32' ]; then
export CPPFLAGS=-D__USE_MINGW_ANSI_STDIO=1
#export CC=i686-w64-mingw32-gcc
export AR=gcc-ar
export RANLIB=gcc-ranlib
export CFLAGS="-m32"
export LDFLAGS="-m32"
export LDFLAGS_STATIC="-m32"
export UNICORN_QEMU_FLAGS="--cpu=i386"
fi
mkdir build
mkdir instdir
cmake \
-S . \
-B . \
-DCMAKE_BUILD_TYPE=${{ matrix.config.build_type }} \
-G "${{ matrix.config.generators }}" \
-DCMAKE_INSTALL_PREFIX:PATH=instdir
cmake --build . --config ${{ matrix.config.build_type }}
cmake --install . --strip
ctest -VV -C ${{ matrix.config.build_type }}
- name: '📦 Pack artifact'
if: always()
shell: bash
working-directory: instdir
run: |
ls -laR
${{ matrix.config.archiver }} ../${{ matrix.config.artifact }} . ../test*
- name: '📤 Upload artifact'
if: always()
uses: actions/upload-artifact@v1
with:
path: ./${{ matrix.config.artifact }}
name: ${{ matrix.config.artifact }}
Macos:
runs-on: ${{ matrix.config.os }}
name: ${{ matrix.config.name }} - ${{ matrix.compiler }}
strategy:
fail-fast: false
matrix:
config:
- {
os: macos-latest,
arch: x64,
python-arch: x64,
python-ver: '3.8',
name: 'macos-x64 cmake',
artifact: 'macos-cmake-x64.7z',
build_type: 'Debug',
archiver: '7za a',
generators: 'Ninja'
}
- {
os: macos-11,
arch: x86_64,
python-arch: x86_64,
python-ver: '3.8',
name: 'android cmake',
artifact: 'Android-x86_64.7z',
build_type: 'Debug',
archiver: '7za a',
generators: 'Ninja'
}
compiler: [ gcc ]
steps:
- uses: actions/checkout@v2
# - name: '🛠️ Python setup'
# uses: actions/setup-python@v2
# with:
# python-version: ${{ matrix.config.python-ver }}
- name: '🚧 Mac build'
if: contains(matrix.config.name, 'macos-x64')
shell: bash
run: |
brew install p7zip cmake ninja
ninja --version
cmake --version
mkdir build
mkdir instdir
cmake \
-S . \
-B . \
-DCMAKE_BUILD_TYPE=${{ matrix.config.build_type }} \
-G "${{ matrix.config.generators }}" \
-DCMAKE_INSTALL_PREFIX:PATH=instdir
cmake --build . --config ${{ matrix.config.build_type }}
cmake --install . --strip
ctest -VV -C ${{ matrix.config.build_type }}
- name: '🚧 Android x86_64 build'
if: contains(matrix.config.name, 'android')
shell: bash
run: |
brew install p7zip cmake ninja
mkdir build
mkdir instdir
cmake . -DCMAKE_TOOLCHAIN_FILE="$ANDROID_HOME/ndk/21.4.7075529/build/cmake/android.toolchain.cmake" \
-DANDROID_PLATFORM=android-28 \
-DANDROID_NDK="$ANDROID_HOME/ndk/21.4.7075529" \
-DANDROID_ABI=${{ matrix.config.arch }} \
-DOLP_SDK_ENABLE_TESTING=NO \
-DOLP_SDK_BUILD_EXAMPLES=ON \
-S . \
-B . \
-DCMAKE_BUILD_TYPE=${{ matrix.config.build_type }} \
-G "${{ matrix.config.generators }}" \
-DCMAKE_INSTALL_PREFIX:PATH=instdir
cmake --build . --config ${{ matrix.config.build_type }}
cmake --install . --strip
- name: '🚧 AVD Cache'
if: contains(matrix.config.name, 'android')
uses: actions/cache@v2
id: avd-cache
with:
path: |
~/.android/avd/*
~/.android/adb*
key: avd-28
- name: '🚧 Create x86_64 tests environment'
if: contains(matrix.config.name, 'android') && steps.avd-cache.outputs.cache-hit != 'true'
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 28
arch: ${{ matrix.config.arch }}
force-avd-creation: false
disable-animations: false
target: default
profile: Nexus 6
emulator-options: -no-window -gpu swiftshader_indirect -no-snapshot -noaudio -no-boot-anim -verbose -show-kernel
script: echo "Generated AVD snapshot for caching."
- name: '🚧 Android x86_64 tests'
if: contains(matrix.config.name, 'android')
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 28
force-avd-creation: false
disable-animations: true
arch: ${{ matrix.config.arch }}
target: default
profile: Nexus 6
emulator-options: -no-window -gpu swiftshader_indirect -no-snapshot -noaudio -no-boot-anim -verbose -show-kernel
script: bash ./adb.sh
- name: '📦 Pack artifact'
if: always()
shell: bash
working-directory: instdir
run: |
ls -laR
${{ matrix.config.archiver }} ../${{ matrix.config.artifact }} . ../test*
- name: '📤 Upload artifact'
if: always()
uses: actions/upload-artifact@v1
with:
path: ./${{ matrix.config.artifact }}
name: ${{ matrix.config.artifact }}
Linux:
runs-on: ${{ matrix.config.os }}
name: ${{ matrix.config.name }} - ${{ matrix.compiler }}
strategy:
fail-fast: false
matrix:
config:
- {
os: ubuntu-latest,
arch: x64,
python-arch: x64,
python-ver: '3.8',
name: 'ubuntu-x64 cmake',
artifact: 'ubuntu-cmake-x64.7z',
build_type: 'Debug',
archiver: '7z a',
generators: 'Ninja'
}
- {
os: ubuntu-latest,
arch: x86,
python-arch: x86,
python-ver: '3.8',
name: 'ubuntu-x86 cmake',
artifact: 'ubuntu-cmake-x86.7z',
build_type: 'Debug',
archiver: '7z a',
generators: 'Ninja'
}
- {
os: ubuntu-latest,
arch: aarch64,
python-arch: aarch64,
python-ver: '3.8',
name: 'ubuntu-aarch64 cmake',
artifact: 'ubuntu-cmake-aarch64.7z',
build_type: 'Debug',
archiver: '7z a',
generators: 'Ninja',
distro: ubuntu20.04
}
- {
os: ubuntu-latest,
arch: ppc64le,
python-arch: ppc,
python-ver: '3.8',
name: 'ubuntu-ppc64le cmake',
artifact: 'ubuntu-cmake-ppc64le.7z',
build_type: 'Debug',
archiver: '7z a',
generators: 'Ninja',
distro: ubuntu20.04
}
compiler: [ gcc ]
steps:
- uses: actions/checkout@v2
# - name: '🛠️ Python setup'
# uses: actions/setup-python@v2
# with:
# python-version: ${{ matrix.config.python-ver }}
- name: '🚧 Linux x64/x86 build'
if: contains(matrix.config.arch, 'x64') || contains(matrix.config.arch, 'x86')
shell: 'script -q -e -c "bash {0}"'
run: |
if [ ${{ matrix.config.arch }} == 'x64' ]; then
sudo apt install -q -y libcmocka-dev ninja-build
else
export CFLAGS="-m32" LDFLAGS="-m32" LDFLAGS_STATIC="-m32" UNICORN_QEMU_FLAGS="--cpu=i386"
sudo dpkg --add-architecture i386
sudo apt install -q -y lib32ncurses-dev lib32z1-dev lib32gcc-9-dev libc6-dev-i386 gcc-multilib \
libcmocka-dev:i386 libcmocka0:i386 libc6:i386 libgcc-s1:i386 ninja-build
fi
mkdir build
mkdir instdir
cmake \
-S . \
-B . \
-DCMAKE_BUILD_TYPE=${{ matrix.config.build_type }} \
-G "${{ matrix.config.generators }}" \
-DCMAKE_INSTALL_PREFIX:PATH=instdir
cmake --build . --config ${{ matrix.config.build_type }}
cmake --install . --strip
ctest -VV -C ${{ matrix.config.build_type }}
- name: '🚧 Linux ppc64le/aarch64 build'
if: contains(matrix.config.arch, 'ppc64le') || contains(matrix.config.arch, 'aarch64')
uses: uraimo/run-on-arch-action@v2.0.5
with:
arch: ${{ matrix.config.arch }}
distro: ${{ matrix.config.distro }}
setup: |
mkdir -p "${PWD}/instdir"
dockerRunArgs: |
--volume "${PWD}/instdir:/instdir"
shell: /bin/sh
install: |
apt-get update -q -y
apt-get install -q -y git cmake build-essential automake libcmocka-dev pkg-config ${{ matrix.compiler }} ninja-build
run: |
mkdir build
cmake \
-S . \
-B . \
-DCMAKE_BUILD_TYPE=${{ matrix.config.build_type }} \
-G "${{ matrix.config.generators }}" \
-DCMAKE_INSTALL_PREFIX:PATH=/instdir
cmake --build . --config ${{ matrix.config.build_type }}
cmake --install . --strip
ctest -VV -C ${{ matrix.config.build_type }}
- name: '📦 Pack artifact'
if: always()
shell: bash
working-directory: instdir
run: |
ls -laR
${{ matrix.config.archiver }} ../${{ matrix.config.artifact }} . ../test*
- name: '📤 Upload artifact'
if: always()
uses: actions/upload-artifact@v1
with:
path: ./${{ matrix.config.artifact }}
name: ${{ matrix.config.artifact }}

View File

@ -1,23 +0,0 @@
name: CIFuzz
on: [pull_request]
jobs:
Fuzzing:
runs-on: ubuntu-latest
steps:
- name: Build Fuzzers
uses: google/oss-fuzz/infra/cifuzz/actions/build_fuzzers@master
with:
oss-fuzz-project-name: 'unicorn'
dry-run: false
- name: Run Fuzzers
uses: google/oss-fuzz/infra/cifuzz/actions/run_fuzzers@master
with:
oss-fuzz-project-name: 'unicorn'
fuzz-seconds: 600
dry-run: false
- name: Upload Crash
uses: actions/upload-artifact@v1
if: failure()
with:
name: artifacts
path: ./out/artifacts

View File

@ -1,67 +0,0 @@
name: PyPI 📦 Distribution
on: [push]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [windows-latest, macos-latest, ubuntu-latest]
platform: [x32, x64]
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Set up MSVC
if: matrix.os == 'windows-latest'
uses: microsoft/setup-msbuild@v1
- name: Install dependencies
run: |
pip install setuptools wheel
- name: Build distribution 📦
shell: bash
run: |
if [ ${{ matrix.platform }} == 'x32' ] && [ ${{ matrix.os }} == 'windows-latest' ]; then
cd bindings/python && python setup.py build -p win32 sdist bdist_wheel -p win32
rm dist/*.tar.gz
elif [ ${{ matrix.platform }} == 'x32' ] && [ ${{ matrix.os }} == 'ubuntu-latest' ]; then
docker run --rm -v `pwd`/:/work dockcross/manylinux1-x86 > ./dockcross
chmod +x ./dockcross
./dockcross bindings/python/build_wheel.sh
elif [ ${{ matrix.platform }} == 'x64' ] && [ ${{ matrix.os }} == 'ubuntu-latest' ]; then
docker run --rm -v `pwd`/:/work dockcross/manylinux1-x64 > ./dockcross
chmod +x ./dockcross
./dockcross bindings/python/build_wheel.sh
elif [ ${{ matrix.platform }} == 'x32' ] && [ ${{ matrix.os }} == 'macos-latest' ]; then
cd bindings/python && python setup.py sdist
else
cd bindings/python && python setup.py bdist_wheel
fi
- uses: actions/upload-artifact@v2
with:
path: ${{ github.workspace }}/bindings/python/dist/*
publish:
needs: [build]
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags')
steps:
- uses: actions/download-artifact@v2
with:
name: artifact
path: dist
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.pypi_pass }}

7
.gitignore vendored
View File

@ -12,8 +12,6 @@
*.jar
*~
qemu/config-all-devices.mak
qemu/aarch64-softmmu/
qemu/aarch64eb-softmmu/
qemu/arm-softmmu/
@ -29,6 +27,8 @@ qemu/i386-softmmu/
qemu/x86_64-softmmu/
qemu/ppc-softmmu/
qemu/ppc64-softmmu/
qemu/riscv32-softmmu/
qemu/riscv64-softmmu/
tags
qemu/config-host.ld
@ -60,6 +60,7 @@ _*.txt
_*.diff
tmp/
bindings/java/unicorn_Unicorn.h
bindings/python/build/
bindings/python/dist/
bindings/python/src/
@ -97,6 +98,8 @@ config.log
x64/
Win32/
build/
build_*
rust_build
[Bb]in/
[Oo]bj/
packages/

3
.gitmodules vendored Normal file
View File

@ -0,0 +1,3 @@
[submodule "docs/Unicorn_Engine_Documentation"]
path = docs/Unicorn_Engine_Documentation
url = https://github.com/kabeor/Unicorn-Engine-Documentation

View File

@ -1,353 +0,0 @@
language: c
env:
- PATH=$PATH:/usr/local/opt/binutils/bin
script:
- |
if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then
if [[ "$TRAVIS_COMPILER" == "clang" ]]; then
choco install cygwin cyg-get && \
cyg-get.bat default autoconf automake make gcc-core clang pkg-config libpcre-devel cmake python27-setuptools ruby wget && \
export SHELLOPTS && set -o igncr && \
cmd.exe //C "C:\\tools\\cygwin\\bin\\bash.exe -lc 'cd /cygdrive/$TRAVIS_BUILD_DIR; make header; make'"
else
choco install cygwin cyg-get && \
cyg-get.bat default autoconf automake make gcc-core clang pkg-config libpcre-devel cmake python27-setuptools ruby wget && \
export SHELLOPTS && set -o igncr && \
cmd.exe //C "C:\\tools\\cygwin\\bin\\bash.exe -lc 'cd /cygdrive/$TRAVIS_BUILD_DIR; make header; make; ./install-cmocka-linux.sh; export PATH="$PATH":/cygdrive/$TRAVIS_BUILD_DIR:/cygdrive/$TRAVIS_BUILD_DIR/cmocka/src; make test'"
fi
elif [[ "$TRAVIS_CPU_ARCH" == "arm64" ]]; then
make header && make && make -C tests/unit test && make -C tests/regress test
else
make header && make && make -C bindings/go && make -C bindings/go test && make test
fi
compiler:
- clang
- gcc
os:
- linux
- windows
arch:
- amd64
- arm64
matrix:
fast_finish: true
exclude:
- os: windows
arch: arm64
include:
- name: "Compiler: clang C"
os: osx
osx_image: xcode10.1
python: 3.7
compiler: clang
before_cache:
- brew cleanup
- find /usr/local/Homebrew \! -regex ".+\.git.+" -delete;
cache:
directories:
- $HOME/Library/Caches/Homebrew
- /usr/local/Homebrew
before_install:
- cd /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core && git stash && git clean -d -f
script:
- cd $TRAVIS_BUILD_DIR
- make header && make && make -C bindings/go && make -C bindings/go test && make test
- name: "Compiler: gcc C"
os: osx
osx_image: xcode10.1
python: 3.7
compiler: gcc
before_cache:
- brew cleanup
- find /usr/local/Homebrew \! -regex ".+\.git.+" -delete;
cache:
directories:
- $HOME/Library/Caches/Homebrew
- /usr/local/Homebrew
before_install:
- cd /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core && git stash && git clean -d -f
script:
- cd $TRAVIS_BUILD_DIR
- make header && make && make -C bindings/go && make -C bindings/go test && make test
- name: "Linux clang ASAN"
os: linux
compiler: clang
env:
- PATH=$PATH:/usr/local/opt/binutils/bin
- ASAN_OPTIONS=detect_leaks=0
- CXXFLAGS="-DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION -fsanitize=address -fsanitize=fuzzer-no-link"
- CFLAGS="-DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION -fsanitize=address -fsanitize=fuzzer-no-link"
- LDFLAGS="-fsanitize=address"
script:
- make header && make
- make -C tests/fuzz && sh tests/fuzz/dlcorpus.sh
- name: "Linux clang MSAN"
os: linux
compiler: clang
env:
- PATH=$PATH:/usr/local/opt/binutils/bin
- ASAN_OPTIONS=detect_leaks=0
- CXXFLAGS="-DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION -fsanitize=memory -fsanitize=fuzzer-no-link"
- CFLAGS="-DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION -fsanitize=memory -fsanitize=fuzzer-no-link"
- LDFLAGS="-fsanitize=memory"
script:
- make header && make
- make -C tests/fuzz && sh tests/fuzz/dlcorpus.sh
- name: "Linux clang USAN"
os: linux
compiler: clang
env:
- PATH=$PATH:/usr/local/opt/binutils/bin
- ASAN_OPTIONS=detect_leaks=0
- CXXFLAGS="-DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION -fsanitize=undefined -fsanitize=fuzzer-no-link"
- CFLAGS="-DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION -fsanitize=undefined -fsanitize=fuzzer-no-link"
- LDFLAGS="-fsanitize=undefined"
script:
- make header && make
- make -C tests/fuzz && sh tests/fuzz/dlcorpus.sh
- name: "Linux 32bit"
os: linux
compiler: gcc
env:
- CFLAGS="-m32" LDFLAGS="-m32" LDFLAGS_STATIC="-m32" UNICORN_QEMU_FLAGS="--cpu=i386"
- PATH=$PATH:/usr/local/opt/binutils/bin
script: make header && make && make -C tests/unit test && make -C tests/regress test
addons:
apt:
packages:
- lib32ncurses5-dev
- lib32z1-dev
- libpthread-stubs0-dev
- lib32gcc-4.8-dev
- libc6-dev-i386
- gcc-multilib
- libcmocka-dev:i386
- name: "Linux Cmake 32bit"
os: linux
compiler: gcc
env:
- CFLAGS="-m32" LDFLAGS="-m32" LDFLAGS_STATIC="-m32" UNICORN_QEMU_FLAGS="--cpu=i386"
- PATH=$PATH:/usr/local/opt/binutils/bin
script:
- mkdir build
- cd build
- ../cmake.sh x86
- cp libunicorn.* ../
- make -C ../tests/unit test && make -C ../tests/regress test
addons:
apt:
packages:
- lib32ncurses5-dev
- lib32z1-dev
- libpthread-stubs0-dev
- lib32gcc-4.8-dev
- libc6-dev-i386
- gcc-multilib
- libcmocka-dev:i386
- name: "Linux Cmake 64bit"
os: linux
compiler: gcc
env:
- PATH=$PATH:/usr/local/opt/binutils/bin
script:
- mkdir build
- cd build
- ../cmake.sh
- cp libunicorn.* ../
- make -C ../tests/unit test && make -C ../tests/regress test
- name: "Linux Cmake Static 32bit"
os: linux
compiler: gcc
env:
- CFLAGS="-m32" LDFLAGS="-m32" LDFLAGS_STATIC="-m32" UNICORN_QEMU_FLAGS="--cpu=i386"
- PATH=$PATH:/usr/local/opt/binutils/bin
script:
- mkdir build
- cd build
- cmake -DCMAKE_BUILD_TYPE=Release -DUNICORN_ARCH=x86 -DUNICORN_BUILD_SHARED=OFF .. && make -j8
# temporarily disable test for static build
# - cp libunicorn.* ../
# - make -C ../tests/unit test && make -C ../tests/regress test
addons:
apt:
packages:
- lib32ncurses5-dev
- lib32z1-dev
- libpthread-stubs0-dev
- lib32gcc-4.8-dev
- libc6-dev-i386
- gcc-multilib
- libcmocka-dev:i386
- name: "Linux Cmake Static 64bit"
os: linux
compiler: gcc
env:
- PATH=$PATH:/usr/local/opt/binutils/bin
script:
- mkdir build
- cd build
- cmake -DCMAKE_BUILD_TYPE=Release -DUNICORN_BUILD_SHARED=OFF .. && make -j8
# - cp libunicorn.* ../
# - make -C ../tests/unit test && make -C ../tests/regress test
- name: "MacOSX brew"
os: osx
osx_image: xcode10.1
python: 3.7
before_cache:
- brew cleanup
- find /usr/local/Homebrew \! -regex ".+\.git.+" -delete;
cache:
directories:
- $HOME/Library/Caches/Homebrew
- /usr/local/Homebrew
before_install:
- cd /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core && git stash && git clean -d -f
script:
- brew install --HEAD unicorn
- brew test unicorn
- name: "Windows nmake 32bit"
os: windows
language: shell
script:
- mkdir build
- cd build
- cmd.exe //C 'C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Auxiliary\Build\vcvarsall.bat' x86 '&' cmd.exe //C '..\nmake.bat' x86
- name: "Windows nmake 64bit"
os: windows
language: shell
script:
- mkdir build
- cd build
- cmd.exe //C 'C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Auxiliary\Build\vcvarsall.bat' amd64 '&' cmd.exe //C '..\nmake.bat'
- name: "Windows MSVC 32bit"
os: windows
language: shell
env:
- MSBUILD_PATH="C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin"
script:
- PATH=$MSBUILD_PATH:$PATH
- cmd.exe //C 'msbuild.exe msvc/unicorn.sln /m:2 /nologo /p:Configuration=Release /p:Platform=Win32'
- name: "Windows MSVC 64bit"
os: windows
language: shell
env:
- MSBUILD_PATH="C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin"
script:
- PATH=$MSBUILD_PATH:$PATH
- cmd.exe //C 'msbuild.exe msvc/unicorn.sln /m:2 /nologo /p:Configuration=Release /p:Platform=x64'
- name: "Windows MSYS2/MinGW32"
os: windows
language: shell
env:
- PATH=/C/tools/msys64/mingw32/bin:$PATH
before_install:
- |
if [[ ! -f /C/tools/msys64/msys2_shell.cmd ]]; then
rm -rf /C/tools/msys64
fi
- choco uninstall -y mingw
- choco upgrade --no-progress -y msys2
- export msys2='cmd //C RefreshEnv.cmd '
- export msys2+='& set MSYS=winsymlinks:nativestrict '
- export msys2+='& C:\\tools\\msys64\\msys2_shell.cmd -defterm -no-start'
- export shell="$msys2 -mingw32 -full-path -here -c \$\* --"
- export msys2+=" -msys2 -c \$\* --"
- $msys2 pacman --sync --noconfirm --needed \
autoconf \
automake \
make \
perl \
python \
mingw-w64-i686-libtool \
mingw-w64-i686-toolchain \
mingw-w64-i686-gcc \
mingw-w64-i686-cmake \
mingw-w64-i686-cmocka \
mingw-w64-i686-python3-setuptools \
unzip
- export CPPFLAGS=-D__USE_MINGW_ANSI_STDIO=1
- export CC=i686-w64-mingw32-gcc
- export AR=gcc-ar
- export RANLIB=gcc-ranlib
- export CFLAGS="-m32"
- export LDFLAGS="-m32"
- export LDFLAGS_STATIC="-m32"
- export UNICORN_QEMU_FLAGS="--cpu=i386"
# before_cache:
# - $msys2 pacman --sync --clean --noconfirm
# cache:
# timeout:
# 1000
# directories:
# - $HOME/AppData/Local/Temp/chocolatey
# - /C/tools/msys64
script:
- $shell make header; $shell make; cp unicorn.dll /C/Windows/SysWOW64/; $shell make test
- name: "Windows MSYS2/MinGW64"
os: windows
language: shell
env:
- PATH=/C/tools/msys64/mingw64/bin:$PATH
before_install:
- |
if [[ ! -f /C/tools/msys64/msys2_shell.cmd ]]; then
rm -rf /C/tools/msys64
fi
- choco uninstall -y mingw
- choco upgrade --no-progress -y msys2
- export msys2='cmd //C RefreshEnv.cmd '
- export msys2+='& set MSYS=winsymlinks:nativestrict '
- export msys2+='& C:\\tools\\msys64\\msys2_shell.cmd -defterm -no-start'
- export shell="$msys2 -mingw64 -full-path -here -c \$\* --"
- export msys2+=" -msys2 -c \$\* --"
- $msys2 pacman --sync --noconfirm --needed \
autoconf \
automake \
make \
perl \
python \
mingw-w64-x86_64-libtool \
mingw-w64-x86_64-toolchain \
mingw-w64-x86_64-cmake \
mingw-w64-x86_64-cmocka \
mingw-w64-x86_64-python3-setuptools
unzip
- export CPPFLAGS=-D__USE_MINGW_ANSI_STDIO=1
- export CC=x86_64-w64-mingw32-gcc
- export AR=gcc-ar
- export RANLIB=gcc-ranlib
# before_cache:
# - $msys2 pacman --sync --clean --noconfirm
# cache:
# timeout:
# 1000
# directories:
# - $HOME/AppData/Local/Temp/chocolatey
# - /C/tools/msys64
script:
- $shell make header; $shell make; cp unicorn.dll /C/Windows/System32/; $shell make test
addons:
apt:
packages:
- libpthread-stubs0-dev
- libcmocka-dev
homebrew:
update: true
brewfile: true

File diff suppressed because it is too large Load Diff

View File

@ -5,7 +5,10 @@ Key developers
==============
Nguyen Anh Quynh <aquynh -at- gmail.com>
Dang Hoang Vu <dang.hvu -at- gmail.com>
Huitao Chen (chenhuitao)
Ziqiao Kong (lazymio)
KaiJernLau (xwings)
Beta testers (in no particular order)
==============================
@ -72,5 +75,8 @@ Philippe Antoine (Catena cyber): fuzzing
Huitao Chen (chenhuitao) & KaiJern Lau (xwings): Cmake support
Huitao Chen (chenhuitao) & KaiJern Lau (xwings): Python3 support for building
Kevin Foo (chfl4gs): Travis-CI migration
Simon Gorchakov: PowerPC target
Stuart Dootson (studoot): MSVC compatibility with PowerPC target support
Ziqiao Kong (lazymio): uc_context_free() API and various bug fix & improvement.
Sven Almgren (blindmatrix): bug fix
Chenxu Wu (kabeor): Documentation

View File

@ -1,75 +1,10 @@
This file details the changelog of Unicorn Engine.
-------------------------------
[Version 1.0.3]: May 26th, 2021
----------------------------------
[Unicorn2-beta]: October 3rd, 2021
- Fix some building issues
- Fix build with LLVM on Powerpc64(le)
- cmake: enable UNICORN_HAS_ARMEB when ARM is on
- Better support MingW building
- Better support FreeBSD host
- Better support VS2008/VS2010
- Fix some issues in the core:
- Fix wrong sync after UC_ERR_[READ, WRITE, FETCH]_[UNMAPPED, PROT]
- Support querying architecture mode besides arm
- Fix pausing within Thumb2 ITE blocks
- Arm:
- Support Arm BE8 mode
- X86:
- Fix FPIP & FTST instructions
- Bindings:
- Java: remove deprecated javah and build with javac
- Python: handle exceptions raised in hook functions
- Rust binding
-----------------------------------
[Version 1.0.2]: October 21st, 2020
- Fix Java binding compilation
- Enable building for ARM little-endian only (ignore big-endian)
------------------------------------
[Version 1.0.2-rc6]: Sept 24th, 2020
- Add uc_context_free() API
- Fix context saving/retoring API (core & Python binding)
------------------------------------
[Version 1.0.2-rc5]: Sept 22nd, 2020
- Add cmake option to build Unicorn as a static library
- Fix error handling of mmap()
- uc_emu_start() can be reentrant
- Fix naming conflicts when built with systemd
- Fix setjmp/longjmp on native Windows
- Fix enabled hooks even after deleting them
- X86:
- Fix 64bit fstenv
- Fix IP value of 16bit mode
- ARM:
- Fix APSR handling
- Python: Remove UC_ERR_TIMEOUT
-----------------------------------
[Version 1.0.2-rc4]: May 29th, 2020
- No longer require Python to build
- Fix recursive UC_HOOK_MEM callbacks for cross pages access
- Remove UC_ERR_TIMEOUT, so timeout on uc_emu_start() is not considered error
- Added UC_QUERY_TIMEOUT to query exit reason
- Fix UAF when deleting hook while in hook callback
- Ensure that hooks are unaffected by a request to stop emulation.
- Fix block hooks being called twice after an early exit from execution.
- Fix binding install on python2 (MacOS)
- X86:
- Support read/write STn registers
- Support read/write X64 base regs
- ARM64:
- Support some new registers
- Release Unicorn2 beta to public.
- New logo to celebrate this important milestone!
----------------------------------
[Version 1.0.1]: April 20th, 2017

424
Makefile
View File

@ -1,424 +0,0 @@
# Unicorn Emulator Engine
# By Dang Hoang Vu <dang.hvu -at- gmail.com>, 2015
.PHONY: all clean install uninstall dist header
include config.mk
include pkgconfig.mk # package version
LIBNAME = unicorn
UNAME_S := $(shell uname -s)
# SMP_MFLAGS is used for controlling the amount of parallelism used
# in external 'make' invocations. If the user doesn't override it, it
# does "-j4". That is, it uses 4 job threads. If you want to use more or less,
# pass in a different -jX, with X being the number of threads.
# For example, to completely disable parallel building, pass "-j1".
# If you want to use 16 job threads, use "-j16".
SMP_MFLAGS := -j4
UC_GET_OBJ = $(shell for i in \
$$(grep '$(1)' $(2) | \
grep '\.o' | cut -d '=' -f 2); do \
echo $$i | grep '\.o' > /dev/null 2>&1; \
if [ $$? = 0 ]; then \
echo '$(3)'$$i; \
fi; done; echo)
UC_TARGET_OBJ = $(filter-out qemu/../%,$(call UC_GET_OBJ,obj-,qemu/Makefile.objs, qemu/))
UC_TARGET_OBJ += $(call UC_GET_OBJ,obj-,qemu/hw/core/Makefile.objs, qemu/hw/core/)
UC_TARGET_OBJ += $(call UC_GET_OBJ,obj-,qemu/qapi/Makefile.objs, qemu/qapi/)
UC_TARGET_OBJ += $(call UC_GET_OBJ,obj-,qemu/qobject/Makefile.objs, qemu/qobject/)
UC_TARGET_OBJ += $(call UC_GET_OBJ,obj-,qemu/qom/Makefile.objs, qemu/qom/)
UC_TARGET_OBJ += $(call UC_GET_OBJ,obj-y,qemu/util/Makefile.objs, qemu/util/)
ifneq ($(filter MINGW%,$(UNAME_S)),)
UC_TARGET_OBJ += $(call UC_GET_OBJ,obj-$$(CONFIG_WIN32),qemu/util/Makefile.objs, qemu/util/)
else
UC_TARGET_OBJ += $(call UC_GET_OBJ,obj-$$(CONFIG_POSIX),qemu/util/Makefile.objs, qemu/util/)
endif
UC_TARGET_OBJ_X86 = $(call UC_GET_OBJ,obj-,qemu/Makefile.target, qemu/x86_64-softmmu/)
UC_TARGET_OBJ_X86 += $(call UC_GET_OBJ,obj-,qemu/hw/i386/Makefile.objs, qemu/x86_64-softmmu/hw/i386/)
UC_TARGET_OBJ_X86 += $(call UC_GET_OBJ,obj-,qemu/hw/intc/Makefile.objs, qemu/x86_64-softmmu/hw/intc/)
UC_TARGET_OBJ_X86 += $(call UC_GET_OBJ,obj-,qemu/target-i386/Makefile.objs, qemu/x86_64-softmmu/target-i386/)
UC_TARGET_OBJ_ARM = $(call UC_GET_OBJ,obj-,qemu/Makefile.target, qemu/arm-softmmu/)
UC_TARGET_OBJ_ARM += $(call UC_GET_OBJ,obj-,qemu/hw/arm/Makefile.objs, qemu/arm-softmmu/hw/arm/)
UC_TARGET_OBJ_ARM += $(call UC_GET_OBJ,obj-y,qemu/target-arm/Makefile.objs, qemu/arm-softmmu/target-arm/)
UC_TARGET_OBJ_ARM += $(call UC_GET_OBJ,obj-$$(CONFIG_SOFTMMU),qemu/target-arm/Makefile.objs, qemu/arm-softmmu/target-arm/)
UC_TARGET_OBJ_ARM += $(call UC_GET_OBJ,obj-$$(TARGET_ARM),qemu/target-arm/Makefile.objs, qemu/arm-softmmu/target-arm/)
UC_TARGET_OBJ_ARMEB = $(subst /arm-softmmu/,/armeb-softmmu/,$(UC_TARGET_OBJ_ARM))
UC_TARGET_OBJ_M68K = $(call UC_GET_OBJ,obj-,qemu/Makefile.target, qemu/m68k-softmmu/)
UC_TARGET_OBJ_M68K += $(call UC_GET_OBJ,obj-,qemu/hw/m68k/Makefile.objs, qemu/m68k-softmmu/hw/m68k/)
UC_TARGET_OBJ_M68K += $(call UC_GET_OBJ,obj-,qemu/target-m68k/Makefile.objs, qemu/m68k-softmmu/target-m68k/)
UC_TARGET_OBJ_AARCH64 = $(call UC_GET_OBJ,obj-,qemu/Makefile.target, qemu/aarch64-softmmu/)
UC_TARGET_OBJ_AARCH64 += $(call UC_GET_OBJ,obj-,qemu/hw/arm/Makefile.objs, qemu/aarch64-softmmu/hw/arm/)
UC_TARGET_OBJ_AARCH64 += $(call UC_GET_OBJ,obj-y,qemu/target-arm/Makefile.objs, qemu/aarch64-softmmu/target-arm/)
UC_TARGET_OBJ_AARCH64 += $(call UC_GET_OBJ,obj-$$(CONFIG_SOFTMMU),qemu/target-arm/Makefile.objs, qemu/aarch64-softmmu/target-arm/)
UC_TARGET_OBJ_AARCH64 += $(call UC_GET_OBJ,obj-$$(TARGET_AARCH64),qemu/target-arm/Makefile.objs, qemu/aarch64-softmmu/target-arm/)
UC_TARGET_OBJ_AARCH64EB = $(subst /aarch64-softmmu/,/aarch64eb-softmmu/,$(UC_TARGET_OBJ_AARCH64))
UC_TARGET_OBJ_MIPS = $(call UC_GET_OBJ,obj-,qemu/Makefile.target, qemu/mips-softmmu/)
UC_TARGET_OBJ_MIPS += $(call UC_GET_OBJ,obj-,qemu/hw/mips/Makefile.objs, qemu/mips-softmmu/hw/mips/)
UC_TARGET_OBJ_MIPS += $(call UC_GET_OBJ,obj-,qemu/target-mips/Makefile.objs, qemu/mips-softmmu/target-mips/)
UC_TARGET_OBJ_MIPSEL = $(subst /mips-softmmu/,/mipsel-softmmu/,$(UC_TARGET_OBJ_MIPS))
UC_TARGET_OBJ_MIPS64 = $(subst /mips-softmmu/,/mips64-softmmu/,$(UC_TARGET_OBJ_MIPS))
UC_TARGET_OBJ_MIPS64EL = $(subst /mips-softmmu/,/mips64el-softmmu/,$(UC_TARGET_OBJ_MIPS))
UC_TARGET_OBJ_SPARC = $(call UC_GET_OBJ,obj-,qemu/Makefile.target, qemu/sparc-softmmu/)
UC_TARGET_OBJ_SPARC += $(call UC_GET_OBJ,obj-,qemu/hw/sparc/Makefile.objs, qemu/sparc-softmmu/hw/sparc/)
UC_TARGET_OBJ_SPARC += $(call UC_GET_OBJ,obj-y,qemu/target-sparc/Makefile.objs, qemu/sparc-softmmu/target-sparc/)
UC_TARGET_OBJ_SPARC += $(call UC_GET_OBJ,obj-$$(TARGET_SPARC),qemu/target-sparc/Makefile.objs, qemu/sparc-softmmu/target-sparc/)
UC_TARGET_OBJ_SPARC64 = $(call UC_GET_OBJ,obj-,qemu/Makefile.target, qemu/sparc64-softmmu/)
UC_TARGET_OBJ_SPARC64 += $(call UC_GET_OBJ,obj-,qemu/hw/sparc64/Makefile.objs, qemu/sparc64-softmmu/hw/sparc64/)
UC_TARGET_OBJ_SPARC64 += $(call UC_GET_OBJ,obj-y,qemu/target-sparc/Makefile.objs, qemu/sparc64-softmmu/target-sparc/)
UC_TARGET_OBJ_SPARC64 += $(call UC_GET_OBJ,obj-$$(TARGET_SPARC64),qemu/target-sparc/Makefile.objs, qemu/sparc64-softmmu/target-sparc/)
ifneq (,$(findstring x86,$(UNICORN_ARCHS)))
UC_TARGET_OBJ += $(UC_TARGET_OBJ_X86)
UNICORN_CFLAGS += -DUNICORN_HAS_X86
UNICORN_TARGETS += x86_64-softmmu,
endif
ifneq (,$(findstring arm,$(UNICORN_ARCHS)))
UC_TARGET_OBJ += $(UC_TARGET_OBJ_ARM)
UC_TARGET_OBJ += $(UC_TARGET_OBJ_ARMEB)
UNICORN_CFLAGS += -DUNICORN_HAS_ARM
UNICORN_CFLAGS += -DUNICORN_HAS_ARMEB
UNICORN_TARGETS += arm-softmmu,
UNICORN_TARGETS += armeb-softmmu,
endif
ifneq (,$(findstring m68k,$(UNICORN_ARCHS)))
UC_TARGET_OBJ += $(UC_TARGET_OBJ_M68K)
UNICORN_CFLAGS += -DUNICORN_HAS_M68K
UNICORN_TARGETS += m68k-softmmu,
endif
ifneq (,$(findstring aarch64,$(UNICORN_ARCHS)))
UC_TARGET_OBJ += $(UC_TARGET_OBJ_AARCH64)
UC_TARGET_OBJ += $(UC_TARGET_OBJ_AARCH64EB)
UNICORN_CFLAGS += -DUNICORN_HAS_ARM64
UNICORN_CFLAGS += -DUNICORN_HAS_ARM64EB
UNICORN_TARGETS += aarch64-softmmu,
UNICORN_TARGETS += aarch64eb-softmmu,
endif
ifneq (,$(findstring mips,$(UNICORN_ARCHS)))
UC_TARGET_OBJ += $(UC_TARGET_OBJ_MIPS)
UC_TARGET_OBJ += $(UC_TARGET_OBJ_MIPSEL)
UC_TARGET_OBJ += $(UC_TARGET_OBJ_MIPS64)
UC_TARGET_OBJ += $(UC_TARGET_OBJ_MIPS64EL)
UNICORN_CFLAGS += -DUNICORN_HAS_MIPS
UNICORN_CFLAGS += -DUNICORN_HAS_MIPSEL
UNICORN_CFLAGS += -DUNICORN_HAS_MIPS64
UNICORN_CFLAGS += -DUNICORN_HAS_MIPS64EL
UNICORN_TARGETS += mips-softmmu,
UNICORN_TARGETS += mipsel-softmmu,
UNICORN_TARGETS += mips64-softmmu,
UNICORN_TARGETS += mips64el-softmmu,
endif
ifneq (,$(findstring sparc,$(UNICORN_ARCHS)))
UC_TARGET_OBJ += $(UC_TARGET_OBJ_SPARC)
UC_TARGET_OBJ += $(UC_TARGET_OBJ_SPARC64)
UNICORN_CFLAGS += -DUNICORN_HAS_SPARC
UNICORN_TARGETS += sparc-softmmu,sparc64-softmmu,
endif
UC_OBJ_ALL = $(UC_TARGET_OBJ) list.o uc.o
UNICORN_CFLAGS += -fPIC
# Verbose output?
V ?= 0
# on MacOS, by default do not compile in Universal format
MACOS_UNIVERSAL ?= no
ifeq ($(UNICORN_DEBUG),yes)
CFLAGS += -g
else
CFLAGS += -O3
UNICORN_QEMU_FLAGS += --disable-debug-info
endif
ifeq ($(UNICORN_ASAN),yes)
CC = clang -fsanitize=address -fno-omit-frame-pointer
CXX = clang++ -fsanitize=address -fno-omit-frame-pointer
AR = llvm-ar
LDFLAGS := -fsanitize=address ${LDFLAGS}
endif
ifeq ($(CROSS),)
CC ?= cc
AR ?= ar
RANLIB ?= ranlib
STRIP ?= strip
else
CC = $(CROSS)-gcc
AR = $(CROSS)-ar
RANLIB = $(CROSS)-ranlib
STRIP = $(CROSS)-strip
endif
ifeq ($(PKG_EXTRA),)
PKG_VERSION = $(PKG_MAJOR).$(PKG_MINOR)
else
PKG_VERSION = $(PKG_MAJOR).$(PKG_MINOR).$(PKG_EXTRA)
endif
API_MAJOR=$(shell echo `grep -e UC_API_MAJOR include/unicorn/unicorn.h | grep -v = | awk '{print $$3}'` | awk '{print $$1}')
# Apple?
ifeq ($(UNAME_S),Darwin)
EXT = dylib
VERSION_EXT = $(API_MAJOR).$(EXT)
$(LIBNAME)_LDFLAGS += -dynamiclib -install_name @rpath/lib$(LIBNAME).$(VERSION_EXT) -current_version $(PKG_MAJOR).$(PKG_MINOR).$(PKG_EXTRA) -compatibility_version $(PKG_MAJOR).$(PKG_MINOR)
AR_EXT = a
UNICORN_CFLAGS += -fvisibility=hidden
ifeq ($(MACOS_UNIVERSAL),yes)
$(LIBNAME)_LDFLAGS += -m32 -arch i386 -m64 -arch x86_64
UNICORN_CFLAGS += -m32 -arch i386 -m64 -arch x86_64
endif
# Cygwin?
else ifneq ($(filter CYGWIN%,$(UNAME_S)),)
EXT = dll
AR_EXT = a
BIN_EXT = .exe
UNICORN_CFLAGS := $(UNICORN_CFLAGS:-fPIC=)
#UNICORN_QEMU_FLAGS += --disable-stack-protector
# mingw?
else ifneq ($(filter MINGW%,$(UNAME_S)),)
EXT = dll
AR_EXT = a
BIN_EXT = .exe
UNICORN_QEMU_FLAGS += --disable-stack-protector
UNICORN_CFLAGS := $(UNICORN_CFLAGS:-fPIC=)
$(LIBNAME)_LDFLAGS += -Wl,--output-def,unicorn.def
DO_WINDOWS_EXPORT = 1
# Haiku
else ifneq ($(filter Haiku%,$(UNAME_S)),)
EXT = so
VERSION_EXT = $(EXT).$(API_MAJOR)
AR_EXT = a
$(LIBNAME)_LDFLAGS += -Wl,-Bsymbolic-functions,-soname,lib$(LIBNAME).$(VERSION_EXT)
UNICORN_CFLAGS := $(UNICORN_CFLAGS:-fPIC=)
UNICORN_QEMU_FLAGS += --disable-stack-protector
# Linux, Darwin
else
EXT = so
VERSION_EXT = $(EXT).$(API_MAJOR)
AR_EXT = a
$(LIBNAME)_LDFLAGS += -Wl,-Bsymbolic-functions,-soname,lib$(LIBNAME).$(VERSION_EXT)
UNICORN_CFLAGS += -fvisibility=hidden
endif
ifeq ($(UNICORN_SHARED),yes)
ifneq ($(filter MINGW%,$(UNAME_S)),)
LIBRARY = $(LIBNAME).$(EXT)
else ifneq ($(filter CYGWIN%,$(UNAME_S)),)
LIBRARY = cyg$(LIBNAME).$(EXT)
LIBRARY_DLLA = lib$(LIBNAME).$(EXT).$(AR_EXT)
$(LIBNAME)_LDFLAGS += -Wl,--out-implib=$(LIBRARY_DLLA)
$(LIBNAME)_LDFLAGS += -lssp
# Linux, Darwin
else
LIBRARY = lib$(LIBNAME).$(VERSION_EXT)
LIBRARY_SYMLINK = lib$(LIBNAME).$(EXT)
endif
endif
ifeq ($(UNICORN_STATIC),yes)
ifneq ($(filter MINGW%,$(UNAME_S)),)
ARCHIVE = $(LIBNAME).$(AR_EXT)
# Cygwin, Linux, Darwin
else
ARCHIVE = lib$(LIBNAME).$(AR_EXT)
endif
endif
INSTALL_BIN ?= install
INSTALL_DATA ?= $(INSTALL_BIN) -m0644
INSTALL_LIB ?= $(INSTALL_BIN) -m0755
PKGCFGF = $(LIBNAME).pc
PREFIX ?= /usr
DESTDIR ?=
LIBDIRARCH ?= lib
# Uncomment the below line to installs x86_64 libs to lib64/ directory.
# Or better, pass 'LIBDIRARCH=lib64' to 'make install/uninstall' via 'make.sh'.
#LIBDIRARCH ?= lib64
LIBDIR ?= $(PREFIX)/$(LIBDIRARCH)
INCDIR ?= $(PREFIX)/include
BINDIR ?= $(PREFIX)/bin
LIBDATADIR ?= $(LIBDIR)
# Don't redefine $LIBDATADIR when global environment variable
# USE_GENERIC_LIBDATADIR is set. This is used by the pkgsrc framework.
ifndef USE_GENERIC_LIBDATADIR
ifeq ($(UNAME_S), FreeBSD)
LIBDATADIR = $(PREFIX)/libdata
else ifeq ($(UNAME_S), DragonFly)
LIBDATADIR = $(PREFIX)/libdata
endif
endif
ifeq ($(PKG_EXTRA),)
PKGCFGDIR = $(LIBDATADIR)/pkgconfig
else
PKGCFGDIR ?= $(LIBDATADIR)/pkgconfig
endif
$(LIBNAME)_LDFLAGS += -lm
.PHONY: test fuzz bindings clean FORCE
all: unicorn
$(MAKE) -C samples
qemu/config-host.mak: qemu/configure
cd qemu && \
./configure --cc="${CC}" --extra-cflags="$(UNICORN_CFLAGS)" --target-list="$(UNICORN_TARGETS)" ${UNICORN_QEMU_FLAGS}
@printf "$(UNICORN_ARCHS)" > config.log
uc.o: qemu/config-host.mak FORCE
$(MAKE) -C qemu $(SMP_MFLAGS)
$(UC_TARGET_OBJ) list.o: uc.o
@echo "--- $^ $@" > /dev/null
unicorn: $(LIBRARY) $(ARCHIVE)
$(LIBRARY): $(UC_OBJ_ALL)
ifeq ($(UNICORN_SHARED),yes)
ifeq ($(V),0)
$(call log,GEN,$(LIBRARY))
@$(CC) $(CFLAGS) -shared $(UC_OBJ_ALL) -o $(LIBRARY) $($(LIBNAME)_LDFLAGS)
@-ln -sf $(LIBRARY) $(LIBRARY_SYMLINK)
else
$(CC) $(CFLAGS) -shared $(UC_OBJ_ALL) -o $(LIBRARY) $($(LIBNAME)_LDFLAGS)
-ln -sf $(LIBRARY) $(LIBRARY_SYMLINK)
endif
ifeq ($(DO_WINDOWS_EXPORT),1)
ifneq ($(filter MINGW32%,$(UNAME_S)),)
cmd //C "windows_export.bat x86"
else
cmd //C "windows_export.bat x64"
endif
endif
endif
$(ARCHIVE): $(UC_OBJ_ALL)
ifeq ($(UNICORN_STATIC),yes)
ifeq ($(V),0)
$(call log,GEN,$(ARCHIVE))
@$(AR) q $(ARCHIVE) $(UC_OBJ_ALL)
@$(RANLIB) $(ARCHIVE)
else
$(AR) q $(ARCHIVE) $(UC_OBJ_ALL)
$(RANLIB) $(ARCHIVE)
endif
endif
$(PKGCFGF):
$(generate-pkgcfg)
fuzz: all
$(MAKE) -C tests/fuzz all
test: all
$(MAKE) -C tests/unit test
$(MAKE) -C tests/regress test
$(MAKE) -C bindings test
install: $(LIBRARY) $(ARCHIVE) $(PKGCFGF)
install -d $(DESTDIR)$(LIBDIR)
ifeq ($(UNICORN_SHARED),yes)
ifneq ($(filter CYGWIN%,$(UNAME_S)),)
$(INSTALL_LIB) $(LIBRARY) $(DESTDIR)$(BINDIR)
$(INSTALL_DATA) $(LIBRARY_DLLA) $(DESTDIR)$(LIBDIR)
else
$(INSTALL_LIB) $(LIBRARY) $(DESTDIR)$(LIBDIR)
endif
ifneq ($(VERSION_EXT),)
cd $(DESTDIR)$(LIBDIR) && \
ln -sf lib$(LIBNAME).$(VERSION_EXT) lib$(LIBNAME).$(EXT)
endif
endif
ifeq ($(UNICORN_STATIC),yes)
$(INSTALL_DATA) $(ARCHIVE) $(DESTDIR)$(LIBDIR)
endif
install -d $(DESTDIR)$(INCDIR)/$(LIBNAME)
$(INSTALL_DATA) include/unicorn/*.h $(DESTDIR)$(INCDIR)/$(LIBNAME)
install -d $(DESTDIR)$(PKGCFGDIR)
$(INSTALL_DATA) $(PKGCFGF) $(DESTDIR)$(PKGCFGDIR)/
TAG ?= HEAD
ifeq ($(TAG), HEAD)
DIST_VERSION = latest
else
DIST_VERSION = $(TAG)
endif
bindings: all
$(MAKE) -C bindings build
$(MAKE) -C bindings samples
dist:
git archive --format=tar.gz --prefix=unicorn-$(DIST_VERSION)/ $(TAG) > unicorn-$(DIST_VERSION).tgz
git archive --format=zip --prefix=unicorn-$(DIST_VERSION)/ $(TAG) > unicorn-$(DIST_VERSION).zip
# run "make header" whenever qemu/header_gen.py is modified
header:
$(eval TARGETS := m68k arm armeb aarch64 aarch64eb mips mipsel mips64 mips64el\
sparc sparc64 x86_64)
$(foreach var,$(TARGETS),\
$(shell python qemu/header_gen.py $(var) > qemu/$(var).h;))
@echo "Generated headers for $(TARGETS)."
uninstall:
rm -rf $(INCDIR)/$(LIBNAME)
rm -f $(LIBDIR)/lib$(LIBNAME).*
rm -f $(BINDIR)/cyg$(LIBNAME).*
rm -f $(PKGCFGDIR)/$(LIBNAME).pc
clean:
$(MAKE) -C qemu distclean
rm -rf *.d *.o
rm -rf lib$(LIBNAME)* $(LIBNAME)*.lib $(LIBNAME)*.dll $(LIBNAME)*.a $(LIBNAME)*.def $(LIBNAME)*.exp cyg$(LIBNAME)*.dll
$(MAKE) -C samples clean
$(MAKE) -C tests/unit clean
define generate-pkgcfg
echo 'Name: unicorn' > $(PKGCFGF)
echo 'Description: Unicorn emulator engine' >> $(PKGCFGF)
echo 'Version: $(PKG_VERSION)' >> $(PKGCFGF)
echo 'libdir=$(LIBDIR)' >> $(PKGCFGF)
echo 'includedir=$(INCDIR)' >> $(PKGCFGF)
echo 'archive=$${libdir}/libunicorn.a' >> $(PKGCFGF)
echo 'Libs: -L$${libdir} -lunicorn' >> $(PKGCFGF)
echo 'Cflags: -I$${includedir}' >> $(PKGCFGF)
endef
define log
@printf " %-7s %s\n" "$(1)" "$(2)"
endef

View File

@ -1,20 +1,22 @@
Unicorn Engine
==============
[![Join the chat at https://gitter.im/unicorn-engine/chat](https://badges.gitter.im/unicorn-engine/unicorn.svg)](https://gitter.im/unicorn-engine/chat?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![Build Status](https://travis-ci.org/unicorn-engine/unicorn.svg?branch=master)](https://travis-ci.org/unicorn-engine/unicorn)
[![pypi downloads](https://pepy.tech/badge/unicorn)](https://pepy.tech/project/unicorn)
[![Fuzzing Status](https://oss-fuzz-build-logs.storage.googleapis.com/badges/unicorn.svg)](https://bugs.chromium.org/p/oss-fuzz/issues/list?sort=-opened&can=1&q=proj:unicorn)
Unicorn is a lightweight, multi-platform, multi-architecture CPU emulator framework
based on [QEMU](http://qemu.org).
<p align="center">
<img width="250" src="docs/unicorn-logo.png">
</p>
Unicorn is a lightweight, multi-platform, multi-architecture CPU emulator framework, based on [QEMU](http://qemu.org).
Unicorn offers some unparalleled features:
- Multi-architecture: ARM, ARM64 (ARMv8), M68K, MIPS, SPARC, and X86 (16, 32, 64-bit)
- Multi-architecture: ARM, ARM64 (ARMv8), M68K, MIPS, PowerPC, RISCV, SPARC, S390X and X86 (16, 32, 64-bit)
- Clean/simple/lightweight/intuitive architecture-neutral API
- Implemented in pure C language, with bindings for Crystal, Clojure, Visual Basic, Perl, Rust, Ruby, Python, Java, .NET, Go, Delphi/Free Pascal, Haskell, Pharo, and Lua.
- Native support for Windows & *nix (with Mac OSX, Linux, *BSD & Solaris confirmed)
- Native support for Windows & *nix (with Mac OSX, Linux, Android, *BSD & Solaris confirmed)
- High performance via Just-In-Time compilation
- Support for fine-grained instrumentation at various levels
- Thread-safety by design
@ -48,7 +50,7 @@ Contribute
If you want to contribute, please pick up something from our [Github issues](https://github.com/unicorn-engine/unicorn/issues).
We also maintain a list of more challenged problems in a [TODO list](https://github.com/unicorn-engine/unicorn/wiki/TODO).
We also maintain a list of more challenged problems in [milestones](https://github.com/unicorn-engine/unicorn/milestones) for our regular release.
[CREDITS.TXT](CREDITS.TXT) records important contributors of our project.

View File

@ -1,7 +0,0 @@
* Version 1.0.2 - October 21st, 2020
Release 1.0.2 was sponsored by the following companies (in no particular order).
- Catena Cyber: https://catenacyber.fr
- Grayshift: https://grayshift.com
- Google: https://google.com

1
TODO Normal file
View File

@ -0,0 +1 @@
Moved to https://github.com/unicorn-engine/unicorn/milestones

View File

@ -24,8 +24,8 @@ build:
$(MAKE) -C go gen_const
$(MAKE) -C java gen_const
$(MAKE) -C ruby gen_const
python const_generator.py dotnet
python const_generator.py pascal
python3 const_generator.py dotnet
python3 const_generator.py pascal
install: build
$(MAKE) -C python install
@ -40,7 +40,7 @@ python:
%.c.txt: c
$(ENV_VARS) ../samples/$(@:%.c.txt=%) > $@
%.py.txt: python
$(ENV_VARS) python python/$(@:%.txt=%) > $@
$(ENV_VARS) python3 python/$(@:%.txt=%) > $@
%.py.test: %.c.txt %.py.txt
$(DIFF) -u $(@:%.py.test=%.c.txt) $(@:%.py.test=%.py.txt)

View File

@ -1,4 +1,4 @@
This directory contains bindings & test code for Python, Java, Go, .NET and Rust.
This directory contains bindings & test code for Python, Java, Go and .NET.
See <language>/README or <language>/README.TXT or <language>/README.md for how to install each binding.
The following bindings are contributed by community.
@ -10,14 +10,13 @@ The following bindings are contributed by community.
- Haskell binding: by Adrian Herrera.
- VB6 binding: David Zimmer.
- FreePascal/Delphi binding: Mohamed Osama.
- Rust binding: Lukas Seidel.
More bindings created & maintained externally by community are available as follows.
- UnicornPascal: Delphi/Free Pascal binding (by Stievie).
https://github.com/stievie/UnicornPascal
- Unicorn-Rs: Rust binding (by Sébastien Duquette, unmaintained)
- Unicorn-Rs: Rust binding (by Sébastien Duquette)
https://github.com/ekse/unicorn-rs
- UnicornEngine: Perl binding (by Vikas Naresh Kumar)

View File

@ -6,7 +6,7 @@ import sys, re, os
INCL_DIR = os.path.join('..', 'include', 'unicorn')
include = [ 'arm.h', 'arm64.h', 'mips.h', 'x86.h', 'sparc.h', 'm68k.h', 'unicorn.h' ]
include = [ 'arm.h', 'arm64.h', 'mips.h', 'x86.h', 'sparc.h', 'm68k.h', 'ppc.h', 'riscv.h', 's390x.h', 'unicorn.h' ]
template = {
'python': {
@ -21,6 +21,9 @@ template = {
'x86.h': 'x86',
'sparc.h': 'sparc',
'm68k.h': 'm68k',
'ppc.h': 'ppc',
'riscv.h': 'riscv',
's390x.h' : 's390x',
'unicorn.h': 'unicorn',
'comment_open': '#',
'comment_close': '',
@ -37,6 +40,9 @@ template = {
'x86.h': 'x86',
'sparc.h': 'sparc',
'm68k.h': 'm68k',
'ppc.h': 'ppc',
'riscv.h': 'riscv',
's390x.h' : 's390x',
'unicorn.h': 'unicorn',
'comment_open': '#',
'comment_close': '',
@ -53,6 +59,9 @@ template = {
'x86.h': 'x86',
'sparc.h': 'sparc',
'm68k.h': 'm68k',
'ppc.h': 'ppc',
'riscv.h': 'riscv',
's390x.h' : 's390x',
'unicorn.h': 'unicorn',
'comment_open': '//',
'comment_close': '',
@ -69,6 +78,9 @@ template = {
'x86.h': 'X86',
'sparc.h': 'Sparc',
'm68k.h': 'M68k',
'ppc.h': 'Ppc',
'riscv.h': 'Riscv',
's390x.h' : 'S390x',
'unicorn.h': 'Unicorn',
'comment_open': '//',
'comment_close': '',
@ -85,6 +97,9 @@ template = {
'x86.h': 'X86',
'sparc.h': 'Sparc',
'm68k.h': 'M68k',
'ppc.h': 'Ppc',
'riscv.h': 'Riscv',
's390x.h' : 'S390x',
'unicorn.h': 'Common',
'comment_open': ' //',
'comment_close': '',
@ -101,6 +116,9 @@ template = {
'x86.h': 'X86',
'sparc.h': 'Sparc',
'm68k.h': 'M68k',
'ppc.h': 'Ppc',
'riscv.h': 'Riscv',
's390x.h' : 'S390x',
'unicorn.h': 'Unicorn',
'comment_open': '//',
'comment_close': '',
@ -124,7 +142,20 @@ def gen(lang):
previous = {}
count = 0
for line in lines:
skip = 0
in_comment = False
for lno, line in enumerate(lines):
if "/*" in line:
in_comment = True
if "*/" in line:
in_comment = False
if in_comment:
continue
if skip > 0:
# Due to clang-format, values may come up in the next line
skip -= 1
continue
line = line.strip()
if line.startswith(MARKUP): # markup for comments
@ -136,6 +167,8 @@ def gen(lang):
continue
tmp = line.strip().split(',')
if len(tmp) >= 2 and tmp[0] != "#define" and not tmp[0].startswith("UC_"):
continue
for t in tmp:
t = t.strip()
if not t or t.startswith('//'): continue
@ -147,18 +180,52 @@ def gen(lang):
define = True
f.pop(0)
f.insert(1, '=')
if f[0].startswith("UC_" + prefix.upper()):
if f[0].startswith("UC_" + prefix.upper()) or f[0].startswith("UC_CPU"):
if len(f) > 1 and f[1] not in ('//', '='):
print("WARNING: Unable to convert %s" % f)
print(" Line =", line)
continue
elif len(f) > 1 and f[1] == '=':
rhs = ''.join(f[2:])
# Like:
# UC_A =
# (1 << 2)
# #define UC_B \
# (UC_A | UC_C)
# Let's search the next line
if len(f) == 2:
if lno == len(lines) - 1:
print("WARNING: Unable to convert %s" % f)
print(" Line =", line)
continue
skip += 1
next_line = lines[lno + 1]
next_line_tmp = next_line.strip().split(",")
rhs = next_line_tmp[0]
elif f[-1] == "\\":
idx = 0
rhs = ""
while True:
idx += 1
if lno + idx == len(lines):
print("WARNING: Unable to convert %s" % f)
print(" Line =", line)
continue
skip += 1
next_line = lines[lno + idx]
next_line_f = re.split('\s+', next_line.strip())
if next_line_f[-1] == "\\":
rhs += "".join(next_line_f[:-1])
else:
rhs += next_line.strip()
break
else:
rhs = ''.join(f[2:])
else:
rhs = str(count)
lhs = f[0].strip()
#print(f'lhs: {lhs} rhs: {rhs} f:{f}')
# evaluate bitshifts in constants e.g. "UC_X86 = 1 << 1"
match = re.match(r'(?P<rhs>\s*\d+\s*<<\s*\d+\s*)', rhs)
if match:

View File

@ -7,6 +7,43 @@ open System
[<AutoOpen>]
module Arm =
// ARM CPU
let UC_CPU_ARM_926 = 0
let UC_CPU_ARM_946 = 1
let UC_CPU_ARM_1026 = 2
let UC_CPU_ARM_1136_R2 = 3
let UC_CPU_ARM_1136 = 4
let UC_CPU_ARM_1176 = 5
let UC_CPU_ARM_11MPCORE = 6
let UC_CPU_ARM_CORTEX_M0 = 7
let UC_CPU_ARM_CORTEX_M3 = 8
let UC_CPU_ARM_CORTEX_M4 = 9
let UC_CPU_ARM_CORTEX_M7 = 10
let UC_CPU_ARM_CORTEX_M33 = 11
let UC_CPU_ARM_CORTEX_R5 = 12
let UC_CPU_ARM_CORTEX_R5F = 13
let UC_CPU_ARM_CORTEX_A7 = 14
let UC_CPU_ARM_CORTEX_A8 = 15
let UC_CPU_ARM_CORTEX_A9 = 16
let UC_CPU_ARM_CORTEX_A15 = 17
let UC_CPU_ARM_TI925T = 18
let UC_CPU_ARM_SA1100 = 19
let UC_CPU_ARM_SA1110 = 20
let UC_CPU_ARM_PXA250 = 21
let UC_CPU_ARM_PXA255 = 22
let UC_CPU_ARM_PXA260 = 23
let UC_CPU_ARM_PXA261 = 24
let UC_CPU_ARM_PXA262 = 25
let UC_CPU_ARM_PXA270 = 26
let UC_CPU_ARM_PXA270A0 = 27
let UC_CPU_ARM_PXA270A1 = 28
let UC_CPU_ARM_PXA270B0 = 29
let UC_CPU_ARM_PXA270B1 = 30
let UC_CPU_ARM_PXA270C0 = 31
let UC_CPU_ARM_PXA270C5 = 32
let UC_CPU_ARM_MAX = 33
// ARM registers
let UC_ARM_REG_INVALID = 0
@ -127,7 +164,28 @@ module Arm =
let UC_ARM_REG_MSP = 115
let UC_ARM_REG_PSP = 116
let UC_ARM_REG_CONTROL = 117
let UC_ARM_REG_ENDING = 118
let UC_ARM_REG_IAPSR = 118
let UC_ARM_REG_EAPSR = 119
let UC_ARM_REG_XPSR = 120
let UC_ARM_REG_EPSR = 121
let UC_ARM_REG_IEPSR = 122
let UC_ARM_REG_PRIMASK = 123
let UC_ARM_REG_BASEPRI = 124
let UC_ARM_REG_BASEPRI_MAX = 125
let UC_ARM_REG_FAULTMASK = 126
let UC_ARM_REG_APSR_NZCVQ = 127
let UC_ARM_REG_APSR_G = 128
let UC_ARM_REG_APSR_NZCVQG = 129
let UC_ARM_REG_IAPSR_NZCVQ = 130
let UC_ARM_REG_IAPSR_G = 131
let UC_ARM_REG_IAPSR_NZCVQG = 132
let UC_ARM_REG_EAPSR_NZCVQ = 133
let UC_ARM_REG_EAPSR_G = 134
let UC_ARM_REG_EAPSR_NZCVQG = 135
let UC_ARM_REG_XPSR_NZCVQ = 136
let UC_ARM_REG_XPSR_G = 137
let UC_ARM_REG_XPSR_NZCVQG = 138
let UC_ARM_REG_ENDING = 139
// alias registers
let UC_ARM_REG_R13 = 12

View File

@ -7,6 +7,13 @@ open System
[<AutoOpen>]
module Arm64 =
// ARM64 CPU
let UC_CPU_AARCH64_A57 = 0
let UC_CPU_AARCH64_A53 = 1
let UC_CPU_AARCH64_A72 = 2
let UC_CPU_AARCH64_MAX = 3
// ARM64 registers
let UC_ARM64_REG_INVALID = 0

View File

@ -6,13 +6,18 @@ open System
[<AutoOpen>]
module Common =
let UC_API_MAJOR = 1
let UC_API_MAJOR = 2
let UC_API_MINOR = 0
let UC_VERSION_MAJOR = 1
let UC_API_PATCH = 0
let UC_API_EXTRA = 5
let UC_VERSION_MAJOR = 2
let UC_VERSION_MINOR = 0
let UC_VERSION_EXTRA = 3
let UC_VERSION_PATCH = 0
let UC_VERSION_EXTRA = 5
let UC_SECOND_SCALE = 1000000
let UC_MILISECOND_SCALE = 1000
let UC_ARCH_ARM = 1
@ -22,7 +27,9 @@ module Common =
let UC_ARCH_PPC = 5
let UC_ARCH_SPARC = 6
let UC_ARCH_M68K = 7
let UC_ARCH_MAX = 8
let UC_ARCH_RISCV = 8
let UC_ARCH_S390X = 9
let UC_ARCH_MAX = 10
let UC_MODE_LITTLE_ENDIAN = 0
let UC_MODE_BIG_ENDIAN = 1073741824
@ -34,7 +41,6 @@ module Common =
let UC_MODE_ARM926 = 128
let UC_MODE_ARM946 = 256
let UC_MODE_ARM1176 = 512
let UC_MODE_ARMBE8 = 1024
let UC_MODE_MICRO = 16
let UC_MODE_MIPS3 = 32
let UC_MODE_MIPS32R6 = 64
@ -49,6 +55,8 @@ module Common =
let UC_MODE_SPARC32 = 4
let UC_MODE_SPARC64 = 8
let UC_MODE_V9 = 16
let UC_MODE_RISCV32 = 4
let UC_MODE_RISCV64 = 8
let UC_ERR_OK = 0
let UC_ERR_NOMEM = 1
@ -82,6 +90,10 @@ module Common =
let UC_MEM_READ_PROT = 23
let UC_MEM_FETCH_PROT = 24
let UC_MEM_READ_AFTER = 25
let UC_TCG_OP_SUB = 0
let UC_TCG_OP_FLAG_CMP = 1
let UC_TCG_OP_FLAG_DIRECT = 2
let UC_HOOK_INTR = 1
let UC_HOOK_INSN = 2
let UC_HOOK_CODE = 4
@ -97,6 +109,8 @@ module Common =
let UC_HOOK_MEM_FETCH = 4096
let UC_HOOK_MEM_READ_AFTER = 8192
let UC_HOOK_INSN_INVALID = 16384
let UC_HOOK_EDGE_GENERATED = 32768
let UC_HOOK_TCG_OPCODE = 65536
let UC_HOOK_MEM_UNMAPPED = 112
let UC_HOOK_MEM_PROT = 896
let UC_HOOK_MEM_READ_INVALID = 144
@ -109,6 +123,22 @@ module Common =
let UC_QUERY_ARCH = 3
let UC_QUERY_TIMEOUT = 4
let UC_CTL_IO_NONE = 0
let UC_CTL_IO_WRITE = 1
let UC_CTL_IO_READ = 2
let UC_CTL_IO_READ_WRITE = 3
let UC_CTL_UC_MODE = 0
let UC_CTL_UC_PAGE_SIZE = 1
let UC_CTL_UC_ARCH = 2
let UC_CTL_UC_TIMEOUT = 3
let UC_CTL_UC_USE_EXITS = 4
let UC_CTL_UC_EXITS_CNT = 5
let UC_CTL_UC_EXITS = 6
let UC_CTL_CPU_MODEL = 7
let UC_CTL_TB_REQUEST_CACHE = 8
let UC_CTL_TB_REMOVE_CACHE = 9
let UC_PROT_NONE = 0
let UC_PROT_READ = 1
let UC_PROT_WRITE = 2

View File

@ -7,6 +7,18 @@ open System
[<AutoOpen>]
module M68k =
// M68K CPU
let UC_CPU_M68K_M5206 = 0
let UC_CPU_M68K_M68000 = 1
let UC_CPU_M68K_M68020 = 2
let UC_CPU_M68K_M68030 = 3
let UC_CPU_M68K_M68040 = 4
let UC_CPU_M68K_M68060 = 5
let UC_CPU_M68K_M5208 = 6
let UC_CPU_M68K_CFV4E = 7
let UC_CPU_M68K_ANY = 8
// M68K registers
let UC_M68K_REG_INVALID = 0

View File

@ -7,6 +7,41 @@ open System
[<AutoOpen>]
module Mips =
// MIPS32 CPUS
let UC_CPU_MIPS32_4KC = 0
let UC_CPU_MIPS32_4KM = 1
let UC_CPU_MIPS32_4KECR1 = 2
let UC_CPU_MIPS32_4KEMR1 = 3
let UC_CPU_MIPS32_4KEC = 4
let UC_CPU_MIPS32_4KEM = 5
let UC_CPU_MIPS32_24KC = 6
let UC_CPU_MIPS32_24KEC = 7
let UC_CPU_MIPS32_24KF = 8
let UC_CPU_MIPS32_34KF = 9
let UC_CPU_MIPS32_74KF = 10
let UC_CPU_MIPS32_M14K = 11
let UC_CPU_MIPS32_M14KC = 12
let UC_CPU_MIPS32_P5600 = 13
let UC_CPU_MIPS32_MIPS32R6_GENERIC = 14
let UC_CPU_MIPS32_I7200 = 15
// MIPS64 CPUS
let UC_CPU_MIPS64_R4000 = 0
let UC_CPU_MIPS64_VR5432 = 1
let UC_CPU_MIPS64_5KC = 2
let UC_CPU_MIPS64_5KF = 3
let UC_CPU_MIPS64_20KC = 4
let UC_CPU_MIPS64_MIPS64R2_GENERIC = 5
let UC_CPU_MIPS64_5KEC = 6
let UC_CPU_MIPS64_5KEF = 7
let UC_CPU_MIPS64_I6400 = 8
let UC_CPU_MIPS64_I6500 = 9
let UC_CPU_MIPS64_LOONGSON_2E = 10
let UC_CPU_MIPS64_LOONGSON_2F = 11
let UC_CPU_MIPS64_MIPS64DSPR2 = 12
// MIPS registers
let UC_MIPS_REG_INVALID = 0
@ -160,7 +195,8 @@ module Mips =
let UC_MIPS_REG_MPL2 = 136
let UC_MIPS_REG_CP0_CONFIG3 = 137
let UC_MIPS_REG_CP0_USERLOCAL = 138
let UC_MIPS_REG_ENDING = 139
let UC_MIPS_REG_CP0_STATUS = 139
let UC_MIPS_REG_ENDING = 140
let UC_MIPS_REG_ZERO = 2
let UC_MIPS_REG_AT = 3
let UC_MIPS_REG_V0 = 4

View File

@ -0,0 +1,408 @@
// For Unicorn Engine. AUTO-GENERATED FILE, DO NOT EDIT
namespace UnicornManaged.Const
open System
[<AutoOpen>]
module Ppc =
// PPC CPU
let UC_CPU_PPC_401 = 0
let UC_CPU_PPC_401A1 = 1
let UC_CPU_PPC_401B2 = 2
let UC_CPU_PPC_401C2 = 3
let UC_CPU_PPC_401D2 = 4
let UC_CPU_PPC_401E2 = 5
let UC_CPU_PPC_401F2 = 6
let UC_CPU_PPC_401G2 = 7
let UC_CPU_PPC_IOP480 = 8
let UC_CPU_PPC_COBRA = 9
let UC_CPU_PPC_403GA = 10
let UC_CPU_PPC_403GB = 11
let UC_CPU_PPC_403GC = 12
let UC_CPU_PPC_403GCX = 13
let UC_CPU_PPC_405D2 = 14
let UC_CPU_PPC_405D4 = 15
let UC_CPU_PPC_405CRA = 16
let UC_CPU_PPC_405CRB = 17
let UC_CPU_PPC_405CRC = 18
let UC_CPU_PPC_405EP = 19
let UC_CPU_PPC_405EZ = 20
let UC_CPU_PPC_405GPA = 21
let UC_CPU_PPC_405GPB = 22
let UC_CPU_PPC_405GPC = 23
let UC_CPU_PPC_405GPD = 24
let UC_CPU_PPC_405GPR = 25
let UC_CPU_PPC_405LP = 26
let UC_CPU_PPC_NPE405H = 27
let UC_CPU_PPC_NPE405H2 = 28
let UC_CPU_PPC_NPE405L = 29
let UC_CPU_PPC_NPE4GS3 = 30
let UC_CPU_PPC_STB03 = 31
let UC_CPU_PPC_STB04 = 32
let UC_CPU_PPC_STB25 = 33
let UC_CPU_PPC_X2VP4 = 34
let UC_CPU_PPC_X2VP20 = 35
let UC_CPU_PPC_440_XILINX = 36
let UC_CPU_PPC_440_XILINX_W_DFPU = 37
let UC_CPU_PPC_440EPA = 38
let UC_CPU_PPC_440EPB = 39
let UC_CPU_PPC_440EPX = 40
let UC_CPU_PPC_460EXB = 41
let UC_CPU_PPC_G2 = 42
let UC_CPU_PPC_G2H4 = 43
let UC_CPU_PPC_G2GP = 44
let UC_CPU_PPC_G2LS = 45
let UC_CPU_PPC_G2HIP3 = 46
let UC_CPU_PPC_G2HIP4 = 47
let UC_CPU_PPC_MPC603 = 48
let UC_CPU_PPC_G2LE = 49
let UC_CPU_PPC_G2LEGP = 50
let UC_CPU_PPC_G2LELS = 51
let UC_CPU_PPC_G2LEGP1 = 52
let UC_CPU_PPC_G2LEGP3 = 53
let UC_CPU_PPC_MPC5200_V10 = 54
let UC_CPU_PPC_MPC5200_V11 = 55
let UC_CPU_PPC_MPC5200_V12 = 56
let UC_CPU_PPC_MPC5200B_V20 = 57
let UC_CPU_PPC_MPC5200B_V21 = 58
let UC_CPU_PPC_E200Z5 = 59
let UC_CPU_PPC_E200Z6 = 60
let UC_CPU_PPC_E300C1 = 61
let UC_CPU_PPC_E300C2 = 62
let UC_CPU_PPC_E300C3 = 63
let UC_CPU_PPC_E300C4 = 64
let UC_CPU_PPC_MPC8343 = 65
let UC_CPU_PPC_MPC8343A = 66
let UC_CPU_PPC_MPC8343E = 67
let UC_CPU_PPC_MPC8343EA = 68
let UC_CPU_PPC_MPC8347T = 69
let UC_CPU_PPC_MPC8347P = 70
let UC_CPU_PPC_MPC8347AT = 71
let UC_CPU_PPC_MPC8347AP = 72
let UC_CPU_PPC_MPC8347ET = 73
let UC_CPU_PPC_MPC8347EP = 74
let UC_CPU_PPC_MPC8347EAT = 75
let UC_CPU_PPC_MPC8347EAP = 76
let UC_CPU_PPC_MPC8349 = 77
let UC_CPU_PPC_MPC8349A = 78
let UC_CPU_PPC_MPC8349E = 79
let UC_CPU_PPC_MPC8349EA = 80
let UC_CPU_PPC_MPC8377 = 81
let UC_CPU_PPC_MPC8377E = 82
let UC_CPU_PPC_MPC8378 = 83
let UC_CPU_PPC_MPC8378E = 84
let UC_CPU_PPC_MPC8379 = 85
let UC_CPU_PPC_MPC8379E = 86
let UC_CPU_PPC_E500_V10 = 87
let UC_CPU_PPC_E500_V20 = 88
let UC_CPU_PPC_E500V2_V10 = 89
let UC_CPU_PPC_E500V2_V20 = 90
let UC_CPU_PPC_E500V2_V21 = 91
let UC_CPU_PPC_E500V2_V22 = 92
let UC_CPU_PPC_E500V2_V30 = 93
let UC_CPU_PPC_E500MC = 94
let UC_CPU_PPC_MPC8533_V10 = 95
let UC_CPU_PPC_MPC8533_V11 = 96
let UC_CPU_PPC_MPC8533E_V10 = 97
let UC_CPU_PPC_MPC8533E_V11 = 98
let UC_CPU_PPC_MPC8540_V10 = 99
let UC_CPU_PPC_MPC8540_V20 = 100
let UC_CPU_PPC_MPC8540_V21 = 101
let UC_CPU_PPC_MPC8541_V10 = 102
let UC_CPU_PPC_MPC8541_V11 = 103
let UC_CPU_PPC_MPC8541E_V10 = 104
let UC_CPU_PPC_MPC8541E_V11 = 105
let UC_CPU_PPC_MPC8543_V10 = 106
let UC_CPU_PPC_MPC8543_V11 = 107
let UC_CPU_PPC_MPC8543_V20 = 108
let UC_CPU_PPC_MPC8543_V21 = 109
let UC_CPU_PPC_MPC8543E_V10 = 110
let UC_CPU_PPC_MPC8543E_V11 = 111
let UC_CPU_PPC_MPC8543E_V20 = 112
let UC_CPU_PPC_MPC8543E_V21 = 113
let UC_CPU_PPC_MPC8544_V10 = 114
let UC_CPU_PPC_MPC8544_V11 = 115
let UC_CPU_PPC_MPC8544E_V10 = 116
let UC_CPU_PPC_MPC8544E_V11 = 117
let UC_CPU_PPC_MPC8545_V20 = 118
let UC_CPU_PPC_MPC8545_V21 = 119
let UC_CPU_PPC_MPC8545E_V20 = 120
let UC_CPU_PPC_MPC8545E_V21 = 121
let UC_CPU_PPC_MPC8547E_V20 = 122
let UC_CPU_PPC_MPC8547E_V21 = 123
let UC_CPU_PPC_MPC8548_V10 = 124
let UC_CPU_PPC_MPC8548_V11 = 125
let UC_CPU_PPC_MPC8548_V20 = 126
let UC_CPU_PPC_MPC8548_V21 = 127
let UC_CPU_PPC_MPC8548E_V10 = 128
let UC_CPU_PPC_MPC8548E_V11 = 129
let UC_CPU_PPC_MPC8548E_V20 = 130
let UC_CPU_PPC_MPC8548E_V21 = 131
let UC_CPU_PPC_MPC8555_V10 = 132
let UC_CPU_PPC_MPC8555_V11 = 133
let UC_CPU_PPC_MPC8555E_V10 = 134
let UC_CPU_PPC_MPC8555E_V11 = 135
let UC_CPU_PPC_MPC8560_V10 = 136
let UC_CPU_PPC_MPC8560_V20 = 137
let UC_CPU_PPC_MPC8560_V21 = 138
let UC_CPU_PPC_MPC8567 = 139
let UC_CPU_PPC_MPC8567E = 140
let UC_CPU_PPC_MPC8568 = 141
let UC_CPU_PPC_MPC8568E = 142
let UC_CPU_PPC_MPC8572 = 143
let UC_CPU_PPC_MPC8572E = 144
let UC_CPU_PPC_E600 = 145
let UC_CPU_PPC_MPC8610 = 146
let UC_CPU_PPC_MPC8641 = 147
let UC_CPU_PPC_MPC8641D = 148
let UC_CPU_PPC_601_V0 = 149
let UC_CPU_PPC_601_V1 = 150
let UC_CPU_PPC_601_V2 = 151
let UC_CPU_PPC_602 = 152
let UC_CPU_PPC_603 = 153
let UC_CPU_PPC_603E_V1_1 = 154
let UC_CPU_PPC_603E_V1_2 = 155
let UC_CPU_PPC_603E_V1_3 = 156
let UC_CPU_PPC_603E_V1_4 = 157
let UC_CPU_PPC_603E_V2_2 = 158
let UC_CPU_PPC_603E_V3 = 159
let UC_CPU_PPC_603E_V4 = 160
let UC_CPU_PPC_603E_V4_1 = 161
let UC_CPU_PPC_603E7 = 162
let UC_CPU_PPC_603E7T = 163
let UC_CPU_PPC_603E7V = 164
let UC_CPU_PPC_603E7V1 = 165
let UC_CPU_PPC_603E7V2 = 166
let UC_CPU_PPC_603P = 167
let UC_CPU_PPC_604 = 168
let UC_CPU_PPC_604E_V1_0 = 169
let UC_CPU_PPC_604E_V2_2 = 170
let UC_CPU_PPC_604E_V2_4 = 171
let UC_CPU_PPC_604R = 172
let UC_CPU_PPC_740_V1_0 = 173
let UC_CPU_PPC_750_V1_0 = 174
let UC_CPU_PPC_740_V2_0 = 175
let UC_CPU_PPC_750_V2_0 = 176
let UC_CPU_PPC_740_V2_1 = 177
let UC_CPU_PPC_750_V2_1 = 178
let UC_CPU_PPC_740_V2_2 = 179
let UC_CPU_PPC_750_V2_2 = 180
let UC_CPU_PPC_740_V3_0 = 181
let UC_CPU_PPC_750_V3_0 = 182
let UC_CPU_PPC_740_V3_1 = 183
let UC_CPU_PPC_750_V3_1 = 184
let UC_CPU_PPC_740E = 185
let UC_CPU_PPC_750E = 186
let UC_CPU_PPC_740P = 187
let UC_CPU_PPC_750P = 188
let UC_CPU_PPC_750CL_V1_0 = 189
let UC_CPU_PPC_750CL_V2_0 = 190
let UC_CPU_PPC_750CX_V1_0 = 191
let UC_CPU_PPC_750CX_V2_0 = 192
let UC_CPU_PPC_750CX_V2_1 = 193
let UC_CPU_PPC_750CX_V2_2 = 194
let UC_CPU_PPC_750CXE_V2_1 = 195
let UC_CPU_PPC_750CXE_V2_2 = 196
let UC_CPU_PPC_750CXE_V2_3 = 197
let UC_CPU_PPC_750CXE_V2_4 = 198
let UC_CPU_PPC_750CXE_V2_4B = 199
let UC_CPU_PPC_750CXE_V3_0 = 200
let UC_CPU_PPC_750CXE_V3_1 = 201
let UC_CPU_PPC_750CXE_V3_1B = 202
let UC_CPU_PPC_750CXR = 203
let UC_CPU_PPC_750FL = 204
let UC_CPU_PPC_750FX_V1_0 = 205
let UC_CPU_PPC_750FX_V2_0 = 206
let UC_CPU_PPC_750FX_V2_1 = 207
let UC_CPU_PPC_750FX_V2_2 = 208
let UC_CPU_PPC_750FX_V2_3 = 209
let UC_CPU_PPC_750GL = 210
let UC_CPU_PPC_750GX_V1_0 = 211
let UC_CPU_PPC_750GX_V1_1 = 212
let UC_CPU_PPC_750GX_V1_2 = 213
let UC_CPU_PPC_750L_V2_0 = 214
let UC_CPU_PPC_750L_V2_1 = 215
let UC_CPU_PPC_750L_V2_2 = 216
let UC_CPU_PPC_750L_V3_0 = 217
let UC_CPU_PPC_750L_V3_2 = 218
let UC_CPU_PPC_745_V1_0 = 219
let UC_CPU_PPC_755_V1_0 = 220
let UC_CPU_PPC_745_V1_1 = 221
let UC_CPU_PPC_755_V1_1 = 222
let UC_CPU_PPC_745_V2_0 = 223
let UC_CPU_PPC_755_V2_0 = 224
let UC_CPU_PPC_745_V2_1 = 225
let UC_CPU_PPC_755_V2_1 = 226
let UC_CPU_PPC_745_V2_2 = 227
let UC_CPU_PPC_755_V2_2 = 228
let UC_CPU_PPC_745_V2_3 = 229
let UC_CPU_PPC_755_V2_3 = 230
let UC_CPU_PPC_745_V2_4 = 231
let UC_CPU_PPC_755_V2_4 = 232
let UC_CPU_PPC_745_V2_5 = 233
let UC_CPU_PPC_755_V2_5 = 234
let UC_CPU_PPC_745_V2_6 = 235
let UC_CPU_PPC_755_V2_6 = 236
let UC_CPU_PPC_745_V2_7 = 237
let UC_CPU_PPC_755_V2_7 = 238
let UC_CPU_PPC_745_V2_8 = 239
let UC_CPU_PPC_755_V2_8 = 240
let UC_CPU_PPC_7400_V1_0 = 241
let UC_CPU_PPC_7400_V1_1 = 242
let UC_CPU_PPC_7400_V2_0 = 243
let UC_CPU_PPC_7400_V2_1 = 244
let UC_CPU_PPC_7400_V2_2 = 245
let UC_CPU_PPC_7400_V2_6 = 246
let UC_CPU_PPC_7400_V2_7 = 247
let UC_CPU_PPC_7400_V2_8 = 248
let UC_CPU_PPC_7400_V2_9 = 249
let UC_CPU_PPC_7410_V1_0 = 250
let UC_CPU_PPC_7410_V1_1 = 251
let UC_CPU_PPC_7410_V1_2 = 252
let UC_CPU_PPC_7410_V1_3 = 253
let UC_CPU_PPC_7410_V1_4 = 254
let UC_CPU_PPC_7448_V1_0 = 255
let UC_CPU_PPC_7448_V1_1 = 256
let UC_CPU_PPC_7448_V2_0 = 257
let UC_CPU_PPC_7448_V2_1 = 258
let UC_CPU_PPC_7450_V1_0 = 259
let UC_CPU_PPC_7450_V1_1 = 260
let UC_CPU_PPC_7450_V1_2 = 261
let UC_CPU_PPC_7450_V2_0 = 262
let UC_CPU_PPC_7450_V2_1 = 263
let UC_CPU_PPC_7441_V2_1 = 264
let UC_CPU_PPC_7441_V2_3 = 265
let UC_CPU_PPC_7451_V2_3 = 266
let UC_CPU_PPC_7441_V2_10 = 267
let UC_CPU_PPC_7451_V2_10 = 268
let UC_CPU_PPC_7445_V1_0 = 269
let UC_CPU_PPC_7455_V1_0 = 270
let UC_CPU_PPC_7445_V2_1 = 271
let UC_CPU_PPC_7455_V2_1 = 272
let UC_CPU_PPC_7445_V3_2 = 273
let UC_CPU_PPC_7455_V3_2 = 274
let UC_CPU_PPC_7445_V3_3 = 275
let UC_CPU_PPC_7455_V3_3 = 276
let UC_CPU_PPC_7445_V3_4 = 277
let UC_CPU_PPC_7455_V3_4 = 278
let UC_CPU_PPC_7447_V1_0 = 279
let UC_CPU_PPC_7457_V1_0 = 280
let UC_CPU_PPC_7447_V1_1 = 281
let UC_CPU_PPC_7457_V1_1 = 282
let UC_CPU_PPC_7457_V1_2 = 283
let UC_CPU_PPC_7447A_V1_0 = 284
let UC_CPU_PPC_7457A_V1_0 = 285
let UC_CPU_PPC_7447A_V1_1 = 286
let UC_CPU_PPC_7457A_V1_1 = 287
let UC_CPU_PPC_7447A_V1_2 = 288
let UC_CPU_PPC_7457A_V1_2 = 289
// PPC64 CPU
let UC_CPU_PPC_E5500 = 0
let UC_CPU_PPC_E6500 = 1
let UC_CPU_PPC_970_V2_2 = 2
let UC_CPU_PPC_970FX_V1_0 = 3
let UC_CPU_PPC_970FX_V2_0 = 4
let UC_CPU_PPC_970FX_V2_1 = 5
let UC_CPU_PPC_970FX_V3_0 = 6
let UC_CPU_PPC_970FX_V3_1 = 7
let UC_CPU_PPC_970MP_V1_0 = 8
let UC_CPU_PPC_970MP_V1_1 = 9
let UC_CPU_PPC_POWER5_V2_1 = 10
let UC_CPU_PPC_POWER7_V2_3 = 11
let UC_CPU_PPC_POWER7_V2_1 = 12
let UC_CPU_PPC_POWER8E_V2_1 = 13
let UC_CPU_PPC_POWER8_V2_0 = 14
let UC_CPU_PPC_POWER8NVL_V1_0 = 15
let UC_CPU_PPC_POWER9_V1_0 = 16
let UC_CPU_PPC_POWER9_V2_0 = 17
let UC_CPU_PPC_POWER10_V1_0 = 18
// PPC registers
let UC_PPC_REG_INVALID = 0
// General purpose registers
let UC_PPC_REG_PC = 1
let UC_PPC_REG_0 = 2
let UC_PPC_REG_1 = 3
let UC_PPC_REG_2 = 4
let UC_PPC_REG_3 = 5
let UC_PPC_REG_4 = 6
let UC_PPC_REG_5 = 7
let UC_PPC_REG_6 = 8
let UC_PPC_REG_7 = 9
let UC_PPC_REG_8 = 10
let UC_PPC_REG_9 = 11
let UC_PPC_REG_10 = 12
let UC_PPC_REG_11 = 13
let UC_PPC_REG_12 = 14
let UC_PPC_REG_13 = 15
let UC_PPC_REG_14 = 16
let UC_PPC_REG_15 = 17
let UC_PPC_REG_16 = 18
let UC_PPC_REG_17 = 19
let UC_PPC_REG_18 = 20
let UC_PPC_REG_19 = 21
let UC_PPC_REG_20 = 22
let UC_PPC_REG_21 = 23
let UC_PPC_REG_22 = 24
let UC_PPC_REG_23 = 25
let UC_PPC_REG_24 = 26
let UC_PPC_REG_25 = 27
let UC_PPC_REG_26 = 28
let UC_PPC_REG_27 = 29
let UC_PPC_REG_28 = 30
let UC_PPC_REG_29 = 31
let UC_PPC_REG_30 = 32
let UC_PPC_REG_31 = 33
let UC_PPC_REG_CR0 = 34
let UC_PPC_REG_CR1 = 35
let UC_PPC_REG_CR2 = 36
let UC_PPC_REG_CR3 = 37
let UC_PPC_REG_CR4 = 38
let UC_PPC_REG_CR5 = 39
let UC_PPC_REG_CR6 = 40
let UC_PPC_REG_CR7 = 41
let UC_PPC_REG_FPR0 = 42
let UC_PPC_REG_FPR1 = 43
let UC_PPC_REG_FPR2 = 44
let UC_PPC_REG_FPR3 = 45
let UC_PPC_REG_FPR4 = 46
let UC_PPC_REG_FPR5 = 47
let UC_PPC_REG_FPR6 = 48
let UC_PPC_REG_FPR7 = 49
let UC_PPC_REG_FPR8 = 50
let UC_PPC_REG_FPR9 = 51
let UC_PPC_REG_FPR10 = 52
let UC_PPC_REG_FPR11 = 53
let UC_PPC_REG_FPR12 = 54
let UC_PPC_REG_FPR13 = 55
let UC_PPC_REG_FPR14 = 56
let UC_PPC_REG_FPR15 = 57
let UC_PPC_REG_FPR16 = 58
let UC_PPC_REG_FPR17 = 59
let UC_PPC_REG_FPR18 = 60
let UC_PPC_REG_FPR19 = 61
let UC_PPC_REG_FPR20 = 62
let UC_PPC_REG_FPR21 = 63
let UC_PPC_REG_FPR22 = 64
let UC_PPC_REG_FPR23 = 65
let UC_PPC_REG_FPR24 = 66
let UC_PPC_REG_FPR25 = 67
let UC_PPC_REG_FPR26 = 68
let UC_PPC_REG_FPR27 = 69
let UC_PPC_REG_FPR28 = 70
let UC_PPC_REG_FPR29 = 71
let UC_PPC_REG_FPR30 = 72
let UC_PPC_REG_FPR31 = 73
let UC_PPC_REG_LR = 74
let UC_PPC_REG_XER = 75
let UC_PPC_REG_CTR = 76
let UC_PPC_REG_MSR = 77
let UC_PPC_REG_FPSCR = 78

View File

@ -0,0 +1,291 @@
// For Unicorn Engine. AUTO-GENERATED FILE, DO NOT EDIT
namespace UnicornManaged.Const
open System
[<AutoOpen>]
module Riscv =
// RISCV32 CPU
let UC_CPU_RISCV32_ANY = 0
let UC_CPU_RISCV32_BASE32 = 1
let UC_CPU_RISCV32_SIFIVE_E31 = 2
let UC_CPU_RISCV32_SIFIVE_U34 = 3
// RISCV64 CPU
let UC_CPU_RISCV64_ANY = 0
let UC_CPU_RISCV64_BASE64 = 1
let UC_CPU_RISCV64_SIFIVE_E51 = 2
let UC_CPU_RISCV64_SIFIVE_U54 = 3
// RISCV registers
let UC_RISCV_REG_INVALID = 0
// General purpose registers
let UC_RISCV_REG_X0 = 1
let UC_RISCV_REG_X1 = 2
let UC_RISCV_REG_X2 = 3
let UC_RISCV_REG_X3 = 4
let UC_RISCV_REG_X4 = 5
let UC_RISCV_REG_X5 = 6
let UC_RISCV_REG_X6 = 7
let UC_RISCV_REG_X7 = 8
let UC_RISCV_REG_X8 = 9
let UC_RISCV_REG_X9 = 10
let UC_RISCV_REG_X10 = 11
let UC_RISCV_REG_X11 = 12
let UC_RISCV_REG_X12 = 13
let UC_RISCV_REG_X13 = 14
let UC_RISCV_REG_X14 = 15
let UC_RISCV_REG_X15 = 16
let UC_RISCV_REG_X16 = 17
let UC_RISCV_REG_X17 = 18
let UC_RISCV_REG_X18 = 19
let UC_RISCV_REG_X19 = 20
let UC_RISCV_REG_X20 = 21
let UC_RISCV_REG_X21 = 22
let UC_RISCV_REG_X22 = 23
let UC_RISCV_REG_X23 = 24
let UC_RISCV_REG_X24 = 25
let UC_RISCV_REG_X25 = 26
let UC_RISCV_REG_X26 = 27
let UC_RISCV_REG_X27 = 28
let UC_RISCV_REG_X28 = 29
let UC_RISCV_REG_X29 = 30
let UC_RISCV_REG_X30 = 31
let UC_RISCV_REG_X31 = 32
// RISCV CSR
let UC_RISCV_REG_USTATUS = 33
let UC_RISCV_REG_UIE = 34
let UC_RISCV_REG_UTVEC = 35
let UC_RISCV_REG_USCRATCH = 36
let UC_RISCV_REG_UEPC = 37
let UC_RISCV_REG_UCAUSE = 38
let UC_RISCV_REG_UTVAL = 39
let UC_RISCV_REG_UIP = 40
let UC_RISCV_REG_FFLAGS = 41
let UC_RISCV_REG_FRM = 42
let UC_RISCV_REG_FCSR = 43
let UC_RISCV_REG_CYCLE = 44
let UC_RISCV_REG_TIME = 45
let UC_RISCV_REG_INSTRET = 46
let UC_RISCV_REG_HPMCOUNTER3 = 47
let UC_RISCV_REG_HPMCOUNTER4 = 48
let UC_RISCV_REG_HPMCOUNTER5 = 49
let UC_RISCV_REG_HPMCOUNTER6 = 50
let UC_RISCV_REG_HPMCOUNTER7 = 51
let UC_RISCV_REG_HPMCOUNTER8 = 52
let UC_RISCV_REG_HPMCOUNTER9 = 53
let UC_RISCV_REG_HPMCOUNTER10 = 54
let UC_RISCV_REG_HPMCOUNTER11 = 55
let UC_RISCV_REG_HPMCOUNTER12 = 56
let UC_RISCV_REG_HPMCOUNTER13 = 57
let UC_RISCV_REG_HPMCOUNTER14 = 58
let UC_RISCV_REG_HPMCOUNTER15 = 59
let UC_RISCV_REG_HPMCOUNTER16 = 60
let UC_RISCV_REG_HPMCOUNTER17 = 61
let UC_RISCV_REG_HPMCOUNTER18 = 62
let UC_RISCV_REG_HPMCOUNTER19 = 63
let UC_RISCV_REG_HPMCOUNTER20 = 64
let UC_RISCV_REG_HPMCOUNTER21 = 65
let UC_RISCV_REG_HPMCOUNTER22 = 66
let UC_RISCV_REG_HPMCOUNTER23 = 67
let UC_RISCV_REG_HPMCOUNTER24 = 68
let UC_RISCV_REG_HPMCOUNTER25 = 69
let UC_RISCV_REG_HPMCOUNTER26 = 70
let UC_RISCV_REG_HPMCOUNTER27 = 71
let UC_RISCV_REG_HPMCOUNTER28 = 72
let UC_RISCV_REG_HPMCOUNTER29 = 73
let UC_RISCV_REG_HPMCOUNTER30 = 74
let UC_RISCV_REG_HPMCOUNTER31 = 75
let UC_RISCV_REG_CYCLEH = 76
let UC_RISCV_REG_TIMEH = 77
let UC_RISCV_REG_INSTRETH = 78
let UC_RISCV_REG_HPMCOUNTER3H = 79
let UC_RISCV_REG_HPMCOUNTER4H = 80
let UC_RISCV_REG_HPMCOUNTER5H = 81
let UC_RISCV_REG_HPMCOUNTER6H = 82
let UC_RISCV_REG_HPMCOUNTER7H = 83
let UC_RISCV_REG_HPMCOUNTER8H = 84
let UC_RISCV_REG_HPMCOUNTER9H = 85
let UC_RISCV_REG_HPMCOUNTER10H = 86
let UC_RISCV_REG_HPMCOUNTER11H = 87
let UC_RISCV_REG_HPMCOUNTER12H = 88
let UC_RISCV_REG_HPMCOUNTER13H = 89
let UC_RISCV_REG_HPMCOUNTER14H = 90
let UC_RISCV_REG_HPMCOUNTER15H = 91
let UC_RISCV_REG_HPMCOUNTER16H = 92
let UC_RISCV_REG_HPMCOUNTER17H = 93
let UC_RISCV_REG_HPMCOUNTER18H = 94
let UC_RISCV_REG_HPMCOUNTER19H = 95
let UC_RISCV_REG_HPMCOUNTER20H = 96
let UC_RISCV_REG_HPMCOUNTER21H = 97
let UC_RISCV_REG_HPMCOUNTER22H = 98
let UC_RISCV_REG_HPMCOUNTER23H = 99
let UC_RISCV_REG_HPMCOUNTER24H = 100
let UC_RISCV_REG_HPMCOUNTER25H = 101
let UC_RISCV_REG_HPMCOUNTER26H = 102
let UC_RISCV_REG_HPMCOUNTER27H = 103
let UC_RISCV_REG_HPMCOUNTER28H = 104
let UC_RISCV_REG_HPMCOUNTER29H = 105
let UC_RISCV_REG_HPMCOUNTER30H = 106
let UC_RISCV_REG_HPMCOUNTER31H = 107
let UC_RISCV_REG_MCYCLE = 108
let UC_RISCV_REG_MINSTRET = 109
let UC_RISCV_REG_MCYCLEH = 110
let UC_RISCV_REG_MINSTRETH = 111
let UC_RISCV_REG_MVENDORID = 112
let UC_RISCV_REG_MARCHID = 113
let UC_RISCV_REG_MIMPID = 114
let UC_RISCV_REG_MHARTID = 115
let UC_RISCV_REG_MSTATUS = 116
let UC_RISCV_REG_MISA = 117
let UC_RISCV_REG_MEDELEG = 118
let UC_RISCV_REG_MIDELEG = 119
let UC_RISCV_REG_MIE = 120
let UC_RISCV_REG_MTVEC = 121
let UC_RISCV_REG_MCOUNTEREN = 122
let UC_RISCV_REG_MSTATUSH = 123
let UC_RISCV_REG_MUCOUNTEREN = 124
let UC_RISCV_REG_MSCOUNTEREN = 125
let UC_RISCV_REG_MHCOUNTEREN = 126
let UC_RISCV_REG_MSCRATCH = 127
let UC_RISCV_REG_MEPC = 128
let UC_RISCV_REG_MCAUSE = 129
let UC_RISCV_REG_MTVAL = 130
let UC_RISCV_REG_MIP = 131
let UC_RISCV_REG_MBADADDR = 132
let UC_RISCV_REG_SSTATUS = 133
let UC_RISCV_REG_SEDELEG = 134
let UC_RISCV_REG_SIDELEG = 135
let UC_RISCV_REG_SIE = 136
let UC_RISCV_REG_STVEC = 137
let UC_RISCV_REG_SCOUNTEREN = 138
let UC_RISCV_REG_SSCRATCH = 139
let UC_RISCV_REG_SEPC = 140
let UC_RISCV_REG_SCAUSE = 141
let UC_RISCV_REG_STVAL = 142
let UC_RISCV_REG_SIP = 143
let UC_RISCV_REG_SBADADDR = 144
let UC_RISCV_REG_SPTBR = 145
let UC_RISCV_REG_SATP = 146
let UC_RISCV_REG_HSTATUS = 147
let UC_RISCV_REG_HEDELEG = 148
let UC_RISCV_REG_HIDELEG = 149
let UC_RISCV_REG_HIE = 150
let UC_RISCV_REG_HCOUNTEREN = 151
let UC_RISCV_REG_HTVAL = 152
let UC_RISCV_REG_HIP = 153
let UC_RISCV_REG_HTINST = 154
let UC_RISCV_REG_HGATP = 155
let UC_RISCV_REG_HTIMEDELTA = 156
let UC_RISCV_REG_HTIMEDELTAH = 157
// Floating-point registers
let UC_RISCV_REG_F0 = 158
let UC_RISCV_REG_F1 = 159
let UC_RISCV_REG_F2 = 160
let UC_RISCV_REG_F3 = 161
let UC_RISCV_REG_F4 = 162
let UC_RISCV_REG_F5 = 163
let UC_RISCV_REG_F6 = 164
let UC_RISCV_REG_F7 = 165
let UC_RISCV_REG_F8 = 166
let UC_RISCV_REG_F9 = 167
let UC_RISCV_REG_F10 = 168
let UC_RISCV_REG_F11 = 169
let UC_RISCV_REG_F12 = 170
let UC_RISCV_REG_F13 = 171
let UC_RISCV_REG_F14 = 172
let UC_RISCV_REG_F15 = 173
let UC_RISCV_REG_F16 = 174
let UC_RISCV_REG_F17 = 175
let UC_RISCV_REG_F18 = 176
let UC_RISCV_REG_F19 = 177
let UC_RISCV_REG_F20 = 178
let UC_RISCV_REG_F21 = 179
let UC_RISCV_REG_F22 = 180
let UC_RISCV_REG_F23 = 181
let UC_RISCV_REG_F24 = 182
let UC_RISCV_REG_F25 = 183
let UC_RISCV_REG_F26 = 184
let UC_RISCV_REG_F27 = 185
let UC_RISCV_REG_F28 = 186
let UC_RISCV_REG_F29 = 187
let UC_RISCV_REG_F30 = 188
let UC_RISCV_REG_F31 = 189
let UC_RISCV_REG_PC = 190
let UC_RISCV_REG_ENDING = 191
// Alias registers
let UC_RISCV_REG_ZERO = 1
let UC_RISCV_REG_RA = 2
let UC_RISCV_REG_SP = 3
let UC_RISCV_REG_GP = 4
let UC_RISCV_REG_TP = 5
let UC_RISCV_REG_T0 = 6
let UC_RISCV_REG_T1 = 7
let UC_RISCV_REG_T2 = 8
let UC_RISCV_REG_S0 = 9
let UC_RISCV_REG_FP = 9
let UC_RISCV_REG_S1 = 10
let UC_RISCV_REG_A0 = 11
let UC_RISCV_REG_A1 = 12
let UC_RISCV_REG_A2 = 13
let UC_RISCV_REG_A3 = 14
let UC_RISCV_REG_A4 = 15
let UC_RISCV_REG_A5 = 16
let UC_RISCV_REG_A6 = 17
let UC_RISCV_REG_A7 = 18
let UC_RISCV_REG_S2 = 19
let UC_RISCV_REG_S3 = 20
let UC_RISCV_REG_S4 = 21
let UC_RISCV_REG_S5 = 22
let UC_RISCV_REG_S6 = 23
let UC_RISCV_REG_S7 = 24
let UC_RISCV_REG_S8 = 25
let UC_RISCV_REG_S9 = 26
let UC_RISCV_REG_S10 = 27
let UC_RISCV_REG_S11 = 28
let UC_RISCV_REG_T3 = 29
let UC_RISCV_REG_T4 = 30
let UC_RISCV_REG_T5 = 31
let UC_RISCV_REG_T6 = 32
let UC_RISCV_REG_FT0 = 158
let UC_RISCV_REG_FT1 = 159
let UC_RISCV_REG_FT2 = 160
let UC_RISCV_REG_FT3 = 161
let UC_RISCV_REG_FT4 = 162
let UC_RISCV_REG_FT5 = 163
let UC_RISCV_REG_FT6 = 164
let UC_RISCV_REG_FT7 = 165
let UC_RISCV_REG_FS0 = 166
let UC_RISCV_REG_FS1 = 167
let UC_RISCV_REG_FA0 = 168
let UC_RISCV_REG_FA1 = 169
let UC_RISCV_REG_FA2 = 170
let UC_RISCV_REG_FA3 = 171
let UC_RISCV_REG_FA4 = 172
let UC_RISCV_REG_FA5 = 173
let UC_RISCV_REG_FA6 = 174
let UC_RISCV_REG_FA7 = 175
let UC_RISCV_REG_FS2 = 176
let UC_RISCV_REG_FS3 = 177
let UC_RISCV_REG_FS4 = 178
let UC_RISCV_REG_FS5 = 179
let UC_RISCV_REG_FS6 = 180
let UC_RISCV_REG_FS7 = 181
let UC_RISCV_REG_FS8 = 182
let UC_RISCV_REG_FS9 = 183
let UC_RISCV_REG_FS10 = 184
let UC_RISCV_REG_FS11 = 185
let UC_RISCV_REG_FT8 = 186
let UC_RISCV_REG_FT9 = 187
let UC_RISCV_REG_FT10 = 188
let UC_RISCV_REG_FT11 = 189

View File

@ -0,0 +1,129 @@
// For Unicorn Engine. AUTO-GENERATED FILE, DO NOT EDIT
namespace UnicornManaged.Const
open System
[<AutoOpen>]
module S390x =
// S390X CPU
let UC_CPU_S390X_Z900 = 0
let UC_CPU_S390X_Z900_2 = 1
let UC_CPU_S390X_Z900_3 = 2
let UC_CPU_S390X_Z800 = 3
let UC_CPU_S390X_Z990 = 4
let UC_CPU_S390X_Z990_2 = 5
let UC_CPU_S390X_Z990_3 = 6
let UC_CPU_S390X_Z890 = 7
let UC_CPU_S390X_Z990_4 = 8
let UC_CPU_S390X_Z890_2 = 9
let UC_CPU_S390X_Z990_5 = 10
let UC_CPU_S390X_Z890_3 = 11
let UC_CPU_S390X_Z9EC = 12
let UC_CPU_S390X_Z9EC_2 = 13
let UC_CPU_S390X_Z9BC = 14
let UC_CPU_S390X_Z9EC_3 = 15
let UC_CPU_S390X_Z9BC_2 = 16
let UC_CPU_S390X_Z10EC = 17
let UC_CPU_S390X_Z10EC_2 = 18
let UC_CPU_S390X_Z10BC = 19
let UC_CPU_S390X_Z10EC_3 = 20
let UC_CPU_S390X_Z10BC_2 = 21
let UC_CPU_S390X_Z196 = 22
let UC_CPU_S390X_Z196_2 = 23
let UC_CPU_S390X_Z114 = 24
let UC_CPU_S390X_ZEC12 = 25
let UC_CPU_S390X_ZEC12_2 = 26
let UC_CPU_S390X_ZBC12 = 27
let UC_CPU_S390X_Z13 = 28
let UC_CPU_S390X_Z13_2 = 29
let UC_CPU_S390X_Z13S = 30
let UC_CPU_S390X_Z14 = 31
let UC_CPU_S390X_Z14_2 = 32
let UC_CPU_S390X_Z14ZR1 = 33
let UC_CPU_S390X_GEN15A = 34
let UC_CPU_S390X_GEN15B = 35
let UC_CPU_S390X_QEMU = 36
let UC_CPU_S390X_MAX = 37
// S390X registers
let UC_S390X_REG_INVALID = 0
// General purpose registers
let UC_S390X_REG_R0 = 1
let UC_S390X_REG_R1 = 2
let UC_S390X_REG_R2 = 3
let UC_S390X_REG_R3 = 4
let UC_S390X_REG_R4 = 5
let UC_S390X_REG_R5 = 6
let UC_S390X_REG_R6 = 7
let UC_S390X_REG_R7 = 8
let UC_S390X_REG_R8 = 9
let UC_S390X_REG_R9 = 10
let UC_S390X_REG_R10 = 11
let UC_S390X_REG_R11 = 12
let UC_S390X_REG_R12 = 13
let UC_S390X_REG_R13 = 14
let UC_S390X_REG_R14 = 15
let UC_S390X_REG_R15 = 16
// Floating point registers
let UC_S390X_REG_F0 = 17
let UC_S390X_REG_F1 = 18
let UC_S390X_REG_F2 = 19
let UC_S390X_REG_F3 = 20
let UC_S390X_REG_F4 = 21
let UC_S390X_REG_F5 = 22
let UC_S390X_REG_F6 = 23
let UC_S390X_REG_F7 = 24
let UC_S390X_REG_F8 = 25
let UC_S390X_REG_F9 = 26
let UC_S390X_REG_F10 = 27
let UC_S390X_REG_F11 = 28
let UC_S390X_REG_F12 = 29
let UC_S390X_REG_F13 = 30
let UC_S390X_REG_F14 = 31
let UC_S390X_REG_F15 = 32
let UC_S390X_REG_F16 = 33
let UC_S390X_REG_F17 = 34
let UC_S390X_REG_F18 = 35
let UC_S390X_REG_F19 = 36
let UC_S390X_REG_F20 = 37
let UC_S390X_REG_F21 = 38
let UC_S390X_REG_F22 = 39
let UC_S390X_REG_F23 = 40
let UC_S390X_REG_F24 = 41
let UC_S390X_REG_F25 = 42
let UC_S390X_REG_F26 = 43
let UC_S390X_REG_F27 = 44
let UC_S390X_REG_F28 = 45
let UC_S390X_REG_F29 = 46
let UC_S390X_REG_F30 = 47
let UC_S390X_REG_F31 = 48
// Access registers
let UC_S390X_REG_A0 = 49
let UC_S390X_REG_A1 = 50
let UC_S390X_REG_A2 = 51
let UC_S390X_REG_A3 = 52
let UC_S390X_REG_A4 = 53
let UC_S390X_REG_A5 = 54
let UC_S390X_REG_A6 = 55
let UC_S390X_REG_A7 = 56
let UC_S390X_REG_A8 = 57
let UC_S390X_REG_A9 = 58
let UC_S390X_REG_A10 = 59
let UC_S390X_REG_A11 = 60
let UC_S390X_REG_A12 = 61
let UC_S390X_REG_A13 = 62
let UC_S390X_REG_A14 = 63
let UC_S390X_REG_A15 = 64
let UC_S390X_REG_PC = 65
let UC_S390X_REG_PSWM = 66
let UC_S390X_REG_ENDING = 67
// Alias registers

View File

@ -7,6 +7,42 @@ open System
[<AutoOpen>]
module Sparc =
// SPARC32 CPU
let UC_CPU_SPARC32_FUJITSU_MB86904 = 0
let UC_CPU_SPARC32_FUJITSU_MB86907 = 1
let UC_CPU_SPARC32_TI_MICROSPARC_I = 2
let UC_CPU_SPARC32_TI_MICROSPARC_II = 3
let UC_CPU_SPARC32_TI_MICROSPARC_IIEP = 4
let UC_CPU_SPARC32_TI_SUPERSPARC_40 = 5
let UC_CPU_SPARC32_TI_SUPERSPARC_50 = 6
let UC_CPU_SPARC32_TI_SUPERSPARC_51 = 7
let UC_CPU_SPARC32_TI_SUPERSPARC_60 = 8
let UC_CPU_SPARC32_TI_SUPERSPARC_61 = 9
let UC_CPU_SPARC32_TI_SUPERSPARC_II = 10
let UC_CPU_SPARC32_LEON2 = 11
let UC_CPU_SPARC32_LEON3 = 12
// SPARC64 CPU
let UC_CPU_SPARC64_FUJITSU = 0
let UC_CPU_SPARC64_FUJITSU_III = 1
let UC_CPU_SPARC64_FUJITSU_IV = 2
let UC_CPU_SPARC64_FUJITSU_V = 3
let UC_CPU_SPARC64_TI_ULTRASPARC_I = 4
let UC_CPU_SPARC64_TI_ULTRASPARC_II = 5
let UC_CPU_SPARC64_TI_ULTRASPARC_III = 6
let UC_CPU_SPARC64_TI_ULTRASPARC_IIE = 7
let UC_CPU_SPARC64_SUN_ULTRASPARC_III = 8
let UC_CPU_SPARC64_SUN_ULTRASPARC_III_CU = 9
let UC_CPU_SPARC64_SUN_ULTRASPARC_IIII = 10
let UC_CPU_SPARC64_SUN_ULTRASPARC_IV = 11
let UC_CPU_SPARC64_SUN_ULTRASPARC_IV_PLUS = 12
let UC_CPU_SPARC64_SUN_ULTRASPARC_IIII_PLUS = 13
let UC_CPU_SPARC64_SUN_ULTRASPARC_T1 = 14
let UC_CPU_SPARC64_SUN_ULTRASPARC_T2 = 15
let UC_CPU_SPARC64_NEC_ULTRASPARC_I = 16
// SPARC registers
let UC_SPARC_REG_INVALID = 0

View File

@ -7,6 +7,47 @@ open System
[<AutoOpen>]
module X86 =
// X86 CPU
let UC_CPU_X86_QEMU64 = 0
let UC_CPU_X86_PHENOM = 1
let UC_CPU_X86_CORE2DUO = 2
let UC_CPU_X86_KVM64 = 3
let UC_CPU_X86_QEMU32 = 4
let UC_CPU_X86_KVM32 = 5
let UC_CPU_X86_COREDUO = 6
let UC_CPU_X86_486 = 7
let UC_CPU_X86_PENTIUM = 8
let UC_CPU_X86_PENTIUM2 = 9
let UC_CPU_X86_PENTIUM3 = 10
let UC_CPU_X86_ATHLON = 11
let UC_CPU_X86_N270 = 12
let UC_CPU_X86_CONROE = 13
let UC_CPU_X86_PENRYN = 14
let UC_CPU_X86_NEHALEM = 15
let UC_CPU_X86_WESTMERE = 16
let UC_CPU_X86_SANDYBRIDGE = 17
let UC_CPU_X86_IVYBRIDGE = 18
let UC_CPU_X86_HASWELL = 19
let UC_CPU_X86_BROADWELL = 20
let UC_CPU_X86_SKYLAKE_CLIENT = 21
let UC_CPU_X86_SKYLAKE_SERVER = 22
let UC_CPU_X86_CASCADELAKE_SERVER = 23
let UC_CPU_X86_COOPERLAKE = 24
let UC_CPU_X86_ICELAKE_CLIENT = 25
let UC_CPU_X86_ICELAKE_SERVER = 26
let UC_CPU_X86_DENVERTON = 27
let UC_CPU_X86_SNOWRIDGE = 28
let UC_CPU_X86_KNIGHTSMILL = 29
let UC_CPU_X86_OPTERON_G1 = 30
let UC_CPU_X86_OPTERON_G2 = 31
let UC_CPU_X86_OPTERON_G3 = 32
let UC_CPU_X86_OPTERON_G4 = 33
let UC_CPU_X86_OPTERON_G5 = 34
let UC_CPU_X86_EPYC = 35
let UC_CPU_X86_DHYANA = 36
let UC_CPU_X86_EPYC_ROME = 37
// X86 registers
let UC_X86_REG_INVALID = 0
@ -36,232 +77,219 @@ module X86 =
let UC_X86_REG_EDX = 24
let UC_X86_REG_EFLAGS = 25
let UC_X86_REG_EIP = 26
let UC_X86_REG_EIZ = 27
let UC_X86_REG_ES = 28
let UC_X86_REG_ESI = 29
let UC_X86_REG_ESP = 30
let UC_X86_REG_FPSW = 31
let UC_X86_REG_FS = 32
let UC_X86_REG_GS = 33
let UC_X86_REG_IP = 34
let UC_X86_REG_RAX = 35
let UC_X86_REG_RBP = 36
let UC_X86_REG_RBX = 37
let UC_X86_REG_RCX = 38
let UC_X86_REG_RDI = 39
let UC_X86_REG_RDX = 40
let UC_X86_REG_RIP = 41
let UC_X86_REG_RIZ = 42
let UC_X86_REG_RSI = 43
let UC_X86_REG_RSP = 44
let UC_X86_REG_SI = 45
let UC_X86_REG_SIL = 46
let UC_X86_REG_SP = 47
let UC_X86_REG_SPL = 48
let UC_X86_REG_SS = 49
let UC_X86_REG_CR0 = 50
let UC_X86_REG_CR1 = 51
let UC_X86_REG_CR2 = 52
let UC_X86_REG_CR3 = 53
let UC_X86_REG_CR4 = 54
let UC_X86_REG_CR5 = 55
let UC_X86_REG_CR6 = 56
let UC_X86_REG_CR7 = 57
let UC_X86_REG_CR8 = 58
let UC_X86_REG_CR9 = 59
let UC_X86_REG_CR10 = 60
let UC_X86_REG_CR11 = 61
let UC_X86_REG_CR12 = 62
let UC_X86_REG_CR13 = 63
let UC_X86_REG_CR14 = 64
let UC_X86_REG_CR15 = 65
let UC_X86_REG_DR0 = 66
let UC_X86_REG_DR1 = 67
let UC_X86_REG_DR2 = 68
let UC_X86_REG_DR3 = 69
let UC_X86_REG_DR4 = 70
let UC_X86_REG_DR5 = 71
let UC_X86_REG_DR6 = 72
let UC_X86_REG_DR7 = 73
let UC_X86_REG_DR8 = 74
let UC_X86_REG_DR9 = 75
let UC_X86_REG_DR10 = 76
let UC_X86_REG_DR11 = 77
let UC_X86_REG_DR12 = 78
let UC_X86_REG_DR13 = 79
let UC_X86_REG_DR14 = 80
let UC_X86_REG_DR15 = 81
let UC_X86_REG_FP0 = 82
let UC_X86_REG_FP1 = 83
let UC_X86_REG_FP2 = 84
let UC_X86_REG_FP3 = 85
let UC_X86_REG_FP4 = 86
let UC_X86_REG_FP5 = 87
let UC_X86_REG_FP6 = 88
let UC_X86_REG_FP7 = 89
let UC_X86_REG_K0 = 90
let UC_X86_REG_K1 = 91
let UC_X86_REG_K2 = 92
let UC_X86_REG_K3 = 93
let UC_X86_REG_K4 = 94
let UC_X86_REG_K5 = 95
let UC_X86_REG_K6 = 96
let UC_X86_REG_K7 = 97
let UC_X86_REG_MM0 = 98
let UC_X86_REG_MM1 = 99
let UC_X86_REG_MM2 = 100
let UC_X86_REG_MM3 = 101
let UC_X86_REG_MM4 = 102
let UC_X86_REG_MM5 = 103
let UC_X86_REG_MM6 = 104
let UC_X86_REG_MM7 = 105
let UC_X86_REG_R8 = 106
let UC_X86_REG_R9 = 107
let UC_X86_REG_R10 = 108
let UC_X86_REG_R11 = 109
let UC_X86_REG_R12 = 110
let UC_X86_REG_R13 = 111
let UC_X86_REG_R14 = 112
let UC_X86_REG_R15 = 113
let UC_X86_REG_ST0 = 114
let UC_X86_REG_ST1 = 115
let UC_X86_REG_ST2 = 116
let UC_X86_REG_ST3 = 117
let UC_X86_REG_ST4 = 118
let UC_X86_REG_ST5 = 119
let UC_X86_REG_ST6 = 120
let UC_X86_REG_ST7 = 121
let UC_X86_REG_XMM0 = 122
let UC_X86_REG_XMM1 = 123
let UC_X86_REG_XMM2 = 124
let UC_X86_REG_XMM3 = 125
let UC_X86_REG_XMM4 = 126
let UC_X86_REG_XMM5 = 127
let UC_X86_REG_XMM6 = 128
let UC_X86_REG_XMM7 = 129
let UC_X86_REG_XMM8 = 130
let UC_X86_REG_XMM9 = 131
let UC_X86_REG_XMM10 = 132
let UC_X86_REG_XMM11 = 133
let UC_X86_REG_XMM12 = 134
let UC_X86_REG_XMM13 = 135
let UC_X86_REG_XMM14 = 136
let UC_X86_REG_XMM15 = 137
let UC_X86_REG_XMM16 = 138
let UC_X86_REG_XMM17 = 139
let UC_X86_REG_XMM18 = 140
let UC_X86_REG_XMM19 = 141
let UC_X86_REG_XMM20 = 142
let UC_X86_REG_XMM21 = 143
let UC_X86_REG_XMM22 = 144
let UC_X86_REG_XMM23 = 145
let UC_X86_REG_XMM24 = 146
let UC_X86_REG_XMM25 = 147
let UC_X86_REG_XMM26 = 148
let UC_X86_REG_XMM27 = 149
let UC_X86_REG_XMM28 = 150
let UC_X86_REG_XMM29 = 151
let UC_X86_REG_XMM30 = 152
let UC_X86_REG_XMM31 = 153
let UC_X86_REG_YMM0 = 154
let UC_X86_REG_YMM1 = 155
let UC_X86_REG_YMM2 = 156
let UC_X86_REG_YMM3 = 157
let UC_X86_REG_YMM4 = 158
let UC_X86_REG_YMM5 = 159
let UC_X86_REG_YMM6 = 160
let UC_X86_REG_YMM7 = 161
let UC_X86_REG_YMM8 = 162
let UC_X86_REG_YMM9 = 163
let UC_X86_REG_YMM10 = 164
let UC_X86_REG_YMM11 = 165
let UC_X86_REG_YMM12 = 166
let UC_X86_REG_YMM13 = 167
let UC_X86_REG_YMM14 = 168
let UC_X86_REG_YMM15 = 169
let UC_X86_REG_YMM16 = 170
let UC_X86_REG_YMM17 = 171
let UC_X86_REG_YMM18 = 172
let UC_X86_REG_YMM19 = 173
let UC_X86_REG_YMM20 = 174
let UC_X86_REG_YMM21 = 175
let UC_X86_REG_YMM22 = 176
let UC_X86_REG_YMM23 = 177
let UC_X86_REG_YMM24 = 178
let UC_X86_REG_YMM25 = 179
let UC_X86_REG_YMM26 = 180
let UC_X86_REG_YMM27 = 181
let UC_X86_REG_YMM28 = 182
let UC_X86_REG_YMM29 = 183
let UC_X86_REG_YMM30 = 184
let UC_X86_REG_YMM31 = 185
let UC_X86_REG_ZMM0 = 186
let UC_X86_REG_ZMM1 = 187
let UC_X86_REG_ZMM2 = 188
let UC_X86_REG_ZMM3 = 189
let UC_X86_REG_ZMM4 = 190
let UC_X86_REG_ZMM5 = 191
let UC_X86_REG_ZMM6 = 192
let UC_X86_REG_ZMM7 = 193
let UC_X86_REG_ZMM8 = 194
let UC_X86_REG_ZMM9 = 195
let UC_X86_REG_ZMM10 = 196
let UC_X86_REG_ZMM11 = 197
let UC_X86_REG_ZMM12 = 198
let UC_X86_REG_ZMM13 = 199
let UC_X86_REG_ZMM14 = 200
let UC_X86_REG_ZMM15 = 201
let UC_X86_REG_ZMM16 = 202
let UC_X86_REG_ZMM17 = 203
let UC_X86_REG_ZMM18 = 204
let UC_X86_REG_ZMM19 = 205
let UC_X86_REG_ZMM20 = 206
let UC_X86_REG_ZMM21 = 207
let UC_X86_REG_ZMM22 = 208
let UC_X86_REG_ZMM23 = 209
let UC_X86_REG_ZMM24 = 210
let UC_X86_REG_ZMM25 = 211
let UC_X86_REG_ZMM26 = 212
let UC_X86_REG_ZMM27 = 213
let UC_X86_REG_ZMM28 = 214
let UC_X86_REG_ZMM29 = 215
let UC_X86_REG_ZMM30 = 216
let UC_X86_REG_ZMM31 = 217
let UC_X86_REG_R8B = 218
let UC_X86_REG_R9B = 219
let UC_X86_REG_R10B = 220
let UC_X86_REG_R11B = 221
let UC_X86_REG_R12B = 222
let UC_X86_REG_R13B = 223
let UC_X86_REG_R14B = 224
let UC_X86_REG_R15B = 225
let UC_X86_REG_R8D = 226
let UC_X86_REG_R9D = 227
let UC_X86_REG_R10D = 228
let UC_X86_REG_R11D = 229
let UC_X86_REG_R12D = 230
let UC_X86_REG_R13D = 231
let UC_X86_REG_R14D = 232
let UC_X86_REG_R15D = 233
let UC_X86_REG_R8W = 234
let UC_X86_REG_R9W = 235
let UC_X86_REG_R10W = 236
let UC_X86_REG_R11W = 237
let UC_X86_REG_R12W = 238
let UC_X86_REG_R13W = 239
let UC_X86_REG_R14W = 240
let UC_X86_REG_R15W = 241
let UC_X86_REG_IDTR = 242
let UC_X86_REG_GDTR = 243
let UC_X86_REG_LDTR = 244
let UC_X86_REG_TR = 245
let UC_X86_REG_FPCW = 246
let UC_X86_REG_FPTAG = 247
let UC_X86_REG_MSR = 248
let UC_X86_REG_MXCSR = 249
let UC_X86_REG_FS_BASE = 250
let UC_X86_REG_GS_BASE = 251
let UC_X86_REG_ENDING = 252
let UC_X86_REG_ES = 27
let UC_X86_REG_ESI = 28
let UC_X86_REG_ESP = 29
let UC_X86_REG_FPSW = 30
let UC_X86_REG_FS = 31
let UC_X86_REG_GS = 32
let UC_X86_REG_IP = 33
let UC_X86_REG_RAX = 34
let UC_X86_REG_RBP = 35
let UC_X86_REG_RBX = 36
let UC_X86_REG_RCX = 37
let UC_X86_REG_RDI = 38
let UC_X86_REG_RDX = 39
let UC_X86_REG_RIP = 40
let UC_X86_REG_RSI = 41
let UC_X86_REG_RSP = 42
let UC_X86_REG_SI = 43
let UC_X86_REG_SIL = 44
let UC_X86_REG_SP = 45
let UC_X86_REG_SPL = 46
let UC_X86_REG_SS = 47
let UC_X86_REG_CR0 = 48
let UC_X86_REG_CR1 = 49
let UC_X86_REG_CR2 = 50
let UC_X86_REG_CR3 = 51
let UC_X86_REG_CR4 = 52
let UC_X86_REG_CR8 = 53
let UC_X86_REG_DR0 = 54
let UC_X86_REG_DR1 = 55
let UC_X86_REG_DR2 = 56
let UC_X86_REG_DR3 = 57
let UC_X86_REG_DR4 = 58
let UC_X86_REG_DR5 = 59
let UC_X86_REG_DR6 = 60
let UC_X86_REG_DR7 = 61
let UC_X86_REG_FP0 = 62
let UC_X86_REG_FP1 = 63
let UC_X86_REG_FP2 = 64
let UC_X86_REG_FP3 = 65
let UC_X86_REG_FP4 = 66
let UC_X86_REG_FP5 = 67
let UC_X86_REG_FP6 = 68
let UC_X86_REG_FP7 = 69
let UC_X86_REG_K0 = 70
let UC_X86_REG_K1 = 71
let UC_X86_REG_K2 = 72
let UC_X86_REG_K3 = 73
let UC_X86_REG_K4 = 74
let UC_X86_REG_K5 = 75
let UC_X86_REG_K6 = 76
let UC_X86_REG_K7 = 77
let UC_X86_REG_MM0 = 78
let UC_X86_REG_MM1 = 79
let UC_X86_REG_MM2 = 80
let UC_X86_REG_MM3 = 81
let UC_X86_REG_MM4 = 82
let UC_X86_REG_MM5 = 83
let UC_X86_REG_MM6 = 84
let UC_X86_REG_MM7 = 85
let UC_X86_REG_R8 = 86
let UC_X86_REG_R9 = 87
let UC_X86_REG_R10 = 88
let UC_X86_REG_R11 = 89
let UC_X86_REG_R12 = 90
let UC_X86_REG_R13 = 91
let UC_X86_REG_R14 = 92
let UC_X86_REG_R15 = 93
let UC_X86_REG_ST0 = 94
let UC_X86_REG_ST1 = 95
let UC_X86_REG_ST2 = 96
let UC_X86_REG_ST3 = 97
let UC_X86_REG_ST4 = 98
let UC_X86_REG_ST5 = 99
let UC_X86_REG_ST6 = 100
let UC_X86_REG_ST7 = 101
let UC_X86_REG_XMM0 = 102
let UC_X86_REG_XMM1 = 103
let UC_X86_REG_XMM2 = 104
let UC_X86_REG_XMM3 = 105
let UC_X86_REG_XMM4 = 106
let UC_X86_REG_XMM5 = 107
let UC_X86_REG_XMM6 = 108
let UC_X86_REG_XMM7 = 109
let UC_X86_REG_XMM8 = 110
let UC_X86_REG_XMM9 = 111
let UC_X86_REG_XMM10 = 112
let UC_X86_REG_XMM11 = 113
let UC_X86_REG_XMM12 = 114
let UC_X86_REG_XMM13 = 115
let UC_X86_REG_XMM14 = 116
let UC_X86_REG_XMM15 = 117
let UC_X86_REG_XMM16 = 118
let UC_X86_REG_XMM17 = 119
let UC_X86_REG_XMM18 = 120
let UC_X86_REG_XMM19 = 121
let UC_X86_REG_XMM20 = 122
let UC_X86_REG_XMM21 = 123
let UC_X86_REG_XMM22 = 124
let UC_X86_REG_XMM23 = 125
let UC_X86_REG_XMM24 = 126
let UC_X86_REG_XMM25 = 127
let UC_X86_REG_XMM26 = 128
let UC_X86_REG_XMM27 = 129
let UC_X86_REG_XMM28 = 130
let UC_X86_REG_XMM29 = 131
let UC_X86_REG_XMM30 = 132
let UC_X86_REG_XMM31 = 133
let UC_X86_REG_YMM0 = 134
let UC_X86_REG_YMM1 = 135
let UC_X86_REG_YMM2 = 136
let UC_X86_REG_YMM3 = 137
let UC_X86_REG_YMM4 = 138
let UC_X86_REG_YMM5 = 139
let UC_X86_REG_YMM6 = 140
let UC_X86_REG_YMM7 = 141
let UC_X86_REG_YMM8 = 142
let UC_X86_REG_YMM9 = 143
let UC_X86_REG_YMM10 = 144
let UC_X86_REG_YMM11 = 145
let UC_X86_REG_YMM12 = 146
let UC_X86_REG_YMM13 = 147
let UC_X86_REG_YMM14 = 148
let UC_X86_REG_YMM15 = 149
let UC_X86_REG_YMM16 = 150
let UC_X86_REG_YMM17 = 151
let UC_X86_REG_YMM18 = 152
let UC_X86_REG_YMM19 = 153
let UC_X86_REG_YMM20 = 154
let UC_X86_REG_YMM21 = 155
let UC_X86_REG_YMM22 = 156
let UC_X86_REG_YMM23 = 157
let UC_X86_REG_YMM24 = 158
let UC_X86_REG_YMM25 = 159
let UC_X86_REG_YMM26 = 160
let UC_X86_REG_YMM27 = 161
let UC_X86_REG_YMM28 = 162
let UC_X86_REG_YMM29 = 163
let UC_X86_REG_YMM30 = 164
let UC_X86_REG_YMM31 = 165
let UC_X86_REG_ZMM0 = 166
let UC_X86_REG_ZMM1 = 167
let UC_X86_REG_ZMM2 = 168
let UC_X86_REG_ZMM3 = 169
let UC_X86_REG_ZMM4 = 170
let UC_X86_REG_ZMM5 = 171
let UC_X86_REG_ZMM6 = 172
let UC_X86_REG_ZMM7 = 173
let UC_X86_REG_ZMM8 = 174
let UC_X86_REG_ZMM9 = 175
let UC_X86_REG_ZMM10 = 176
let UC_X86_REG_ZMM11 = 177
let UC_X86_REG_ZMM12 = 178
let UC_X86_REG_ZMM13 = 179
let UC_X86_REG_ZMM14 = 180
let UC_X86_REG_ZMM15 = 181
let UC_X86_REG_ZMM16 = 182
let UC_X86_REG_ZMM17 = 183
let UC_X86_REG_ZMM18 = 184
let UC_X86_REG_ZMM19 = 185
let UC_X86_REG_ZMM20 = 186
let UC_X86_REG_ZMM21 = 187
let UC_X86_REG_ZMM22 = 188
let UC_X86_REG_ZMM23 = 189
let UC_X86_REG_ZMM24 = 190
let UC_X86_REG_ZMM25 = 191
let UC_X86_REG_ZMM26 = 192
let UC_X86_REG_ZMM27 = 193
let UC_X86_REG_ZMM28 = 194
let UC_X86_REG_ZMM29 = 195
let UC_X86_REG_ZMM30 = 196
let UC_X86_REG_ZMM31 = 197
let UC_X86_REG_R8B = 198
let UC_X86_REG_R9B = 199
let UC_X86_REG_R10B = 200
let UC_X86_REG_R11B = 201
let UC_X86_REG_R12B = 202
let UC_X86_REG_R13B = 203
let UC_X86_REG_R14B = 204
let UC_X86_REG_R15B = 205
let UC_X86_REG_R8D = 206
let UC_X86_REG_R9D = 207
let UC_X86_REG_R10D = 208
let UC_X86_REG_R11D = 209
let UC_X86_REG_R12D = 210
let UC_X86_REG_R13D = 211
let UC_X86_REG_R14D = 212
let UC_X86_REG_R15D = 213
let UC_X86_REG_R8W = 214
let UC_X86_REG_R9W = 215
let UC_X86_REG_R10W = 216
let UC_X86_REG_R11W = 217
let UC_X86_REG_R12W = 218
let UC_X86_REG_R13W = 219
let UC_X86_REG_R14W = 220
let UC_X86_REG_R15W = 221
let UC_X86_REG_IDTR = 222
let UC_X86_REG_GDTR = 223
let UC_X86_REG_LDTR = 224
let UC_X86_REG_TR = 225
let UC_X86_REG_FPCW = 226
let UC_X86_REG_FPTAG = 227
let UC_X86_REG_MSR = 228
let UC_X86_REG_MXCSR = 229
let UC_X86_REG_FS_BASE = 230
let UC_X86_REG_GS_BASE = 231
let UC_X86_REG_FLAGS = 232
let UC_X86_REG_RFLAGS = 233
let UC_X86_REG_FIP = 234
let UC_X86_REG_FCS = 235
let UC_X86_REG_FDP = 236
let UC_X86_REG_FDS = 237
let UC_X86_REG_FOP = 238
let UC_X86_REG_ENDING = 239
// X86 instructions

View File

@ -6,7 +6,7 @@ all: gen_const
cd unicorn && go build
gen_const:
cd .. && python const_generator.py go
cd .. && python3 const_generator.py go
test: all
cd unicorn && LD_LIBRARY_PATH=../../../ DYLD_LIBRARY_PATH=../../../ go test

View File

@ -2,6 +2,13 @@ package unicorn
// For Unicorn Engine. AUTO-GENERATED FILE, DO NOT EDIT [arm64_const.go]
const (
// ARM64 CPU
CPU_AARCH64_A57 = 0
CPU_AARCH64_A53 = 1
CPU_AARCH64_A72 = 2
CPU_AARCH64_MAX = 3
// ARM64 registers
ARM64_REG_INVALID = 0

View File

@ -2,6 +2,43 @@ package unicorn
// For Unicorn Engine. AUTO-GENERATED FILE, DO NOT EDIT [arm_const.go]
const (
// ARM CPU
CPU_ARM_926 = 0
CPU_ARM_946 = 1
CPU_ARM_1026 = 2
CPU_ARM_1136_R2 = 3
CPU_ARM_1136 = 4
CPU_ARM_1176 = 5
CPU_ARM_11MPCORE = 6
CPU_ARM_CORTEX_M0 = 7
CPU_ARM_CORTEX_M3 = 8
CPU_ARM_CORTEX_M4 = 9
CPU_ARM_CORTEX_M7 = 10
CPU_ARM_CORTEX_M33 = 11
CPU_ARM_CORTEX_R5 = 12
CPU_ARM_CORTEX_R5F = 13
CPU_ARM_CORTEX_A7 = 14
CPU_ARM_CORTEX_A8 = 15
CPU_ARM_CORTEX_A9 = 16
CPU_ARM_CORTEX_A15 = 17
CPU_ARM_TI925T = 18
CPU_ARM_SA1100 = 19
CPU_ARM_SA1110 = 20
CPU_ARM_PXA250 = 21
CPU_ARM_PXA255 = 22
CPU_ARM_PXA260 = 23
CPU_ARM_PXA261 = 24
CPU_ARM_PXA262 = 25
CPU_ARM_PXA270 = 26
CPU_ARM_PXA270A0 = 27
CPU_ARM_PXA270A1 = 28
CPU_ARM_PXA270B0 = 29
CPU_ARM_PXA270B1 = 30
CPU_ARM_PXA270C0 = 31
CPU_ARM_PXA270C5 = 32
CPU_ARM_MAX = 33
// ARM registers
ARM_REG_INVALID = 0
@ -122,7 +159,28 @@ const (
ARM_REG_MSP = 115
ARM_REG_PSP = 116
ARM_REG_CONTROL = 117
ARM_REG_ENDING = 118
ARM_REG_IAPSR = 118
ARM_REG_EAPSR = 119
ARM_REG_XPSR = 120
ARM_REG_EPSR = 121
ARM_REG_IEPSR = 122
ARM_REG_PRIMASK = 123
ARM_REG_BASEPRI = 124
ARM_REG_BASEPRI_MAX = 125
ARM_REG_FAULTMASK = 126
ARM_REG_APSR_NZCVQ = 127
ARM_REG_APSR_G = 128
ARM_REG_APSR_NZCVQG = 129
ARM_REG_IAPSR_NZCVQ = 130
ARM_REG_IAPSR_G = 131
ARM_REG_IAPSR_NZCVQG = 132
ARM_REG_EAPSR_NZCVQ = 133
ARM_REG_EAPSR_G = 134
ARM_REG_EAPSR_NZCVQG = 135
ARM_REG_XPSR_NZCVQ = 136
ARM_REG_XPSR_G = 137
ARM_REG_XPSR_NZCVQG = 138
ARM_REG_ENDING = 139
// alias registers
ARM_REG_R13 = 12

View File

@ -2,6 +2,18 @@ package unicorn
// For Unicorn Engine. AUTO-GENERATED FILE, DO NOT EDIT [m68k_const.go]
const (
// M68K CPU
CPU_M68K_M5206 = 0
CPU_M68K_M68000 = 1
CPU_M68K_M68020 = 2
CPU_M68K_M68030 = 3
CPU_M68K_M68040 = 4
CPU_M68K_M68060 = 5
CPU_M68K_M5208 = 6
CPU_M68K_CFV4E = 7
CPU_M68K_ANY = 8
// M68K registers
M68K_REG_INVALID = 0

View File

@ -2,6 +2,41 @@ package unicorn
// For Unicorn Engine. AUTO-GENERATED FILE, DO NOT EDIT [mips_const.go]
const (
// MIPS32 CPUS
CPU_MIPS32_4KC = 0
CPU_MIPS32_4KM = 1
CPU_MIPS32_4KECR1 = 2
CPU_MIPS32_4KEMR1 = 3
CPU_MIPS32_4KEC = 4
CPU_MIPS32_4KEM = 5
CPU_MIPS32_24KC = 6
CPU_MIPS32_24KEC = 7
CPU_MIPS32_24KF = 8
CPU_MIPS32_34KF = 9
CPU_MIPS32_74KF = 10
CPU_MIPS32_M14K = 11
CPU_MIPS32_M14KC = 12
CPU_MIPS32_P5600 = 13
CPU_MIPS32_MIPS32R6_GENERIC = 14
CPU_MIPS32_I7200 = 15
// MIPS64 CPUS
CPU_MIPS64_R4000 = 0
CPU_MIPS64_VR5432 = 1
CPU_MIPS64_5KC = 2
CPU_MIPS64_5KF = 3
CPU_MIPS64_20KC = 4
CPU_MIPS64_MIPS64R2_GENERIC = 5
CPU_MIPS64_5KEC = 6
CPU_MIPS64_5KEF = 7
CPU_MIPS64_I6400 = 8
CPU_MIPS64_I6500 = 9
CPU_MIPS64_LOONGSON_2E = 10
CPU_MIPS64_LOONGSON_2F = 11
CPU_MIPS64_MIPS64DSPR2 = 12
// MIPS registers
MIPS_REG_INVALID = 0
@ -155,7 +190,8 @@ const (
MIPS_REG_MPL2 = 136
MIPS_REG_CP0_CONFIG3 = 137
MIPS_REG_CP0_USERLOCAL = 138
MIPS_REG_ENDING = 139
MIPS_REG_CP0_STATUS = 139
MIPS_REG_ENDING = 140
MIPS_REG_ZERO = 2
MIPS_REG_AT = 3
MIPS_REG_V0 = 4

View File

@ -0,0 +1,403 @@
package unicorn
// For Unicorn Engine. AUTO-GENERATED FILE, DO NOT EDIT [ppc_const.go]
const (
// PPC CPU
CPU_PPC_401 = 0
CPU_PPC_401A1 = 1
CPU_PPC_401B2 = 2
CPU_PPC_401C2 = 3
CPU_PPC_401D2 = 4
CPU_PPC_401E2 = 5
CPU_PPC_401F2 = 6
CPU_PPC_401G2 = 7
CPU_PPC_IOP480 = 8
CPU_PPC_COBRA = 9
CPU_PPC_403GA = 10
CPU_PPC_403GB = 11
CPU_PPC_403GC = 12
CPU_PPC_403GCX = 13
CPU_PPC_405D2 = 14
CPU_PPC_405D4 = 15
CPU_PPC_405CRA = 16
CPU_PPC_405CRB = 17
CPU_PPC_405CRC = 18
CPU_PPC_405EP = 19
CPU_PPC_405EZ = 20
CPU_PPC_405GPA = 21
CPU_PPC_405GPB = 22
CPU_PPC_405GPC = 23
CPU_PPC_405GPD = 24
CPU_PPC_405GPR = 25
CPU_PPC_405LP = 26
CPU_PPC_NPE405H = 27
CPU_PPC_NPE405H2 = 28
CPU_PPC_NPE405L = 29
CPU_PPC_NPE4GS3 = 30
CPU_PPC_STB03 = 31
CPU_PPC_STB04 = 32
CPU_PPC_STB25 = 33
CPU_PPC_X2VP4 = 34
CPU_PPC_X2VP20 = 35
CPU_PPC_440_XILINX = 36
CPU_PPC_440_XILINX_W_DFPU = 37
CPU_PPC_440EPA = 38
CPU_PPC_440EPB = 39
CPU_PPC_440EPX = 40
CPU_PPC_460EXB = 41
CPU_PPC_G2 = 42
CPU_PPC_G2H4 = 43
CPU_PPC_G2GP = 44
CPU_PPC_G2LS = 45
CPU_PPC_G2HIP3 = 46
CPU_PPC_G2HIP4 = 47
CPU_PPC_MPC603 = 48
CPU_PPC_G2LE = 49
CPU_PPC_G2LEGP = 50
CPU_PPC_G2LELS = 51
CPU_PPC_G2LEGP1 = 52
CPU_PPC_G2LEGP3 = 53
CPU_PPC_MPC5200_V10 = 54
CPU_PPC_MPC5200_V11 = 55
CPU_PPC_MPC5200_V12 = 56
CPU_PPC_MPC5200B_V20 = 57
CPU_PPC_MPC5200B_V21 = 58
CPU_PPC_E200Z5 = 59
CPU_PPC_E200Z6 = 60
CPU_PPC_E300C1 = 61
CPU_PPC_E300C2 = 62
CPU_PPC_E300C3 = 63
CPU_PPC_E300C4 = 64
CPU_PPC_MPC8343 = 65
CPU_PPC_MPC8343A = 66
CPU_PPC_MPC8343E = 67
CPU_PPC_MPC8343EA = 68
CPU_PPC_MPC8347T = 69
CPU_PPC_MPC8347P = 70
CPU_PPC_MPC8347AT = 71
CPU_PPC_MPC8347AP = 72
CPU_PPC_MPC8347ET = 73
CPU_PPC_MPC8347EP = 74
CPU_PPC_MPC8347EAT = 75
CPU_PPC_MPC8347EAP = 76
CPU_PPC_MPC8349 = 77
CPU_PPC_MPC8349A = 78
CPU_PPC_MPC8349E = 79
CPU_PPC_MPC8349EA = 80
CPU_PPC_MPC8377 = 81
CPU_PPC_MPC8377E = 82
CPU_PPC_MPC8378 = 83
CPU_PPC_MPC8378E = 84
CPU_PPC_MPC8379 = 85
CPU_PPC_MPC8379E = 86
CPU_PPC_E500_V10 = 87
CPU_PPC_E500_V20 = 88
CPU_PPC_E500V2_V10 = 89
CPU_PPC_E500V2_V20 = 90
CPU_PPC_E500V2_V21 = 91
CPU_PPC_E500V2_V22 = 92
CPU_PPC_E500V2_V30 = 93
CPU_PPC_E500MC = 94
CPU_PPC_MPC8533_V10 = 95
CPU_PPC_MPC8533_V11 = 96
CPU_PPC_MPC8533E_V10 = 97
CPU_PPC_MPC8533E_V11 = 98
CPU_PPC_MPC8540_V10 = 99
CPU_PPC_MPC8540_V20 = 100
CPU_PPC_MPC8540_V21 = 101
CPU_PPC_MPC8541_V10 = 102
CPU_PPC_MPC8541_V11 = 103
CPU_PPC_MPC8541E_V10 = 104
CPU_PPC_MPC8541E_V11 = 105
CPU_PPC_MPC8543_V10 = 106
CPU_PPC_MPC8543_V11 = 107
CPU_PPC_MPC8543_V20 = 108
CPU_PPC_MPC8543_V21 = 109
CPU_PPC_MPC8543E_V10 = 110
CPU_PPC_MPC8543E_V11 = 111
CPU_PPC_MPC8543E_V20 = 112
CPU_PPC_MPC8543E_V21 = 113
CPU_PPC_MPC8544_V10 = 114
CPU_PPC_MPC8544_V11 = 115
CPU_PPC_MPC8544E_V10 = 116
CPU_PPC_MPC8544E_V11 = 117
CPU_PPC_MPC8545_V20 = 118
CPU_PPC_MPC8545_V21 = 119
CPU_PPC_MPC8545E_V20 = 120
CPU_PPC_MPC8545E_V21 = 121
CPU_PPC_MPC8547E_V20 = 122
CPU_PPC_MPC8547E_V21 = 123
CPU_PPC_MPC8548_V10 = 124
CPU_PPC_MPC8548_V11 = 125
CPU_PPC_MPC8548_V20 = 126
CPU_PPC_MPC8548_V21 = 127
CPU_PPC_MPC8548E_V10 = 128
CPU_PPC_MPC8548E_V11 = 129
CPU_PPC_MPC8548E_V20 = 130
CPU_PPC_MPC8548E_V21 = 131
CPU_PPC_MPC8555_V10 = 132
CPU_PPC_MPC8555_V11 = 133
CPU_PPC_MPC8555E_V10 = 134
CPU_PPC_MPC8555E_V11 = 135
CPU_PPC_MPC8560_V10 = 136
CPU_PPC_MPC8560_V20 = 137
CPU_PPC_MPC8560_V21 = 138
CPU_PPC_MPC8567 = 139
CPU_PPC_MPC8567E = 140
CPU_PPC_MPC8568 = 141
CPU_PPC_MPC8568E = 142
CPU_PPC_MPC8572 = 143
CPU_PPC_MPC8572E = 144
CPU_PPC_E600 = 145
CPU_PPC_MPC8610 = 146
CPU_PPC_MPC8641 = 147
CPU_PPC_MPC8641D = 148
CPU_PPC_601_V0 = 149
CPU_PPC_601_V1 = 150
CPU_PPC_601_V2 = 151
CPU_PPC_602 = 152
CPU_PPC_603 = 153
CPU_PPC_603E_V1_1 = 154
CPU_PPC_603E_V1_2 = 155
CPU_PPC_603E_V1_3 = 156
CPU_PPC_603E_V1_4 = 157
CPU_PPC_603E_V2_2 = 158
CPU_PPC_603E_V3 = 159
CPU_PPC_603E_V4 = 160
CPU_PPC_603E_V4_1 = 161
CPU_PPC_603E7 = 162
CPU_PPC_603E7T = 163
CPU_PPC_603E7V = 164
CPU_PPC_603E7V1 = 165
CPU_PPC_603E7V2 = 166
CPU_PPC_603P = 167
CPU_PPC_604 = 168
CPU_PPC_604E_V1_0 = 169
CPU_PPC_604E_V2_2 = 170
CPU_PPC_604E_V2_4 = 171
CPU_PPC_604R = 172
CPU_PPC_740_V1_0 = 173
CPU_PPC_750_V1_0 = 174
CPU_PPC_740_V2_0 = 175
CPU_PPC_750_V2_0 = 176
CPU_PPC_740_V2_1 = 177
CPU_PPC_750_V2_1 = 178
CPU_PPC_740_V2_2 = 179
CPU_PPC_750_V2_2 = 180
CPU_PPC_740_V3_0 = 181
CPU_PPC_750_V3_0 = 182
CPU_PPC_740_V3_1 = 183
CPU_PPC_750_V3_1 = 184
CPU_PPC_740E = 185
CPU_PPC_750E = 186
CPU_PPC_740P = 187
CPU_PPC_750P = 188
CPU_PPC_750CL_V1_0 = 189
CPU_PPC_750CL_V2_0 = 190
CPU_PPC_750CX_V1_0 = 191
CPU_PPC_750CX_V2_0 = 192
CPU_PPC_750CX_V2_1 = 193
CPU_PPC_750CX_V2_2 = 194
CPU_PPC_750CXE_V2_1 = 195
CPU_PPC_750CXE_V2_2 = 196
CPU_PPC_750CXE_V2_3 = 197
CPU_PPC_750CXE_V2_4 = 198
CPU_PPC_750CXE_V2_4B = 199
CPU_PPC_750CXE_V3_0 = 200
CPU_PPC_750CXE_V3_1 = 201
CPU_PPC_750CXE_V3_1B = 202
CPU_PPC_750CXR = 203
CPU_PPC_750FL = 204
CPU_PPC_750FX_V1_0 = 205
CPU_PPC_750FX_V2_0 = 206
CPU_PPC_750FX_V2_1 = 207
CPU_PPC_750FX_V2_2 = 208
CPU_PPC_750FX_V2_3 = 209
CPU_PPC_750GL = 210
CPU_PPC_750GX_V1_0 = 211
CPU_PPC_750GX_V1_1 = 212
CPU_PPC_750GX_V1_2 = 213
CPU_PPC_750L_V2_0 = 214
CPU_PPC_750L_V2_1 = 215
CPU_PPC_750L_V2_2 = 216
CPU_PPC_750L_V3_0 = 217
CPU_PPC_750L_V3_2 = 218
CPU_PPC_745_V1_0 = 219
CPU_PPC_755_V1_0 = 220
CPU_PPC_745_V1_1 = 221
CPU_PPC_755_V1_1 = 222
CPU_PPC_745_V2_0 = 223
CPU_PPC_755_V2_0 = 224
CPU_PPC_745_V2_1 = 225
CPU_PPC_755_V2_1 = 226
CPU_PPC_745_V2_2 = 227
CPU_PPC_755_V2_2 = 228
CPU_PPC_745_V2_3 = 229
CPU_PPC_755_V2_3 = 230
CPU_PPC_745_V2_4 = 231
CPU_PPC_755_V2_4 = 232
CPU_PPC_745_V2_5 = 233
CPU_PPC_755_V2_5 = 234
CPU_PPC_745_V2_6 = 235
CPU_PPC_755_V2_6 = 236
CPU_PPC_745_V2_7 = 237
CPU_PPC_755_V2_7 = 238
CPU_PPC_745_V2_8 = 239
CPU_PPC_755_V2_8 = 240
CPU_PPC_7400_V1_0 = 241
CPU_PPC_7400_V1_1 = 242
CPU_PPC_7400_V2_0 = 243
CPU_PPC_7400_V2_1 = 244
CPU_PPC_7400_V2_2 = 245
CPU_PPC_7400_V2_6 = 246
CPU_PPC_7400_V2_7 = 247
CPU_PPC_7400_V2_8 = 248
CPU_PPC_7400_V2_9 = 249
CPU_PPC_7410_V1_0 = 250
CPU_PPC_7410_V1_1 = 251
CPU_PPC_7410_V1_2 = 252
CPU_PPC_7410_V1_3 = 253
CPU_PPC_7410_V1_4 = 254
CPU_PPC_7448_V1_0 = 255
CPU_PPC_7448_V1_1 = 256
CPU_PPC_7448_V2_0 = 257
CPU_PPC_7448_V2_1 = 258
CPU_PPC_7450_V1_0 = 259
CPU_PPC_7450_V1_1 = 260
CPU_PPC_7450_V1_2 = 261
CPU_PPC_7450_V2_0 = 262
CPU_PPC_7450_V2_1 = 263
CPU_PPC_7441_V2_1 = 264
CPU_PPC_7441_V2_3 = 265
CPU_PPC_7451_V2_3 = 266
CPU_PPC_7441_V2_10 = 267
CPU_PPC_7451_V2_10 = 268
CPU_PPC_7445_V1_0 = 269
CPU_PPC_7455_V1_0 = 270
CPU_PPC_7445_V2_1 = 271
CPU_PPC_7455_V2_1 = 272
CPU_PPC_7445_V3_2 = 273
CPU_PPC_7455_V3_2 = 274
CPU_PPC_7445_V3_3 = 275
CPU_PPC_7455_V3_3 = 276
CPU_PPC_7445_V3_4 = 277
CPU_PPC_7455_V3_4 = 278
CPU_PPC_7447_V1_0 = 279
CPU_PPC_7457_V1_0 = 280
CPU_PPC_7447_V1_1 = 281
CPU_PPC_7457_V1_1 = 282
CPU_PPC_7457_V1_2 = 283
CPU_PPC_7447A_V1_0 = 284
CPU_PPC_7457A_V1_0 = 285
CPU_PPC_7447A_V1_1 = 286
CPU_PPC_7457A_V1_1 = 287
CPU_PPC_7447A_V1_2 = 288
CPU_PPC_7457A_V1_2 = 289
// PPC64 CPU
CPU_PPC_E5500 = 0
CPU_PPC_E6500 = 1
CPU_PPC_970_V2_2 = 2
CPU_PPC_970FX_V1_0 = 3
CPU_PPC_970FX_V2_0 = 4
CPU_PPC_970FX_V2_1 = 5
CPU_PPC_970FX_V3_0 = 6
CPU_PPC_970FX_V3_1 = 7
CPU_PPC_970MP_V1_0 = 8
CPU_PPC_970MP_V1_1 = 9
CPU_PPC_POWER5_V2_1 = 10
CPU_PPC_POWER7_V2_3 = 11
CPU_PPC_POWER7_V2_1 = 12
CPU_PPC_POWER8E_V2_1 = 13
CPU_PPC_POWER8_V2_0 = 14
CPU_PPC_POWER8NVL_V1_0 = 15
CPU_PPC_POWER9_V1_0 = 16
CPU_PPC_POWER9_V2_0 = 17
CPU_PPC_POWER10_V1_0 = 18
// PPC registers
PPC_REG_INVALID = 0
// General purpose registers
PPC_REG_PC = 1
PPC_REG_0 = 2
PPC_REG_1 = 3
PPC_REG_2 = 4
PPC_REG_3 = 5
PPC_REG_4 = 6
PPC_REG_5 = 7
PPC_REG_6 = 8
PPC_REG_7 = 9
PPC_REG_8 = 10
PPC_REG_9 = 11
PPC_REG_10 = 12
PPC_REG_11 = 13
PPC_REG_12 = 14
PPC_REG_13 = 15
PPC_REG_14 = 16
PPC_REG_15 = 17
PPC_REG_16 = 18
PPC_REG_17 = 19
PPC_REG_18 = 20
PPC_REG_19 = 21
PPC_REG_20 = 22
PPC_REG_21 = 23
PPC_REG_22 = 24
PPC_REG_23 = 25
PPC_REG_24 = 26
PPC_REG_25 = 27
PPC_REG_26 = 28
PPC_REG_27 = 29
PPC_REG_28 = 30
PPC_REG_29 = 31
PPC_REG_30 = 32
PPC_REG_31 = 33
PPC_REG_CR0 = 34
PPC_REG_CR1 = 35
PPC_REG_CR2 = 36
PPC_REG_CR3 = 37
PPC_REG_CR4 = 38
PPC_REG_CR5 = 39
PPC_REG_CR6 = 40
PPC_REG_CR7 = 41
PPC_REG_FPR0 = 42
PPC_REG_FPR1 = 43
PPC_REG_FPR2 = 44
PPC_REG_FPR3 = 45
PPC_REG_FPR4 = 46
PPC_REG_FPR5 = 47
PPC_REG_FPR6 = 48
PPC_REG_FPR7 = 49
PPC_REG_FPR8 = 50
PPC_REG_FPR9 = 51
PPC_REG_FPR10 = 52
PPC_REG_FPR11 = 53
PPC_REG_FPR12 = 54
PPC_REG_FPR13 = 55
PPC_REG_FPR14 = 56
PPC_REG_FPR15 = 57
PPC_REG_FPR16 = 58
PPC_REG_FPR17 = 59
PPC_REG_FPR18 = 60
PPC_REG_FPR19 = 61
PPC_REG_FPR20 = 62
PPC_REG_FPR21 = 63
PPC_REG_FPR22 = 64
PPC_REG_FPR23 = 65
PPC_REG_FPR24 = 66
PPC_REG_FPR25 = 67
PPC_REG_FPR26 = 68
PPC_REG_FPR27 = 69
PPC_REG_FPR28 = 70
PPC_REG_FPR29 = 71
PPC_REG_FPR30 = 72
PPC_REG_FPR31 = 73
PPC_REG_LR = 74
PPC_REG_XER = 75
PPC_REG_CTR = 76
PPC_REG_MSR = 77
PPC_REG_FPSCR = 78
)

View File

@ -0,0 +1,286 @@
package unicorn
// For Unicorn Engine. AUTO-GENERATED FILE, DO NOT EDIT [riscv_const.go]
const (
// RISCV32 CPU
CPU_RISCV32_ANY = 0
CPU_RISCV32_BASE32 = 1
CPU_RISCV32_SIFIVE_E31 = 2
CPU_RISCV32_SIFIVE_U34 = 3
// RISCV64 CPU
CPU_RISCV64_ANY = 0
CPU_RISCV64_BASE64 = 1
CPU_RISCV64_SIFIVE_E51 = 2
CPU_RISCV64_SIFIVE_U54 = 3
// RISCV registers
RISCV_REG_INVALID = 0
// General purpose registers
RISCV_REG_X0 = 1
RISCV_REG_X1 = 2
RISCV_REG_X2 = 3
RISCV_REG_X3 = 4
RISCV_REG_X4 = 5
RISCV_REG_X5 = 6
RISCV_REG_X6 = 7
RISCV_REG_X7 = 8
RISCV_REG_X8 = 9
RISCV_REG_X9 = 10
RISCV_REG_X10 = 11
RISCV_REG_X11 = 12
RISCV_REG_X12 = 13
RISCV_REG_X13 = 14
RISCV_REG_X14 = 15
RISCV_REG_X15 = 16
RISCV_REG_X16 = 17
RISCV_REG_X17 = 18
RISCV_REG_X18 = 19
RISCV_REG_X19 = 20
RISCV_REG_X20 = 21
RISCV_REG_X21 = 22
RISCV_REG_X22 = 23
RISCV_REG_X23 = 24
RISCV_REG_X24 = 25
RISCV_REG_X25 = 26
RISCV_REG_X26 = 27
RISCV_REG_X27 = 28
RISCV_REG_X28 = 29
RISCV_REG_X29 = 30
RISCV_REG_X30 = 31
RISCV_REG_X31 = 32
// RISCV CSR
RISCV_REG_USTATUS = 33
RISCV_REG_UIE = 34
RISCV_REG_UTVEC = 35
RISCV_REG_USCRATCH = 36
RISCV_REG_UEPC = 37
RISCV_REG_UCAUSE = 38
RISCV_REG_UTVAL = 39
RISCV_REG_UIP = 40
RISCV_REG_FFLAGS = 41
RISCV_REG_FRM = 42
RISCV_REG_FCSR = 43
RISCV_REG_CYCLE = 44
RISCV_REG_TIME = 45
RISCV_REG_INSTRET = 46
RISCV_REG_HPMCOUNTER3 = 47
RISCV_REG_HPMCOUNTER4 = 48
RISCV_REG_HPMCOUNTER5 = 49
RISCV_REG_HPMCOUNTER6 = 50
RISCV_REG_HPMCOUNTER7 = 51
RISCV_REG_HPMCOUNTER8 = 52
RISCV_REG_HPMCOUNTER9 = 53
RISCV_REG_HPMCOUNTER10 = 54
RISCV_REG_HPMCOUNTER11 = 55
RISCV_REG_HPMCOUNTER12 = 56
RISCV_REG_HPMCOUNTER13 = 57
RISCV_REG_HPMCOUNTER14 = 58
RISCV_REG_HPMCOUNTER15 = 59
RISCV_REG_HPMCOUNTER16 = 60
RISCV_REG_HPMCOUNTER17 = 61
RISCV_REG_HPMCOUNTER18 = 62
RISCV_REG_HPMCOUNTER19 = 63
RISCV_REG_HPMCOUNTER20 = 64
RISCV_REG_HPMCOUNTER21 = 65
RISCV_REG_HPMCOUNTER22 = 66
RISCV_REG_HPMCOUNTER23 = 67
RISCV_REG_HPMCOUNTER24 = 68
RISCV_REG_HPMCOUNTER25 = 69
RISCV_REG_HPMCOUNTER26 = 70
RISCV_REG_HPMCOUNTER27 = 71
RISCV_REG_HPMCOUNTER28 = 72
RISCV_REG_HPMCOUNTER29 = 73
RISCV_REG_HPMCOUNTER30 = 74
RISCV_REG_HPMCOUNTER31 = 75
RISCV_REG_CYCLEH = 76
RISCV_REG_TIMEH = 77
RISCV_REG_INSTRETH = 78
RISCV_REG_HPMCOUNTER3H = 79
RISCV_REG_HPMCOUNTER4H = 80
RISCV_REG_HPMCOUNTER5H = 81
RISCV_REG_HPMCOUNTER6H = 82
RISCV_REG_HPMCOUNTER7H = 83
RISCV_REG_HPMCOUNTER8H = 84
RISCV_REG_HPMCOUNTER9H = 85
RISCV_REG_HPMCOUNTER10H = 86
RISCV_REG_HPMCOUNTER11H = 87
RISCV_REG_HPMCOUNTER12H = 88
RISCV_REG_HPMCOUNTER13H = 89
RISCV_REG_HPMCOUNTER14H = 90
RISCV_REG_HPMCOUNTER15H = 91
RISCV_REG_HPMCOUNTER16H = 92
RISCV_REG_HPMCOUNTER17H = 93
RISCV_REG_HPMCOUNTER18H = 94
RISCV_REG_HPMCOUNTER19H = 95
RISCV_REG_HPMCOUNTER20H = 96
RISCV_REG_HPMCOUNTER21H = 97
RISCV_REG_HPMCOUNTER22H = 98
RISCV_REG_HPMCOUNTER23H = 99
RISCV_REG_HPMCOUNTER24H = 100
RISCV_REG_HPMCOUNTER25H = 101
RISCV_REG_HPMCOUNTER26H = 102
RISCV_REG_HPMCOUNTER27H = 103
RISCV_REG_HPMCOUNTER28H = 104
RISCV_REG_HPMCOUNTER29H = 105
RISCV_REG_HPMCOUNTER30H = 106
RISCV_REG_HPMCOUNTER31H = 107
RISCV_REG_MCYCLE = 108
RISCV_REG_MINSTRET = 109
RISCV_REG_MCYCLEH = 110
RISCV_REG_MINSTRETH = 111
RISCV_REG_MVENDORID = 112
RISCV_REG_MARCHID = 113
RISCV_REG_MIMPID = 114
RISCV_REG_MHARTID = 115
RISCV_REG_MSTATUS = 116
RISCV_REG_MISA = 117
RISCV_REG_MEDELEG = 118
RISCV_REG_MIDELEG = 119
RISCV_REG_MIE = 120
RISCV_REG_MTVEC = 121
RISCV_REG_MCOUNTEREN = 122
RISCV_REG_MSTATUSH = 123
RISCV_REG_MUCOUNTEREN = 124
RISCV_REG_MSCOUNTEREN = 125
RISCV_REG_MHCOUNTEREN = 126
RISCV_REG_MSCRATCH = 127
RISCV_REG_MEPC = 128
RISCV_REG_MCAUSE = 129
RISCV_REG_MTVAL = 130
RISCV_REG_MIP = 131
RISCV_REG_MBADADDR = 132
RISCV_REG_SSTATUS = 133
RISCV_REG_SEDELEG = 134
RISCV_REG_SIDELEG = 135
RISCV_REG_SIE = 136
RISCV_REG_STVEC = 137
RISCV_REG_SCOUNTEREN = 138
RISCV_REG_SSCRATCH = 139
RISCV_REG_SEPC = 140
RISCV_REG_SCAUSE = 141
RISCV_REG_STVAL = 142
RISCV_REG_SIP = 143
RISCV_REG_SBADADDR = 144
RISCV_REG_SPTBR = 145
RISCV_REG_SATP = 146
RISCV_REG_HSTATUS = 147
RISCV_REG_HEDELEG = 148
RISCV_REG_HIDELEG = 149
RISCV_REG_HIE = 150
RISCV_REG_HCOUNTEREN = 151
RISCV_REG_HTVAL = 152
RISCV_REG_HIP = 153
RISCV_REG_HTINST = 154
RISCV_REG_HGATP = 155
RISCV_REG_HTIMEDELTA = 156
RISCV_REG_HTIMEDELTAH = 157
// Floating-point registers
RISCV_REG_F0 = 158
RISCV_REG_F1 = 159
RISCV_REG_F2 = 160
RISCV_REG_F3 = 161
RISCV_REG_F4 = 162
RISCV_REG_F5 = 163
RISCV_REG_F6 = 164
RISCV_REG_F7 = 165
RISCV_REG_F8 = 166
RISCV_REG_F9 = 167
RISCV_REG_F10 = 168
RISCV_REG_F11 = 169
RISCV_REG_F12 = 170
RISCV_REG_F13 = 171
RISCV_REG_F14 = 172
RISCV_REG_F15 = 173
RISCV_REG_F16 = 174
RISCV_REG_F17 = 175
RISCV_REG_F18 = 176
RISCV_REG_F19 = 177
RISCV_REG_F20 = 178
RISCV_REG_F21 = 179
RISCV_REG_F22 = 180
RISCV_REG_F23 = 181
RISCV_REG_F24 = 182
RISCV_REG_F25 = 183
RISCV_REG_F26 = 184
RISCV_REG_F27 = 185
RISCV_REG_F28 = 186
RISCV_REG_F29 = 187
RISCV_REG_F30 = 188
RISCV_REG_F31 = 189
RISCV_REG_PC = 190
RISCV_REG_ENDING = 191
// Alias registers
RISCV_REG_ZERO = 1
RISCV_REG_RA = 2
RISCV_REG_SP = 3
RISCV_REG_GP = 4
RISCV_REG_TP = 5
RISCV_REG_T0 = 6
RISCV_REG_T1 = 7
RISCV_REG_T2 = 8
RISCV_REG_S0 = 9
RISCV_REG_FP = 9
RISCV_REG_S1 = 10
RISCV_REG_A0 = 11
RISCV_REG_A1 = 12
RISCV_REG_A2 = 13
RISCV_REG_A3 = 14
RISCV_REG_A4 = 15
RISCV_REG_A5 = 16
RISCV_REG_A6 = 17
RISCV_REG_A7 = 18
RISCV_REG_S2 = 19
RISCV_REG_S3 = 20
RISCV_REG_S4 = 21
RISCV_REG_S5 = 22
RISCV_REG_S6 = 23
RISCV_REG_S7 = 24
RISCV_REG_S8 = 25
RISCV_REG_S9 = 26
RISCV_REG_S10 = 27
RISCV_REG_S11 = 28
RISCV_REG_T3 = 29
RISCV_REG_T4 = 30
RISCV_REG_T5 = 31
RISCV_REG_T6 = 32
RISCV_REG_FT0 = 158
RISCV_REG_FT1 = 159
RISCV_REG_FT2 = 160
RISCV_REG_FT3 = 161
RISCV_REG_FT4 = 162
RISCV_REG_FT5 = 163
RISCV_REG_FT6 = 164
RISCV_REG_FT7 = 165
RISCV_REG_FS0 = 166
RISCV_REG_FS1 = 167
RISCV_REG_FA0 = 168
RISCV_REG_FA1 = 169
RISCV_REG_FA2 = 170
RISCV_REG_FA3 = 171
RISCV_REG_FA4 = 172
RISCV_REG_FA5 = 173
RISCV_REG_FA6 = 174
RISCV_REG_FA7 = 175
RISCV_REG_FS2 = 176
RISCV_REG_FS3 = 177
RISCV_REG_FS4 = 178
RISCV_REG_FS5 = 179
RISCV_REG_FS6 = 180
RISCV_REG_FS7 = 181
RISCV_REG_FS8 = 182
RISCV_REG_FS9 = 183
RISCV_REG_FS10 = 184
RISCV_REG_FS11 = 185
RISCV_REG_FT8 = 186
RISCV_REG_FT9 = 187
RISCV_REG_FT10 = 188
RISCV_REG_FT11 = 189
)

View File

@ -0,0 +1,124 @@
package unicorn
// For Unicorn Engine. AUTO-GENERATED FILE, DO NOT EDIT [s390x_const.go]
const (
// S390X CPU
CPU_S390X_Z900 = 0
CPU_S390X_Z900_2 = 1
CPU_S390X_Z900_3 = 2
CPU_S390X_Z800 = 3
CPU_S390X_Z990 = 4
CPU_S390X_Z990_2 = 5
CPU_S390X_Z990_3 = 6
CPU_S390X_Z890 = 7
CPU_S390X_Z990_4 = 8
CPU_S390X_Z890_2 = 9
CPU_S390X_Z990_5 = 10
CPU_S390X_Z890_3 = 11
CPU_S390X_Z9EC = 12
CPU_S390X_Z9EC_2 = 13
CPU_S390X_Z9BC = 14
CPU_S390X_Z9EC_3 = 15
CPU_S390X_Z9BC_2 = 16
CPU_S390X_Z10EC = 17
CPU_S390X_Z10EC_2 = 18
CPU_S390X_Z10BC = 19
CPU_S390X_Z10EC_3 = 20
CPU_S390X_Z10BC_2 = 21
CPU_S390X_Z196 = 22
CPU_S390X_Z196_2 = 23
CPU_S390X_Z114 = 24
CPU_S390X_ZEC12 = 25
CPU_S390X_ZEC12_2 = 26
CPU_S390X_ZBC12 = 27
CPU_S390X_Z13 = 28
CPU_S390X_Z13_2 = 29
CPU_S390X_Z13S = 30
CPU_S390X_Z14 = 31
CPU_S390X_Z14_2 = 32
CPU_S390X_Z14ZR1 = 33
CPU_S390X_GEN15A = 34
CPU_S390X_GEN15B = 35
CPU_S390X_QEMU = 36
CPU_S390X_MAX = 37
// S390X registers
S390X_REG_INVALID = 0
// General purpose registers
S390X_REG_R0 = 1
S390X_REG_R1 = 2
S390X_REG_R2 = 3
S390X_REG_R3 = 4
S390X_REG_R4 = 5
S390X_REG_R5 = 6
S390X_REG_R6 = 7
S390X_REG_R7 = 8
S390X_REG_R8 = 9
S390X_REG_R9 = 10
S390X_REG_R10 = 11
S390X_REG_R11 = 12
S390X_REG_R12 = 13
S390X_REG_R13 = 14
S390X_REG_R14 = 15
S390X_REG_R15 = 16
// Floating point registers
S390X_REG_F0 = 17
S390X_REG_F1 = 18
S390X_REG_F2 = 19
S390X_REG_F3 = 20
S390X_REG_F4 = 21
S390X_REG_F5 = 22
S390X_REG_F6 = 23
S390X_REG_F7 = 24
S390X_REG_F8 = 25
S390X_REG_F9 = 26
S390X_REG_F10 = 27
S390X_REG_F11 = 28
S390X_REG_F12 = 29
S390X_REG_F13 = 30
S390X_REG_F14 = 31
S390X_REG_F15 = 32
S390X_REG_F16 = 33
S390X_REG_F17 = 34
S390X_REG_F18 = 35
S390X_REG_F19 = 36
S390X_REG_F20 = 37
S390X_REG_F21 = 38
S390X_REG_F22 = 39
S390X_REG_F23 = 40
S390X_REG_F24 = 41
S390X_REG_F25 = 42
S390X_REG_F26 = 43
S390X_REG_F27 = 44
S390X_REG_F28 = 45
S390X_REG_F29 = 46
S390X_REG_F30 = 47
S390X_REG_F31 = 48
// Access registers
S390X_REG_A0 = 49
S390X_REG_A1 = 50
S390X_REG_A2 = 51
S390X_REG_A3 = 52
S390X_REG_A4 = 53
S390X_REG_A5 = 54
S390X_REG_A6 = 55
S390X_REG_A7 = 56
S390X_REG_A8 = 57
S390X_REG_A9 = 58
S390X_REG_A10 = 59
S390X_REG_A11 = 60
S390X_REG_A12 = 61
S390X_REG_A13 = 62
S390X_REG_A14 = 63
S390X_REG_A15 = 64
S390X_REG_PC = 65
S390X_REG_PSWM = 66
S390X_REG_ENDING = 67
// Alias registers
)

View File

@ -2,6 +2,42 @@ package unicorn
// For Unicorn Engine. AUTO-GENERATED FILE, DO NOT EDIT [sparc_const.go]
const (
// SPARC32 CPU
CPU_SPARC32_FUJITSU_MB86904 = 0
CPU_SPARC32_FUJITSU_MB86907 = 1
CPU_SPARC32_TI_MICROSPARC_I = 2
CPU_SPARC32_TI_MICROSPARC_II = 3
CPU_SPARC32_TI_MICROSPARC_IIEP = 4
CPU_SPARC32_TI_SUPERSPARC_40 = 5
CPU_SPARC32_TI_SUPERSPARC_50 = 6
CPU_SPARC32_TI_SUPERSPARC_51 = 7
CPU_SPARC32_TI_SUPERSPARC_60 = 8
CPU_SPARC32_TI_SUPERSPARC_61 = 9
CPU_SPARC32_TI_SUPERSPARC_II = 10
CPU_SPARC32_LEON2 = 11
CPU_SPARC32_LEON3 = 12
// SPARC64 CPU
CPU_SPARC64_FUJITSU = 0
CPU_SPARC64_FUJITSU_III = 1
CPU_SPARC64_FUJITSU_IV = 2
CPU_SPARC64_FUJITSU_V = 3
CPU_SPARC64_TI_ULTRASPARC_I = 4
CPU_SPARC64_TI_ULTRASPARC_II = 5
CPU_SPARC64_TI_ULTRASPARC_III = 6
CPU_SPARC64_TI_ULTRASPARC_IIE = 7
CPU_SPARC64_SUN_ULTRASPARC_III = 8
CPU_SPARC64_SUN_ULTRASPARC_III_CU = 9
CPU_SPARC64_SUN_ULTRASPARC_IIII = 10
CPU_SPARC64_SUN_ULTRASPARC_IV = 11
CPU_SPARC64_SUN_ULTRASPARC_IV_PLUS = 12
CPU_SPARC64_SUN_ULTRASPARC_IIII_PLUS = 13
CPU_SPARC64_SUN_ULTRASPARC_T1 = 14
CPU_SPARC64_SUN_ULTRASPARC_T2 = 15
CPU_SPARC64_NEC_ULTRASPARC_I = 16
// SPARC registers
SPARC_REG_INVALID = 0

View File

@ -23,3 +23,7 @@ uc_err uc_reg_write_batch_helper(uc_engine *handle, int *regs, uint64_t *val_in,
free(val_ref);
return ret;
}
uc_err uc_ctl_set_cpu_model_helper(uc_engine *handle, int model) {
return uc_ctl_set_cpu_model(handle, model);
}

View File

@ -1,2 +1,3 @@
uc_err uc_reg_read_batch_helper(uc_engine *handle, int *regs, uint64_t *val_out, int count);
uc_err uc_reg_write_batch_helper(uc_engine *handle, int *regs, uint64_t *val_in, int count);
uc_err uc_ctl_set_cpu_model_helper(uc_engine *handle, int model);

View File

@ -8,8 +8,8 @@ import (
/*
#cgo CFLAGS: -O3 -Wall -Werror -I../../../include
#cgo LDFLAGS: -L../../../ -lunicorn
#cgo linux LDFLAGS: -L../../../ -lunicorn -lrt
#cgo LDFLAGS: -L../../../ -lunicorn -Wl,-rpath,${SRCDIR}/../../../
#cgo linux LDFLAGS: -L../../../ -lunicorn -lrt -Wl,-rpath,${SRCDIR}/../../../
#include <unicorn/unicorn.h>
#include "uc.h"
*/
@ -62,6 +62,7 @@ type Unicorn interface {
Handle() *C.uc_engine
RegWriteX86Msr(reg uint64, val uint64) error
RegReadX86Msr(reg uint64) (uint64, error)
SetCPUModel(model int) error
}
type uc struct {
@ -233,3 +234,8 @@ func (u *uc) Query(queryType int) (uint64, error) {
func (u *uc) Handle() *C.uc_engine {
return u.handle
}
func (u *uc) SetCPUModel(model int) error {
ucerr := C.uc_ctl_set_cpu_model_helper(u.handle, C.int(model))
return errReturn(ucerr)
}

View File

@ -1,13 +1,18 @@
package unicorn
// For Unicorn Engine. AUTO-GENERATED FILE, DO NOT EDIT [unicorn_const.go]
const (
API_MAJOR = 1
API_MAJOR = 2
API_MINOR = 0
VERSION_MAJOR = 1
API_PATCH = 0
API_EXTRA = 5
VERSION_MAJOR = 2
VERSION_MINOR = 0
VERSION_EXTRA = 3
VERSION_PATCH = 0
VERSION_EXTRA = 5
SECOND_SCALE = 1000000
MILISECOND_SCALE = 1000
ARCH_ARM = 1
@ -17,7 +22,9 @@ const (
ARCH_PPC = 5
ARCH_SPARC = 6
ARCH_M68K = 7
ARCH_MAX = 8
ARCH_RISCV = 8
ARCH_S390X = 9
ARCH_MAX = 10
MODE_LITTLE_ENDIAN = 0
MODE_BIG_ENDIAN = 1073741824
@ -29,7 +36,6 @@ const (
MODE_ARM926 = 128
MODE_ARM946 = 256
MODE_ARM1176 = 512
MODE_ARMBE8 = 1024
MODE_MICRO = 16
MODE_MIPS3 = 32
MODE_MIPS32R6 = 64
@ -44,6 +50,8 @@ const (
MODE_SPARC32 = 4
MODE_SPARC64 = 8
MODE_V9 = 16
MODE_RISCV32 = 4
MODE_RISCV64 = 8
ERR_OK = 0
ERR_NOMEM = 1
@ -77,6 +85,10 @@ const (
MEM_READ_PROT = 23
MEM_FETCH_PROT = 24
MEM_READ_AFTER = 25
TCG_OP_SUB = 0
TCG_OP_FLAG_CMP = 1
TCG_OP_FLAG_DIRECT = 2
HOOK_INTR = 1
HOOK_INSN = 2
HOOK_CODE = 4
@ -92,6 +104,8 @@ const (
HOOK_MEM_FETCH = 4096
HOOK_MEM_READ_AFTER = 8192
HOOK_INSN_INVALID = 16384
HOOK_EDGE_GENERATED = 32768
HOOK_TCG_OPCODE = 65536
HOOK_MEM_UNMAPPED = 112
HOOK_MEM_PROT = 896
HOOK_MEM_READ_INVALID = 144
@ -104,6 +118,22 @@ const (
QUERY_ARCH = 3
QUERY_TIMEOUT = 4
CTL_IO_NONE = 0
CTL_IO_WRITE = 1
CTL_IO_READ = 2
CTL_IO_READ_WRITE = 3
CTL_UC_MODE = 0
CTL_UC_PAGE_SIZE = 1
CTL_UC_ARCH = 2
CTL_UC_TIMEOUT = 3
CTL_UC_USE_EXITS = 4
CTL_UC_EXITS_CNT = 5
CTL_UC_EXITS = 6
CTL_CPU_MODEL = 7
CTL_TB_REQUEST_CACHE = 8
CTL_TB_REMOVE_CACHE = 9
PROT_NONE = 0
PROT_READ = 1
PROT_WRITE = 2

View File

@ -2,6 +2,47 @@ package unicorn
// For Unicorn Engine. AUTO-GENERATED FILE, DO NOT EDIT [x86_const.go]
const (
// X86 CPU
CPU_X86_QEMU64 = 0
CPU_X86_PHENOM = 1
CPU_X86_CORE2DUO = 2
CPU_X86_KVM64 = 3
CPU_X86_QEMU32 = 4
CPU_X86_KVM32 = 5
CPU_X86_COREDUO = 6
CPU_X86_486 = 7
CPU_X86_PENTIUM = 8
CPU_X86_PENTIUM2 = 9
CPU_X86_PENTIUM3 = 10
CPU_X86_ATHLON = 11
CPU_X86_N270 = 12
CPU_X86_CONROE = 13
CPU_X86_PENRYN = 14
CPU_X86_NEHALEM = 15
CPU_X86_WESTMERE = 16
CPU_X86_SANDYBRIDGE = 17
CPU_X86_IVYBRIDGE = 18
CPU_X86_HASWELL = 19
CPU_X86_BROADWELL = 20
CPU_X86_SKYLAKE_CLIENT = 21
CPU_X86_SKYLAKE_SERVER = 22
CPU_X86_CASCADELAKE_SERVER = 23
CPU_X86_COOPERLAKE = 24
CPU_X86_ICELAKE_CLIENT = 25
CPU_X86_ICELAKE_SERVER = 26
CPU_X86_DENVERTON = 27
CPU_X86_SNOWRIDGE = 28
CPU_X86_KNIGHTSMILL = 29
CPU_X86_OPTERON_G1 = 30
CPU_X86_OPTERON_G2 = 31
CPU_X86_OPTERON_G3 = 32
CPU_X86_OPTERON_G4 = 33
CPU_X86_OPTERON_G5 = 34
CPU_X86_EPYC = 35
CPU_X86_DHYANA = 36
CPU_X86_EPYC_ROME = 37
// X86 registers
X86_REG_INVALID = 0
@ -31,232 +72,219 @@ const (
X86_REG_EDX = 24
X86_REG_EFLAGS = 25
X86_REG_EIP = 26
X86_REG_EIZ = 27
X86_REG_ES = 28
X86_REG_ESI = 29
X86_REG_ESP = 30
X86_REG_FPSW = 31
X86_REG_FS = 32
X86_REG_GS = 33
X86_REG_IP = 34
X86_REG_RAX = 35
X86_REG_RBP = 36
X86_REG_RBX = 37
X86_REG_RCX = 38
X86_REG_RDI = 39
X86_REG_RDX = 40
X86_REG_RIP = 41
X86_REG_RIZ = 42
X86_REG_RSI = 43
X86_REG_RSP = 44
X86_REG_SI = 45
X86_REG_SIL = 46
X86_REG_SP = 47
X86_REG_SPL = 48
X86_REG_SS = 49
X86_REG_CR0 = 50
X86_REG_CR1 = 51
X86_REG_CR2 = 52
X86_REG_CR3 = 53
X86_REG_CR4 = 54
X86_REG_CR5 = 55
X86_REG_CR6 = 56
X86_REG_CR7 = 57
X86_REG_CR8 = 58
X86_REG_CR9 = 59
X86_REG_CR10 = 60
X86_REG_CR11 = 61
X86_REG_CR12 = 62
X86_REG_CR13 = 63
X86_REG_CR14 = 64
X86_REG_CR15 = 65
X86_REG_DR0 = 66
X86_REG_DR1 = 67
X86_REG_DR2 = 68
X86_REG_DR3 = 69
X86_REG_DR4 = 70
X86_REG_DR5 = 71
X86_REG_DR6 = 72
X86_REG_DR7 = 73
X86_REG_DR8 = 74
X86_REG_DR9 = 75
X86_REG_DR10 = 76
X86_REG_DR11 = 77
X86_REG_DR12 = 78
X86_REG_DR13 = 79
X86_REG_DR14 = 80
X86_REG_DR15 = 81
X86_REG_FP0 = 82
X86_REG_FP1 = 83
X86_REG_FP2 = 84
X86_REG_FP3 = 85
X86_REG_FP4 = 86
X86_REG_FP5 = 87
X86_REG_FP6 = 88
X86_REG_FP7 = 89
X86_REG_K0 = 90
X86_REG_K1 = 91
X86_REG_K2 = 92
X86_REG_K3 = 93
X86_REG_K4 = 94
X86_REG_K5 = 95
X86_REG_K6 = 96
X86_REG_K7 = 97
X86_REG_MM0 = 98
X86_REG_MM1 = 99
X86_REG_MM2 = 100
X86_REG_MM3 = 101
X86_REG_MM4 = 102
X86_REG_MM5 = 103
X86_REG_MM6 = 104
X86_REG_MM7 = 105
X86_REG_R8 = 106
X86_REG_R9 = 107
X86_REG_R10 = 108
X86_REG_R11 = 109
X86_REG_R12 = 110
X86_REG_R13 = 111
X86_REG_R14 = 112
X86_REG_R15 = 113
X86_REG_ST0 = 114
X86_REG_ST1 = 115
X86_REG_ST2 = 116
X86_REG_ST3 = 117
X86_REG_ST4 = 118
X86_REG_ST5 = 119
X86_REG_ST6 = 120
X86_REG_ST7 = 121
X86_REG_XMM0 = 122
X86_REG_XMM1 = 123
X86_REG_XMM2 = 124
X86_REG_XMM3 = 125
X86_REG_XMM4 = 126
X86_REG_XMM5 = 127
X86_REG_XMM6 = 128
X86_REG_XMM7 = 129
X86_REG_XMM8 = 130
X86_REG_XMM9 = 131
X86_REG_XMM10 = 132
X86_REG_XMM11 = 133
X86_REG_XMM12 = 134
X86_REG_XMM13 = 135
X86_REG_XMM14 = 136
X86_REG_XMM15 = 137
X86_REG_XMM16 = 138
X86_REG_XMM17 = 139
X86_REG_XMM18 = 140
X86_REG_XMM19 = 141
X86_REG_XMM20 = 142
X86_REG_XMM21 = 143
X86_REG_XMM22 = 144
X86_REG_XMM23 = 145
X86_REG_XMM24 = 146
X86_REG_XMM25 = 147
X86_REG_XMM26 = 148
X86_REG_XMM27 = 149
X86_REG_XMM28 = 150
X86_REG_XMM29 = 151
X86_REG_XMM30 = 152
X86_REG_XMM31 = 153
X86_REG_YMM0 = 154
X86_REG_YMM1 = 155
X86_REG_YMM2 = 156
X86_REG_YMM3 = 157
X86_REG_YMM4 = 158
X86_REG_YMM5 = 159
X86_REG_YMM6 = 160
X86_REG_YMM7 = 161
X86_REG_YMM8 = 162
X86_REG_YMM9 = 163
X86_REG_YMM10 = 164
X86_REG_YMM11 = 165
X86_REG_YMM12 = 166
X86_REG_YMM13 = 167
X86_REG_YMM14 = 168
X86_REG_YMM15 = 169
X86_REG_YMM16 = 170
X86_REG_YMM17 = 171
X86_REG_YMM18 = 172
X86_REG_YMM19 = 173
X86_REG_YMM20 = 174
X86_REG_YMM21 = 175
X86_REG_YMM22 = 176
X86_REG_YMM23 = 177
X86_REG_YMM24 = 178
X86_REG_YMM25 = 179
X86_REG_YMM26 = 180
X86_REG_YMM27 = 181
X86_REG_YMM28 = 182
X86_REG_YMM29 = 183
X86_REG_YMM30 = 184
X86_REG_YMM31 = 185
X86_REG_ZMM0 = 186
X86_REG_ZMM1 = 187
X86_REG_ZMM2 = 188
X86_REG_ZMM3 = 189
X86_REG_ZMM4 = 190
X86_REG_ZMM5 = 191
X86_REG_ZMM6 = 192
X86_REG_ZMM7 = 193
X86_REG_ZMM8 = 194
X86_REG_ZMM9 = 195
X86_REG_ZMM10 = 196
X86_REG_ZMM11 = 197
X86_REG_ZMM12 = 198
X86_REG_ZMM13 = 199
X86_REG_ZMM14 = 200
X86_REG_ZMM15 = 201
X86_REG_ZMM16 = 202
X86_REG_ZMM17 = 203
X86_REG_ZMM18 = 204
X86_REG_ZMM19 = 205
X86_REG_ZMM20 = 206
X86_REG_ZMM21 = 207
X86_REG_ZMM22 = 208
X86_REG_ZMM23 = 209
X86_REG_ZMM24 = 210
X86_REG_ZMM25 = 211
X86_REG_ZMM26 = 212
X86_REG_ZMM27 = 213
X86_REG_ZMM28 = 214
X86_REG_ZMM29 = 215
X86_REG_ZMM30 = 216
X86_REG_ZMM31 = 217
X86_REG_R8B = 218
X86_REG_R9B = 219
X86_REG_R10B = 220
X86_REG_R11B = 221
X86_REG_R12B = 222
X86_REG_R13B = 223
X86_REG_R14B = 224
X86_REG_R15B = 225
X86_REG_R8D = 226
X86_REG_R9D = 227
X86_REG_R10D = 228
X86_REG_R11D = 229
X86_REG_R12D = 230
X86_REG_R13D = 231
X86_REG_R14D = 232
X86_REG_R15D = 233
X86_REG_R8W = 234
X86_REG_R9W = 235
X86_REG_R10W = 236
X86_REG_R11W = 237
X86_REG_R12W = 238
X86_REG_R13W = 239
X86_REG_R14W = 240
X86_REG_R15W = 241
X86_REG_IDTR = 242
X86_REG_GDTR = 243
X86_REG_LDTR = 244
X86_REG_TR = 245
X86_REG_FPCW = 246
X86_REG_FPTAG = 247
X86_REG_MSR = 248
X86_REG_MXCSR = 249
X86_REG_FS_BASE = 250
X86_REG_GS_BASE = 251
X86_REG_ENDING = 252
X86_REG_ES = 27
X86_REG_ESI = 28
X86_REG_ESP = 29
X86_REG_FPSW = 30
X86_REG_FS = 31
X86_REG_GS = 32
X86_REG_IP = 33
X86_REG_RAX = 34
X86_REG_RBP = 35
X86_REG_RBX = 36
X86_REG_RCX = 37
X86_REG_RDI = 38
X86_REG_RDX = 39
X86_REG_RIP = 40
X86_REG_RSI = 41
X86_REG_RSP = 42
X86_REG_SI = 43
X86_REG_SIL = 44
X86_REG_SP = 45
X86_REG_SPL = 46
X86_REG_SS = 47
X86_REG_CR0 = 48
X86_REG_CR1 = 49
X86_REG_CR2 = 50
X86_REG_CR3 = 51
X86_REG_CR4 = 52
X86_REG_CR8 = 53
X86_REG_DR0 = 54
X86_REG_DR1 = 55
X86_REG_DR2 = 56
X86_REG_DR3 = 57
X86_REG_DR4 = 58
X86_REG_DR5 = 59
X86_REG_DR6 = 60
X86_REG_DR7 = 61
X86_REG_FP0 = 62
X86_REG_FP1 = 63
X86_REG_FP2 = 64
X86_REG_FP3 = 65
X86_REG_FP4 = 66
X86_REG_FP5 = 67
X86_REG_FP6 = 68
X86_REG_FP7 = 69
X86_REG_K0 = 70
X86_REG_K1 = 71
X86_REG_K2 = 72
X86_REG_K3 = 73
X86_REG_K4 = 74
X86_REG_K5 = 75
X86_REG_K6 = 76
X86_REG_K7 = 77
X86_REG_MM0 = 78
X86_REG_MM1 = 79
X86_REG_MM2 = 80
X86_REG_MM3 = 81
X86_REG_MM4 = 82
X86_REG_MM5 = 83
X86_REG_MM6 = 84
X86_REG_MM7 = 85
X86_REG_R8 = 86
X86_REG_R9 = 87
X86_REG_R10 = 88
X86_REG_R11 = 89
X86_REG_R12 = 90
X86_REG_R13 = 91
X86_REG_R14 = 92
X86_REG_R15 = 93
X86_REG_ST0 = 94
X86_REG_ST1 = 95
X86_REG_ST2 = 96
X86_REG_ST3 = 97
X86_REG_ST4 = 98
X86_REG_ST5 = 99
X86_REG_ST6 = 100
X86_REG_ST7 = 101
X86_REG_XMM0 = 102
X86_REG_XMM1 = 103
X86_REG_XMM2 = 104
X86_REG_XMM3 = 105
X86_REG_XMM4 = 106
X86_REG_XMM5 = 107
X86_REG_XMM6 = 108
X86_REG_XMM7 = 109
X86_REG_XMM8 = 110
X86_REG_XMM9 = 111
X86_REG_XMM10 = 112
X86_REG_XMM11 = 113
X86_REG_XMM12 = 114
X86_REG_XMM13 = 115
X86_REG_XMM14 = 116
X86_REG_XMM15 = 117
X86_REG_XMM16 = 118
X86_REG_XMM17 = 119
X86_REG_XMM18 = 120
X86_REG_XMM19 = 121
X86_REG_XMM20 = 122
X86_REG_XMM21 = 123
X86_REG_XMM22 = 124
X86_REG_XMM23 = 125
X86_REG_XMM24 = 126
X86_REG_XMM25 = 127
X86_REG_XMM26 = 128
X86_REG_XMM27 = 129
X86_REG_XMM28 = 130
X86_REG_XMM29 = 131
X86_REG_XMM30 = 132
X86_REG_XMM31 = 133
X86_REG_YMM0 = 134
X86_REG_YMM1 = 135
X86_REG_YMM2 = 136
X86_REG_YMM3 = 137
X86_REG_YMM4 = 138
X86_REG_YMM5 = 139
X86_REG_YMM6 = 140
X86_REG_YMM7 = 141
X86_REG_YMM8 = 142
X86_REG_YMM9 = 143
X86_REG_YMM10 = 144
X86_REG_YMM11 = 145
X86_REG_YMM12 = 146
X86_REG_YMM13 = 147
X86_REG_YMM14 = 148
X86_REG_YMM15 = 149
X86_REG_YMM16 = 150
X86_REG_YMM17 = 151
X86_REG_YMM18 = 152
X86_REG_YMM19 = 153
X86_REG_YMM20 = 154
X86_REG_YMM21 = 155
X86_REG_YMM22 = 156
X86_REG_YMM23 = 157
X86_REG_YMM24 = 158
X86_REG_YMM25 = 159
X86_REG_YMM26 = 160
X86_REG_YMM27 = 161
X86_REG_YMM28 = 162
X86_REG_YMM29 = 163
X86_REG_YMM30 = 164
X86_REG_YMM31 = 165
X86_REG_ZMM0 = 166
X86_REG_ZMM1 = 167
X86_REG_ZMM2 = 168
X86_REG_ZMM3 = 169
X86_REG_ZMM4 = 170
X86_REG_ZMM5 = 171
X86_REG_ZMM6 = 172
X86_REG_ZMM7 = 173
X86_REG_ZMM8 = 174
X86_REG_ZMM9 = 175
X86_REG_ZMM10 = 176
X86_REG_ZMM11 = 177
X86_REG_ZMM12 = 178
X86_REG_ZMM13 = 179
X86_REG_ZMM14 = 180
X86_REG_ZMM15 = 181
X86_REG_ZMM16 = 182
X86_REG_ZMM17 = 183
X86_REG_ZMM18 = 184
X86_REG_ZMM19 = 185
X86_REG_ZMM20 = 186
X86_REG_ZMM21 = 187
X86_REG_ZMM22 = 188
X86_REG_ZMM23 = 189
X86_REG_ZMM24 = 190
X86_REG_ZMM25 = 191
X86_REG_ZMM26 = 192
X86_REG_ZMM27 = 193
X86_REG_ZMM28 = 194
X86_REG_ZMM29 = 195
X86_REG_ZMM30 = 196
X86_REG_ZMM31 = 197
X86_REG_R8B = 198
X86_REG_R9B = 199
X86_REG_R10B = 200
X86_REG_R11B = 201
X86_REG_R12B = 202
X86_REG_R13B = 203
X86_REG_R14B = 204
X86_REG_R15B = 205
X86_REG_R8D = 206
X86_REG_R9D = 207
X86_REG_R10D = 208
X86_REG_R11D = 209
X86_REG_R12D = 210
X86_REG_R13D = 211
X86_REG_R14D = 212
X86_REG_R15D = 213
X86_REG_R8W = 214
X86_REG_R9W = 215
X86_REG_R10W = 216
X86_REG_R11W = 217
X86_REG_R12W = 218
X86_REG_R13W = 219
X86_REG_R14W = 220
X86_REG_R15W = 221
X86_REG_IDTR = 222
X86_REG_GDTR = 223
X86_REG_LDTR = 224
X86_REG_TR = 225
X86_REG_FPCW = 226
X86_REG_FPTAG = 227
X86_REG_MSR = 228
X86_REG_MXCSR = 229
X86_REG_FS_BASE = 230
X86_REG_GS_BASE = 231
X86_REG_FLAGS = 232
X86_REG_RFLAGS = 233
X86_REG_FIP = 234
X86_REG_FCS = 235
X86_REG_FDP = 236
X86_REG_FDS = 237
X86_REG_FOP = 238
X86_REG_ENDING = 239
// X86 instructions

View File

@ -19,7 +19,7 @@ uninstall:
$(MAKE) -f Makefile.build uninstall
gen_const:
cd .. && python const_generator.py java
cd .. && python3 const_generator.py java
clean:
rm -f unicorn/*.class

View File

@ -1,7 +1,9 @@
.PHONY: gen_const clean
JAVA_HOME := $(shell jrunscript -e 'java.lang.System.out.println(java.lang.System.getProperty("java.home"));')
JC=javac
JAVA_HOME := $(shell readlink -f `which $(JC)` | sed "s:/bin/$(JC)::")
JAVA_INC := $(shell realpath $(JAVA_HOME)/include)
@ -28,25 +30,24 @@ LIBS=-lunicorn
LIBDIR=-L../../
INCS=-I$(JAVA_INC) -I$(JAVA_PLATFORM_INC) -I$(UNICORN_INC)
JC=javac
CLASSPATH=./
.SUFFIXES: .java .class
%.class: %.java
$(JC) $(JFLAGS) $<
$(JC) -classpath .:unicorn.jar $(JFLAGS) $<
OBJS=unicorn_Unicorn.o
JARFILE=unicorn.jar
all: lib jar samples
all: jar lib samples
%.o: %.c
$(CC) -c $(CFLAGS) $(INCS) $< -o $@
unicorn_Unicorn.h: unicorn/Unicorn.java
javac -h unicorn/ unicorn/*.java
javac -h . $<
unicorn_Unicorn.o: unicorn_Unicorn.c unicorn_Unicorn.h
$(CC) -c $(CFLAGS) $(INCS) $< -o $@
@ -63,12 +64,12 @@ jar: jarfiles
jar cf $(JARFILE) unicorn/*.class
install: lib jar
cp libunicorn_java$(LIB_EXT) $(JAVA_HOME)/lib/ext
cp $(JARFILE) $(JAVA_HOME)/lib/ext
cp libunicorn_java$(LIB_EXT) /usr/lib
cp $(JARFILE) /usr/share/java
uninstall:
rm $(JAVA_HOME)/lib/ext/libunicorn_java$(LIB_EXT)
rm $(JAVA_HOME)/lib/ext/$(JARFILE)
rm /usr/lib/libunicorn_java$(LIB_EXT)
rm /usr/share/java/$(JARFILE)
gen_const:
cd .. && python const_generator.py java

View File

@ -30,12 +30,12 @@ import java.util.*;
public class SampleNetworkAuditing {
public static int next_id = 3;
public static long next_id = 3;
public static final int SIZE_REG = 4;
private static LogChain fd_chains = new LogChain();
public static int get_id() {
public static long get_id() {
return next_id++;
}
@ -112,7 +112,7 @@ public class SampleNetworkAuditing {
long mode = edx;
String filename = read_string(uc, filename_addr);
Long dummy_fd = new Long(get_id());
Long dummy_fd = get_id();
uc.reg_write(Unicorn.UC_X86_REG_EAX, dummy_fd);
String msg = String.format("open file (filename=%s flags=%d mode=%d) with fd(%d)", filename, flags, mode, dummy_fd);
@ -144,8 +144,8 @@ public class SampleNetworkAuditing {
long sock_type = toInt(uc.mem_read(args + SIZE_REG, SIZE_REG));
long protocol = toInt(uc.mem_read(args + SIZE_REG * 2, SIZE_REG));
Long dummy_fd = new Long(get_id());
uc.reg_write(Unicorn.UC_X86_REG_EAX, dummy_fd.intValue());
Long dummy_fd = get_id();
uc.reg_write(Unicorn.UC_X86_REG_EAX, dummy_fd);
if (family == 2) { // AF_INET
String msg = String.format("create socket (%s, %s) with fd(%d)", ADDR_FAMILY.get(family), SOCKET_TYPES.get(sock_type), dummy_fd);
@ -401,7 +401,7 @@ public class SampleNetworkAuditing {
mu.mem_write(ADDRESS, code);
// initialize stack
mu.reg_write(Unicorn.UC_X86_REG_ESP, new Long(ADDRESS + 0x200000));
mu.reg_write(Unicorn.UC_X86_REG_ESP, ADDRESS + 0x200000L);
// handle interrupt ourself
mu.hook_add(new MyInterruptHook(), null);

View File

@ -40,9 +40,9 @@ public class Sample_arm {
static void test_arm()
{
Long r0 = new Long(0x1234); // R0 register
Long r2 = new Long(0x6789); // R1 register
Long r3 = new Long(0x3333); // R2 register
Long r0 = 0x1234L; // R0 register
Long r2 = 0x6789L; // R1 register
Long r3 = 0x3333L; // R2 register
Long r1; // R1 register
System.out.print("Emulate ARM code\n");
@ -85,7 +85,7 @@ public class Sample_arm {
static void test_thumb()
{
Long sp = new Long(0x1234); // R0 register
Long sp = 0x1234L; // R0 register
System.out.print("Emulate THUMB code\n");

View File

@ -69,9 +69,9 @@ public class Sample_arm64 {
static void test_arm64()
{
Long x11 = new Long(0x1234); // X11 register
Long x13 = new Long(0x6789); // X13 register
Long x15 = new Long(0x3333); // X15 register
Long x11 = 0x1234L; // X11 register
Long x13 = 0x6789L; // X13 register
Long x15 = 0x3333L; // X15 register
System.out.print("Emulate ARM64 code\n");

View File

@ -68,26 +68,26 @@ public class Sample_m68k {
static void test_m68k()
{
Long d0 = new Long(0x0000); // d0 data register
Long d1 = new Long(0x0000); // d1 data register
Long d2 = new Long(0x0000); // d2 data register
Long d3 = new Long(0x0000); // d3 data register
Long d4 = new Long(0x0000); // d4 data register
Long d5 = new Long(0x0000); // d5 data register
Long d6 = new Long(0x0000); // d6 data register
Long d7 = new Long(0x0000); // d7 data register
Long a0 = new Long(0x0000); // a0 address register
Long a1 = new Long(0x0000); // a1 address register
Long a2 = new Long(0x0000); // a2 address register
Long a3 = new Long(0x0000); // a3 address register
Long a4 = new Long(0x0000); // a4 address register
Long a5 = new Long(0x0000); // a5 address register
Long a6 = new Long(0x0000); // a6 address register
Long a7 = new Long(0x0000); // a6 address register
Long pc = new Long(0x0000); // program counter
Long sr = new Long(0x0000); // status register
Long d0 = 0x0000L; // d0 data register
Long d1 = 0x0000L; // d1 data register
Long d2 = 0x0000L; // d2 data register
Long d3 = 0x0000L; // d3 data register
Long d4 = 0x0000L; // d4 data register
Long d5 = 0x0000L; // d5 data register
Long d6 = 0x0000L; // d6 data register
Long d7 = 0x0000L; // d7 data register
Long a0 = 0x0000L; // a0 address register
Long a1 = 0x0000L; // a1 address register
Long a2 = 0x0000L; // a2 address register
Long a3 = 0x0000L; // a3 address register
Long a4 = 0x0000L; // a4 address register
Long a5 = 0x0000L; // a5 address register
Long a6 = 0x0000L; // a6 address register
Long a7 = 0x0000L; // a6 address register
Long pc = 0x0000L; // program counter
Long sr = 0x0000L; // status register
System.out.print("Emulate M68K code\n");

View File

@ -70,7 +70,7 @@ public class Sample_mips {
static void test_mips_eb()
{
Long r1 = new Long(0x6789); // R1 register
Long r1 = 0x6789L; // R1 register
System.out.print("Emulate MIPS code (big-endian)\n");
@ -107,7 +107,7 @@ public class Sample_mips {
static void test_mips_el()
{
Long r1 = new Long(0x6789); // R1 register
Long r1 = 0x6789L; // R1 register
System.out.print("===========================\n");
System.out.print("Emulate MIPS code (little-endian)\n");

View File

@ -69,9 +69,9 @@ public class Sample_sparc {
static void test_sparc()
{
Long g1 = new Long(0x1230); // G1 register
Long g2 = new Long(0x6789); // G2 register
Long g3 = new Long(0x5555); // G3 register
Long g1 = 0x1230L; // G1 register
Long g2 = 0x6789L; // G2 register
Long g3 = 0x5555L; // G3 register
System.out.print("Emulate SPARC code\n");

View File

@ -171,8 +171,8 @@ public class Sample_x86 {
}
static void test_i386() {
Long r_ecx = new Long(0x1234); // ECX register
Long r_edx = new Long(0x7890); // EDX register
Long r_ecx = 0x1234L; // ECX register
Long r_edx = 0x7890L; // EDX register
System.out.print("Emulate i386 code\n");
@ -234,8 +234,8 @@ public class Sample_x86 {
static void test_i386_inout()
{
Long r_eax = new Long(0x1234); // ECX register
Long r_ecx = new Long(0x6789); // EDX register
Long r_eax = 0x1234L; // ECX register
Long r_ecx = 0x6789L; // EDX register
System.out.print("===================================\n");
System.out.print("Emulate i386 code with IN/OUT instructions\n");
@ -309,8 +309,8 @@ public class Sample_x86 {
// emulate code that loop forever
static void test_i386_loop()
{
Long r_ecx = new Long(0x1234); // ECX register
Long r_edx = new Long(0x7890); // EDX register
Long r_ecx = 0x1234L; // ECX register
Long r_edx = 0x7890L; // EDX register
System.out.print("===================================\n");
System.out.print("Emulate i386 code that loop forever\n");
@ -346,8 +346,8 @@ public class Sample_x86 {
// emulate code that read invalid memory
static void test_i386_invalid_mem_read()
{
Long r_ecx = new Long(0x1234); // ECX register
Long r_edx = new Long(0x7890); // EDX register
Long r_ecx = 0x1234L; // ECX register
Long r_edx = 0x7890L; // EDX register
System.out.print("===================================\n");
System.out.print("Emulate i386 code that read from invalid memory\n");
@ -393,8 +393,8 @@ public class Sample_x86 {
// emulate code that read invalid memory
static void test_i386_invalid_mem_write()
{
Long r_ecx = new Long(0x1234); // ECX register
Long r_edx = new Long(0x7890); // EDX register
Long r_ecx = 0x1234L; // ECX register
Long r_edx = 0x7890L; // EDX register
System.out.print("===================================\n");
System.out.print("Emulate i386 code that write to invalid memory\n");
@ -453,8 +453,8 @@ public class Sample_x86 {
// emulate code that jump to invalid memory
static void test_i386_jump_invalid()
{
Long r_ecx = new Long(0x1234); // ECX register
Long r_edx = new Long(0x7890); // EDX register
Long r_ecx = 0x1234L; // ECX register
Long r_edx = 0x7890L; // EDX register
System.out.print("===================================\n");
System.out.print("Emulate i386 code that jumps to invalid memory\n");
@ -527,22 +527,22 @@ public class Sample_x86 {
u.mem_write(ADDRESS, X86_CODE64);
// initialize machine registers
u.reg_write(Unicorn.UC_X86_REG_RSP, new Long(rsp));
u.reg_write(Unicorn.UC_X86_REG_RAX, new Long(rax));
u.reg_write(Unicorn.UC_X86_REG_RBX, new Long(rbx));
u.reg_write(Unicorn.UC_X86_REG_RCX, new Long(rcx));
u.reg_write(Unicorn.UC_X86_REG_RDX, new Long(rdx));
u.reg_write(Unicorn.UC_X86_REG_RSI, new Long(rsi));
u.reg_write(Unicorn.UC_X86_REG_RDI, new Long(rdi));
u.reg_write(Unicorn.UC_X86_REG_R8, new Long(r8));
u.reg_write(Unicorn.UC_X86_REG_R9, new Long(r9));
u.reg_write(Unicorn.UC_X86_REG_R10, new Long(r10));
u.reg_write(Unicorn.UC_X86_REG_R11, new Long(r11));
u.reg_write(Unicorn.UC_X86_REG_R12, new Long(r12));
u.reg_write(Unicorn.UC_X86_REG_R13, new Long(r13));
u.reg_write(Unicorn.UC_X86_REG_R14, new Long(r14));
u.reg_write(Unicorn.UC_X86_REG_R15, new Long(r15));
u.reg_write(Unicorn.UC_X86_REG_RSP, rsp);
u.reg_write(Unicorn.UC_X86_REG_RAX, rax);
u.reg_write(Unicorn.UC_X86_REG_RBX, rbx);
u.reg_write(Unicorn.UC_X86_REG_RCX, rcx);
u.reg_write(Unicorn.UC_X86_REG_RDX, rdx);
u.reg_write(Unicorn.UC_X86_REG_RSI, rsi);
u.reg_write(Unicorn.UC_X86_REG_RDI, rdi);
u.reg_write(Unicorn.UC_X86_REG_R8, r8);
u.reg_write(Unicorn.UC_X86_REG_R9, r9);
u.reg_write(Unicorn.UC_X86_REG_R10, r10);
u.reg_write(Unicorn.UC_X86_REG_R11, r11);
u.reg_write(Unicorn.UC_X86_REG_R12, r12);
u.reg_write(Unicorn.UC_X86_REG_R13, r13);
u.reg_write(Unicorn.UC_X86_REG_R14, r14);
u.reg_write(Unicorn.UC_X86_REG_R15, r15);
// tracing all basic blocks with customized callback
u.hook_add(new MyBlockHook(), 1, 0, null);
@ -598,9 +598,9 @@ public class Sample_x86 {
static void test_x86_16()
{
Long eax = new Long(7);
Long ebx = new Long(5);
Long esi = new Long(6);
Long eax = 7L;
Long ebx = 5L;
Long esi = 6L;
System.out.print("Emulate x86 16-bit code\n");

View File

@ -49,7 +49,7 @@ public class Sample_x86_mmr {
uc.reg_write(Unicorn.UC_X86_REG_LDTR, ldtr1);
uc.reg_write(Unicorn.UC_X86_REG_GDTR, gdtr1);
uc.reg_write(Unicorn.UC_X86_REG_EAX, new Long(0xdddddddd));
uc.reg_write(Unicorn.UC_X86_REG_EAX, 0xddddddddL);
// read the registers back out
eax = (int)((Long)uc.reg_read(Unicorn.UC_X86_REG_EAX)).longValue();

View File

@ -113,7 +113,7 @@ public class Shellcode {
static void test_i386()
{
Long r_esp = new Long(ADDRESS + 0x200000); // ESP register
Long r_esp = ADDRESS + 0x200000L; // ESP register
System.out.print("Emulate i386 code\n");
@ -158,4 +158,4 @@ public class Shellcode {
}
}
}

View File

@ -4,6 +4,13 @@ package unicorn;
public interface Arm64Const {
// ARM64 CPU
public static final int UC_CPU_AARCH64_A57 = 0;
public static final int UC_CPU_AARCH64_A53 = 1;
public static final int UC_CPU_AARCH64_A72 = 2;
public static final int UC_CPU_AARCH64_MAX = 3;
// ARM64 registers
public static final int UC_ARM64_REG_INVALID = 0;

View File

@ -4,6 +4,43 @@ package unicorn;
public interface ArmConst {
// ARM CPU
public static final int UC_CPU_ARM_926 = 0;
public static final int UC_CPU_ARM_946 = 1;
public static final int UC_CPU_ARM_1026 = 2;
public static final int UC_CPU_ARM_1136_R2 = 3;
public static final int UC_CPU_ARM_1136 = 4;
public static final int UC_CPU_ARM_1176 = 5;
public static final int UC_CPU_ARM_11MPCORE = 6;
public static final int UC_CPU_ARM_CORTEX_M0 = 7;
public static final int UC_CPU_ARM_CORTEX_M3 = 8;
public static final int UC_CPU_ARM_CORTEX_M4 = 9;
public static final int UC_CPU_ARM_CORTEX_M7 = 10;
public static final int UC_CPU_ARM_CORTEX_M33 = 11;
public static final int UC_CPU_ARM_CORTEX_R5 = 12;
public static final int UC_CPU_ARM_CORTEX_R5F = 13;
public static final int UC_CPU_ARM_CORTEX_A7 = 14;
public static final int UC_CPU_ARM_CORTEX_A8 = 15;
public static final int UC_CPU_ARM_CORTEX_A9 = 16;
public static final int UC_CPU_ARM_CORTEX_A15 = 17;
public static final int UC_CPU_ARM_TI925T = 18;
public static final int UC_CPU_ARM_SA1100 = 19;
public static final int UC_CPU_ARM_SA1110 = 20;
public static final int UC_CPU_ARM_PXA250 = 21;
public static final int UC_CPU_ARM_PXA255 = 22;
public static final int UC_CPU_ARM_PXA260 = 23;
public static final int UC_CPU_ARM_PXA261 = 24;
public static final int UC_CPU_ARM_PXA262 = 25;
public static final int UC_CPU_ARM_PXA270 = 26;
public static final int UC_CPU_ARM_PXA270A0 = 27;
public static final int UC_CPU_ARM_PXA270A1 = 28;
public static final int UC_CPU_ARM_PXA270B0 = 29;
public static final int UC_CPU_ARM_PXA270B1 = 30;
public static final int UC_CPU_ARM_PXA270C0 = 31;
public static final int UC_CPU_ARM_PXA270C5 = 32;
public static final int UC_CPU_ARM_MAX = 33;
// ARM registers
public static final int UC_ARM_REG_INVALID = 0;
@ -124,7 +161,28 @@ public interface ArmConst {
public static final int UC_ARM_REG_MSP = 115;
public static final int UC_ARM_REG_PSP = 116;
public static final int UC_ARM_REG_CONTROL = 117;
public static final int UC_ARM_REG_ENDING = 118;
public static final int UC_ARM_REG_IAPSR = 118;
public static final int UC_ARM_REG_EAPSR = 119;
public static final int UC_ARM_REG_XPSR = 120;
public static final int UC_ARM_REG_EPSR = 121;
public static final int UC_ARM_REG_IEPSR = 122;
public static final int UC_ARM_REG_PRIMASK = 123;
public static final int UC_ARM_REG_BASEPRI = 124;
public static final int UC_ARM_REG_BASEPRI_MAX = 125;
public static final int UC_ARM_REG_FAULTMASK = 126;
public static final int UC_ARM_REG_APSR_NZCVQ = 127;
public static final int UC_ARM_REG_APSR_G = 128;
public static final int UC_ARM_REG_APSR_NZCVQG = 129;
public static final int UC_ARM_REG_IAPSR_NZCVQ = 130;
public static final int UC_ARM_REG_IAPSR_G = 131;
public static final int UC_ARM_REG_IAPSR_NZCVQG = 132;
public static final int UC_ARM_REG_EAPSR_NZCVQ = 133;
public static final int UC_ARM_REG_EAPSR_G = 134;
public static final int UC_ARM_REG_EAPSR_NZCVQG = 135;
public static final int UC_ARM_REG_XPSR_NZCVQ = 136;
public static final int UC_ARM_REG_XPSR_G = 137;
public static final int UC_ARM_REG_XPSR_NZCVQG = 138;
public static final int UC_ARM_REG_ENDING = 139;
// alias registers
public static final int UC_ARM_REG_R13 = 12;

View File

@ -4,6 +4,18 @@ package unicorn;
public interface M68kConst {
// M68K CPU
public static final int UC_CPU_M68K_M5206 = 0;
public static final int UC_CPU_M68K_M68000 = 1;
public static final int UC_CPU_M68K_M68020 = 2;
public static final int UC_CPU_M68K_M68030 = 3;
public static final int UC_CPU_M68K_M68040 = 4;
public static final int UC_CPU_M68K_M68060 = 5;
public static final int UC_CPU_M68K_M5208 = 6;
public static final int UC_CPU_M68K_CFV4E = 7;
public static final int UC_CPU_M68K_ANY = 8;
// M68K registers
public static final int UC_M68K_REG_INVALID = 0;

View File

@ -4,6 +4,41 @@ package unicorn;
public interface MipsConst {
// MIPS32 CPUS
public static final int UC_CPU_MIPS32_4KC = 0;
public static final int UC_CPU_MIPS32_4KM = 1;
public static final int UC_CPU_MIPS32_4KECR1 = 2;
public static final int UC_CPU_MIPS32_4KEMR1 = 3;
public static final int UC_CPU_MIPS32_4KEC = 4;
public static final int UC_CPU_MIPS32_4KEM = 5;
public static final int UC_CPU_MIPS32_24KC = 6;
public static final int UC_CPU_MIPS32_24KEC = 7;
public static final int UC_CPU_MIPS32_24KF = 8;
public static final int UC_CPU_MIPS32_34KF = 9;
public static final int UC_CPU_MIPS32_74KF = 10;
public static final int UC_CPU_MIPS32_M14K = 11;
public static final int UC_CPU_MIPS32_M14KC = 12;
public static final int UC_CPU_MIPS32_P5600 = 13;
public static final int UC_CPU_MIPS32_MIPS32R6_GENERIC = 14;
public static final int UC_CPU_MIPS32_I7200 = 15;
// MIPS64 CPUS
public static final int UC_CPU_MIPS64_R4000 = 0;
public static final int UC_CPU_MIPS64_VR5432 = 1;
public static final int UC_CPU_MIPS64_5KC = 2;
public static final int UC_CPU_MIPS64_5KF = 3;
public static final int UC_CPU_MIPS64_20KC = 4;
public static final int UC_CPU_MIPS64_MIPS64R2_GENERIC = 5;
public static final int UC_CPU_MIPS64_5KEC = 6;
public static final int UC_CPU_MIPS64_5KEF = 7;
public static final int UC_CPU_MIPS64_I6400 = 8;
public static final int UC_CPU_MIPS64_I6500 = 9;
public static final int UC_CPU_MIPS64_LOONGSON_2E = 10;
public static final int UC_CPU_MIPS64_LOONGSON_2F = 11;
public static final int UC_CPU_MIPS64_MIPS64DSPR2 = 12;
// MIPS registers
public static final int UC_MIPS_REG_INVALID = 0;
@ -157,7 +192,8 @@ public interface MipsConst {
public static final int UC_MIPS_REG_MPL2 = 136;
public static final int UC_MIPS_REG_CP0_CONFIG3 = 137;
public static final int UC_MIPS_REG_CP0_USERLOCAL = 138;
public static final int UC_MIPS_REG_ENDING = 139;
public static final int UC_MIPS_REG_CP0_STATUS = 139;
public static final int UC_MIPS_REG_ENDING = 140;
public static final int UC_MIPS_REG_ZERO = 2;
public static final int UC_MIPS_REG_AT = 3;
public static final int UC_MIPS_REG_V0 = 4;

View File

@ -0,0 +1,406 @@
// For Unicorn Engine. AUTO-GENERATED FILE, DO NOT EDIT
package unicorn;
public interface PpcConst {
// PPC CPU
public static final int UC_CPU_PPC_401 = 0;
public static final int UC_CPU_PPC_401A1 = 1;
public static final int UC_CPU_PPC_401B2 = 2;
public static final int UC_CPU_PPC_401C2 = 3;
public static final int UC_CPU_PPC_401D2 = 4;
public static final int UC_CPU_PPC_401E2 = 5;
public static final int UC_CPU_PPC_401F2 = 6;
public static final int UC_CPU_PPC_401G2 = 7;
public static final int UC_CPU_PPC_IOP480 = 8;
public static final int UC_CPU_PPC_COBRA = 9;
public static final int UC_CPU_PPC_403GA = 10;
public static final int UC_CPU_PPC_403GB = 11;
public static final int UC_CPU_PPC_403GC = 12;
public static final int UC_CPU_PPC_403GCX = 13;
public static final int UC_CPU_PPC_405D2 = 14;
public static final int UC_CPU_PPC_405D4 = 15;
public static final int UC_CPU_PPC_405CRA = 16;
public static final int UC_CPU_PPC_405CRB = 17;
public static final int UC_CPU_PPC_405CRC = 18;
public static final int UC_CPU_PPC_405EP = 19;
public static final int UC_CPU_PPC_405EZ = 20;
public static final int UC_CPU_PPC_405GPA = 21;
public static final int UC_CPU_PPC_405GPB = 22;
public static final int UC_CPU_PPC_405GPC = 23;
public static final int UC_CPU_PPC_405GPD = 24;
public static final int UC_CPU_PPC_405GPR = 25;
public static final int UC_CPU_PPC_405LP = 26;
public static final int UC_CPU_PPC_NPE405H = 27;
public static final int UC_CPU_PPC_NPE405H2 = 28;
public static final int UC_CPU_PPC_NPE405L = 29;
public static final int UC_CPU_PPC_NPE4GS3 = 30;
public static final int UC_CPU_PPC_STB03 = 31;
public static final int UC_CPU_PPC_STB04 = 32;
public static final int UC_CPU_PPC_STB25 = 33;
public static final int UC_CPU_PPC_X2VP4 = 34;
public static final int UC_CPU_PPC_X2VP20 = 35;
public static final int UC_CPU_PPC_440_XILINX = 36;
public static final int UC_CPU_PPC_440_XILINX_W_DFPU = 37;
public static final int UC_CPU_PPC_440EPA = 38;
public static final int UC_CPU_PPC_440EPB = 39;
public static final int UC_CPU_PPC_440EPX = 40;
public static final int UC_CPU_PPC_460EXB = 41;
public static final int UC_CPU_PPC_G2 = 42;
public static final int UC_CPU_PPC_G2H4 = 43;
public static final int UC_CPU_PPC_G2GP = 44;
public static final int UC_CPU_PPC_G2LS = 45;
public static final int UC_CPU_PPC_G2HIP3 = 46;
public static final int UC_CPU_PPC_G2HIP4 = 47;
public static final int UC_CPU_PPC_MPC603 = 48;
public static final int UC_CPU_PPC_G2LE = 49;
public static final int UC_CPU_PPC_G2LEGP = 50;
public static final int UC_CPU_PPC_G2LELS = 51;
public static final int UC_CPU_PPC_G2LEGP1 = 52;
public static final int UC_CPU_PPC_G2LEGP3 = 53;
public static final int UC_CPU_PPC_MPC5200_V10 = 54;
public static final int UC_CPU_PPC_MPC5200_V11 = 55;
public static final int UC_CPU_PPC_MPC5200_V12 = 56;
public static final int UC_CPU_PPC_MPC5200B_V20 = 57;
public static final int UC_CPU_PPC_MPC5200B_V21 = 58;
public static final int UC_CPU_PPC_E200Z5 = 59;
public static final int UC_CPU_PPC_E200Z6 = 60;
public static final int UC_CPU_PPC_E300C1 = 61;
public static final int UC_CPU_PPC_E300C2 = 62;
public static final int UC_CPU_PPC_E300C3 = 63;
public static final int UC_CPU_PPC_E300C4 = 64;
public static final int UC_CPU_PPC_MPC8343 = 65;
public static final int UC_CPU_PPC_MPC8343A = 66;
public static final int UC_CPU_PPC_MPC8343E = 67;
public static final int UC_CPU_PPC_MPC8343EA = 68;
public static final int UC_CPU_PPC_MPC8347T = 69;
public static final int UC_CPU_PPC_MPC8347P = 70;
public static final int UC_CPU_PPC_MPC8347AT = 71;
public static final int UC_CPU_PPC_MPC8347AP = 72;
public static final int UC_CPU_PPC_MPC8347ET = 73;
public static final int UC_CPU_PPC_MPC8347EP = 74;
public static final int UC_CPU_PPC_MPC8347EAT = 75;
public static final int UC_CPU_PPC_MPC8347EAP = 76;
public static final int UC_CPU_PPC_MPC8349 = 77;
public static final int UC_CPU_PPC_MPC8349A = 78;
public static final int UC_CPU_PPC_MPC8349E = 79;
public static final int UC_CPU_PPC_MPC8349EA = 80;
public static final int UC_CPU_PPC_MPC8377 = 81;
public static final int UC_CPU_PPC_MPC8377E = 82;
public static final int UC_CPU_PPC_MPC8378 = 83;
public static final int UC_CPU_PPC_MPC8378E = 84;
public static final int UC_CPU_PPC_MPC8379 = 85;
public static final int UC_CPU_PPC_MPC8379E = 86;
public static final int UC_CPU_PPC_E500_V10 = 87;
public static final int UC_CPU_PPC_E500_V20 = 88;
public static final int UC_CPU_PPC_E500V2_V10 = 89;
public static final int UC_CPU_PPC_E500V2_V20 = 90;
public static final int UC_CPU_PPC_E500V2_V21 = 91;
public static final int UC_CPU_PPC_E500V2_V22 = 92;
public static final int UC_CPU_PPC_E500V2_V30 = 93;
public static final int UC_CPU_PPC_E500MC = 94;
public static final int UC_CPU_PPC_MPC8533_V10 = 95;
public static final int UC_CPU_PPC_MPC8533_V11 = 96;
public static final int UC_CPU_PPC_MPC8533E_V10 = 97;
public static final int UC_CPU_PPC_MPC8533E_V11 = 98;
public static final int UC_CPU_PPC_MPC8540_V10 = 99;
public static final int UC_CPU_PPC_MPC8540_V20 = 100;
public static final int UC_CPU_PPC_MPC8540_V21 = 101;
public static final int UC_CPU_PPC_MPC8541_V10 = 102;
public static final int UC_CPU_PPC_MPC8541_V11 = 103;
public static final int UC_CPU_PPC_MPC8541E_V10 = 104;
public static final int UC_CPU_PPC_MPC8541E_V11 = 105;
public static final int UC_CPU_PPC_MPC8543_V10 = 106;
public static final int UC_CPU_PPC_MPC8543_V11 = 107;
public static final int UC_CPU_PPC_MPC8543_V20 = 108;
public static final int UC_CPU_PPC_MPC8543_V21 = 109;
public static final int UC_CPU_PPC_MPC8543E_V10 = 110;
public static final int UC_CPU_PPC_MPC8543E_V11 = 111;
public static final int UC_CPU_PPC_MPC8543E_V20 = 112;
public static final int UC_CPU_PPC_MPC8543E_V21 = 113;
public static final int UC_CPU_PPC_MPC8544_V10 = 114;
public static final int UC_CPU_PPC_MPC8544_V11 = 115;
public static final int UC_CPU_PPC_MPC8544E_V10 = 116;
public static final int UC_CPU_PPC_MPC8544E_V11 = 117;
public static final int UC_CPU_PPC_MPC8545_V20 = 118;
public static final int UC_CPU_PPC_MPC8545_V21 = 119;
public static final int UC_CPU_PPC_MPC8545E_V20 = 120;
public static final int UC_CPU_PPC_MPC8545E_V21 = 121;
public static final int UC_CPU_PPC_MPC8547E_V20 = 122;
public static final int UC_CPU_PPC_MPC8547E_V21 = 123;
public static final int UC_CPU_PPC_MPC8548_V10 = 124;
public static final int UC_CPU_PPC_MPC8548_V11 = 125;
public static final int UC_CPU_PPC_MPC8548_V20 = 126;
public static final int UC_CPU_PPC_MPC8548_V21 = 127;
public static final int UC_CPU_PPC_MPC8548E_V10 = 128;
public static final int UC_CPU_PPC_MPC8548E_V11 = 129;
public static final int UC_CPU_PPC_MPC8548E_V20 = 130;
public static final int UC_CPU_PPC_MPC8548E_V21 = 131;
public static final int UC_CPU_PPC_MPC8555_V10 = 132;
public static final int UC_CPU_PPC_MPC8555_V11 = 133;
public static final int UC_CPU_PPC_MPC8555E_V10 = 134;
public static final int UC_CPU_PPC_MPC8555E_V11 = 135;
public static final int UC_CPU_PPC_MPC8560_V10 = 136;
public static final int UC_CPU_PPC_MPC8560_V20 = 137;
public static final int UC_CPU_PPC_MPC8560_V21 = 138;
public static final int UC_CPU_PPC_MPC8567 = 139;
public static final int UC_CPU_PPC_MPC8567E = 140;
public static final int UC_CPU_PPC_MPC8568 = 141;
public static final int UC_CPU_PPC_MPC8568E = 142;
public static final int UC_CPU_PPC_MPC8572 = 143;
public static final int UC_CPU_PPC_MPC8572E = 144;
public static final int UC_CPU_PPC_E600 = 145;
public static final int UC_CPU_PPC_MPC8610 = 146;
public static final int UC_CPU_PPC_MPC8641 = 147;
public static final int UC_CPU_PPC_MPC8641D = 148;
public static final int UC_CPU_PPC_601_V0 = 149;
public static final int UC_CPU_PPC_601_V1 = 150;
public static final int UC_CPU_PPC_601_V2 = 151;
public static final int UC_CPU_PPC_602 = 152;
public static final int UC_CPU_PPC_603 = 153;
public static final int UC_CPU_PPC_603E_V1_1 = 154;
public static final int UC_CPU_PPC_603E_V1_2 = 155;
public static final int UC_CPU_PPC_603E_V1_3 = 156;
public static final int UC_CPU_PPC_603E_V1_4 = 157;
public static final int UC_CPU_PPC_603E_V2_2 = 158;
public static final int UC_CPU_PPC_603E_V3 = 159;
public static final int UC_CPU_PPC_603E_V4 = 160;
public static final int UC_CPU_PPC_603E_V4_1 = 161;
public static final int UC_CPU_PPC_603E7 = 162;
public static final int UC_CPU_PPC_603E7T = 163;
public static final int UC_CPU_PPC_603E7V = 164;
public static final int UC_CPU_PPC_603E7V1 = 165;
public static final int UC_CPU_PPC_603E7V2 = 166;
public static final int UC_CPU_PPC_603P = 167;
public static final int UC_CPU_PPC_604 = 168;
public static final int UC_CPU_PPC_604E_V1_0 = 169;
public static final int UC_CPU_PPC_604E_V2_2 = 170;
public static final int UC_CPU_PPC_604E_V2_4 = 171;
public static final int UC_CPU_PPC_604R = 172;
public static final int UC_CPU_PPC_740_V1_0 = 173;
public static final int UC_CPU_PPC_750_V1_0 = 174;
public static final int UC_CPU_PPC_740_V2_0 = 175;
public static final int UC_CPU_PPC_750_V2_0 = 176;
public static final int UC_CPU_PPC_740_V2_1 = 177;
public static final int UC_CPU_PPC_750_V2_1 = 178;
public static final int UC_CPU_PPC_740_V2_2 = 179;
public static final int UC_CPU_PPC_750_V2_2 = 180;
public static final int UC_CPU_PPC_740_V3_0 = 181;
public static final int UC_CPU_PPC_750_V3_0 = 182;
public static final int UC_CPU_PPC_740_V3_1 = 183;
public static final int UC_CPU_PPC_750_V3_1 = 184;
public static final int UC_CPU_PPC_740E = 185;
public static final int UC_CPU_PPC_750E = 186;
public static final int UC_CPU_PPC_740P = 187;
public static final int UC_CPU_PPC_750P = 188;
public static final int UC_CPU_PPC_750CL_V1_0 = 189;
public static final int UC_CPU_PPC_750CL_V2_0 = 190;
public static final int UC_CPU_PPC_750CX_V1_0 = 191;
public static final int UC_CPU_PPC_750CX_V2_0 = 192;
public static final int UC_CPU_PPC_750CX_V2_1 = 193;
public static final int UC_CPU_PPC_750CX_V2_2 = 194;
public static final int UC_CPU_PPC_750CXE_V2_1 = 195;
public static final int UC_CPU_PPC_750CXE_V2_2 = 196;
public static final int UC_CPU_PPC_750CXE_V2_3 = 197;
public static final int UC_CPU_PPC_750CXE_V2_4 = 198;
public static final int UC_CPU_PPC_750CXE_V2_4B = 199;
public static final int UC_CPU_PPC_750CXE_V3_0 = 200;
public static final int UC_CPU_PPC_750CXE_V3_1 = 201;
public static final int UC_CPU_PPC_750CXE_V3_1B = 202;
public static final int UC_CPU_PPC_750CXR = 203;
public static final int UC_CPU_PPC_750FL = 204;
public static final int UC_CPU_PPC_750FX_V1_0 = 205;
public static final int UC_CPU_PPC_750FX_V2_0 = 206;
public static final int UC_CPU_PPC_750FX_V2_1 = 207;
public static final int UC_CPU_PPC_750FX_V2_2 = 208;
public static final int UC_CPU_PPC_750FX_V2_3 = 209;
public static final int UC_CPU_PPC_750GL = 210;
public static final int UC_CPU_PPC_750GX_V1_0 = 211;
public static final int UC_CPU_PPC_750GX_V1_1 = 212;
public static final int UC_CPU_PPC_750GX_V1_2 = 213;
public static final int UC_CPU_PPC_750L_V2_0 = 214;
public static final int UC_CPU_PPC_750L_V2_1 = 215;
public static final int UC_CPU_PPC_750L_V2_2 = 216;
public static final int UC_CPU_PPC_750L_V3_0 = 217;
public static final int UC_CPU_PPC_750L_V3_2 = 218;
public static final int UC_CPU_PPC_745_V1_0 = 219;
public static final int UC_CPU_PPC_755_V1_0 = 220;
public static final int UC_CPU_PPC_745_V1_1 = 221;
public static final int UC_CPU_PPC_755_V1_1 = 222;
public static final int UC_CPU_PPC_745_V2_0 = 223;
public static final int UC_CPU_PPC_755_V2_0 = 224;
public static final int UC_CPU_PPC_745_V2_1 = 225;
public static final int UC_CPU_PPC_755_V2_1 = 226;
public static final int UC_CPU_PPC_745_V2_2 = 227;
public static final int UC_CPU_PPC_755_V2_2 = 228;
public static final int UC_CPU_PPC_745_V2_3 = 229;
public static final int UC_CPU_PPC_755_V2_3 = 230;
public static final int UC_CPU_PPC_745_V2_4 = 231;
public static final int UC_CPU_PPC_755_V2_4 = 232;
public static final int UC_CPU_PPC_745_V2_5 = 233;
public static final int UC_CPU_PPC_755_V2_5 = 234;
public static final int UC_CPU_PPC_745_V2_6 = 235;
public static final int UC_CPU_PPC_755_V2_6 = 236;
public static final int UC_CPU_PPC_745_V2_7 = 237;
public static final int UC_CPU_PPC_755_V2_7 = 238;
public static final int UC_CPU_PPC_745_V2_8 = 239;
public static final int UC_CPU_PPC_755_V2_8 = 240;
public static final int UC_CPU_PPC_7400_V1_0 = 241;
public static final int UC_CPU_PPC_7400_V1_1 = 242;
public static final int UC_CPU_PPC_7400_V2_0 = 243;
public static final int UC_CPU_PPC_7400_V2_1 = 244;
public static final int UC_CPU_PPC_7400_V2_2 = 245;
public static final int UC_CPU_PPC_7400_V2_6 = 246;
public static final int UC_CPU_PPC_7400_V2_7 = 247;
public static final int UC_CPU_PPC_7400_V2_8 = 248;
public static final int UC_CPU_PPC_7400_V2_9 = 249;
public static final int UC_CPU_PPC_7410_V1_0 = 250;
public static final int UC_CPU_PPC_7410_V1_1 = 251;
public static final int UC_CPU_PPC_7410_V1_2 = 252;
public static final int UC_CPU_PPC_7410_V1_3 = 253;
public static final int UC_CPU_PPC_7410_V1_4 = 254;
public static final int UC_CPU_PPC_7448_V1_0 = 255;
public static final int UC_CPU_PPC_7448_V1_1 = 256;
public static final int UC_CPU_PPC_7448_V2_0 = 257;
public static final int UC_CPU_PPC_7448_V2_1 = 258;
public static final int UC_CPU_PPC_7450_V1_0 = 259;
public static final int UC_CPU_PPC_7450_V1_1 = 260;
public static final int UC_CPU_PPC_7450_V1_2 = 261;
public static final int UC_CPU_PPC_7450_V2_0 = 262;
public static final int UC_CPU_PPC_7450_V2_1 = 263;
public static final int UC_CPU_PPC_7441_V2_1 = 264;
public static final int UC_CPU_PPC_7441_V2_3 = 265;
public static final int UC_CPU_PPC_7451_V2_3 = 266;
public static final int UC_CPU_PPC_7441_V2_10 = 267;
public static final int UC_CPU_PPC_7451_V2_10 = 268;
public static final int UC_CPU_PPC_7445_V1_0 = 269;
public static final int UC_CPU_PPC_7455_V1_0 = 270;
public static final int UC_CPU_PPC_7445_V2_1 = 271;
public static final int UC_CPU_PPC_7455_V2_1 = 272;
public static final int UC_CPU_PPC_7445_V3_2 = 273;
public static final int UC_CPU_PPC_7455_V3_2 = 274;
public static final int UC_CPU_PPC_7445_V3_3 = 275;
public static final int UC_CPU_PPC_7455_V3_3 = 276;
public static final int UC_CPU_PPC_7445_V3_4 = 277;
public static final int UC_CPU_PPC_7455_V3_4 = 278;
public static final int UC_CPU_PPC_7447_V1_0 = 279;
public static final int UC_CPU_PPC_7457_V1_0 = 280;
public static final int UC_CPU_PPC_7447_V1_1 = 281;
public static final int UC_CPU_PPC_7457_V1_1 = 282;
public static final int UC_CPU_PPC_7457_V1_2 = 283;
public static final int UC_CPU_PPC_7447A_V1_0 = 284;
public static final int UC_CPU_PPC_7457A_V1_0 = 285;
public static final int UC_CPU_PPC_7447A_V1_1 = 286;
public static final int UC_CPU_PPC_7457A_V1_1 = 287;
public static final int UC_CPU_PPC_7447A_V1_2 = 288;
public static final int UC_CPU_PPC_7457A_V1_2 = 289;
// PPC64 CPU
public static final int UC_CPU_PPC_E5500 = 0;
public static final int UC_CPU_PPC_E6500 = 1;
public static final int UC_CPU_PPC_970_V2_2 = 2;
public static final int UC_CPU_PPC_970FX_V1_0 = 3;
public static final int UC_CPU_PPC_970FX_V2_0 = 4;
public static final int UC_CPU_PPC_970FX_V2_1 = 5;
public static final int UC_CPU_PPC_970FX_V3_0 = 6;
public static final int UC_CPU_PPC_970FX_V3_1 = 7;
public static final int UC_CPU_PPC_970MP_V1_0 = 8;
public static final int UC_CPU_PPC_970MP_V1_1 = 9;
public static final int UC_CPU_PPC_POWER5_V2_1 = 10;
public static final int UC_CPU_PPC_POWER7_V2_3 = 11;
public static final int UC_CPU_PPC_POWER7_V2_1 = 12;
public static final int UC_CPU_PPC_POWER8E_V2_1 = 13;
public static final int UC_CPU_PPC_POWER8_V2_0 = 14;
public static final int UC_CPU_PPC_POWER8NVL_V1_0 = 15;
public static final int UC_CPU_PPC_POWER9_V1_0 = 16;
public static final int UC_CPU_PPC_POWER9_V2_0 = 17;
public static final int UC_CPU_PPC_POWER10_V1_0 = 18;
// PPC registers
public static final int UC_PPC_REG_INVALID = 0;
// General purpose registers
public static final int UC_PPC_REG_PC = 1;
public static final int UC_PPC_REG_0 = 2;
public static final int UC_PPC_REG_1 = 3;
public static final int UC_PPC_REG_2 = 4;
public static final int UC_PPC_REG_3 = 5;
public static final int UC_PPC_REG_4 = 6;
public static final int UC_PPC_REG_5 = 7;
public static final int UC_PPC_REG_6 = 8;
public static final int UC_PPC_REG_7 = 9;
public static final int UC_PPC_REG_8 = 10;
public static final int UC_PPC_REG_9 = 11;
public static final int UC_PPC_REG_10 = 12;
public static final int UC_PPC_REG_11 = 13;
public static final int UC_PPC_REG_12 = 14;
public static final int UC_PPC_REG_13 = 15;
public static final int UC_PPC_REG_14 = 16;
public static final int UC_PPC_REG_15 = 17;
public static final int UC_PPC_REG_16 = 18;
public static final int UC_PPC_REG_17 = 19;
public static final int UC_PPC_REG_18 = 20;
public static final int UC_PPC_REG_19 = 21;
public static final int UC_PPC_REG_20 = 22;
public static final int UC_PPC_REG_21 = 23;
public static final int UC_PPC_REG_22 = 24;
public static final int UC_PPC_REG_23 = 25;
public static final int UC_PPC_REG_24 = 26;
public static final int UC_PPC_REG_25 = 27;
public static final int UC_PPC_REG_26 = 28;
public static final int UC_PPC_REG_27 = 29;
public static final int UC_PPC_REG_28 = 30;
public static final int UC_PPC_REG_29 = 31;
public static final int UC_PPC_REG_30 = 32;
public static final int UC_PPC_REG_31 = 33;
public static final int UC_PPC_REG_CR0 = 34;
public static final int UC_PPC_REG_CR1 = 35;
public static final int UC_PPC_REG_CR2 = 36;
public static final int UC_PPC_REG_CR3 = 37;
public static final int UC_PPC_REG_CR4 = 38;
public static final int UC_PPC_REG_CR5 = 39;
public static final int UC_PPC_REG_CR6 = 40;
public static final int UC_PPC_REG_CR7 = 41;
public static final int UC_PPC_REG_FPR0 = 42;
public static final int UC_PPC_REG_FPR1 = 43;
public static final int UC_PPC_REG_FPR2 = 44;
public static final int UC_PPC_REG_FPR3 = 45;
public static final int UC_PPC_REG_FPR4 = 46;
public static final int UC_PPC_REG_FPR5 = 47;
public static final int UC_PPC_REG_FPR6 = 48;
public static final int UC_PPC_REG_FPR7 = 49;
public static final int UC_PPC_REG_FPR8 = 50;
public static final int UC_PPC_REG_FPR9 = 51;
public static final int UC_PPC_REG_FPR10 = 52;
public static final int UC_PPC_REG_FPR11 = 53;
public static final int UC_PPC_REG_FPR12 = 54;
public static final int UC_PPC_REG_FPR13 = 55;
public static final int UC_PPC_REG_FPR14 = 56;
public static final int UC_PPC_REG_FPR15 = 57;
public static final int UC_PPC_REG_FPR16 = 58;
public static final int UC_PPC_REG_FPR17 = 59;
public static final int UC_PPC_REG_FPR18 = 60;
public static final int UC_PPC_REG_FPR19 = 61;
public static final int UC_PPC_REG_FPR20 = 62;
public static final int UC_PPC_REG_FPR21 = 63;
public static final int UC_PPC_REG_FPR22 = 64;
public static final int UC_PPC_REG_FPR23 = 65;
public static final int UC_PPC_REG_FPR24 = 66;
public static final int UC_PPC_REG_FPR25 = 67;
public static final int UC_PPC_REG_FPR26 = 68;
public static final int UC_PPC_REG_FPR27 = 69;
public static final int UC_PPC_REG_FPR28 = 70;
public static final int UC_PPC_REG_FPR29 = 71;
public static final int UC_PPC_REG_FPR30 = 72;
public static final int UC_PPC_REG_FPR31 = 73;
public static final int UC_PPC_REG_LR = 74;
public static final int UC_PPC_REG_XER = 75;
public static final int UC_PPC_REG_CTR = 76;
public static final int UC_PPC_REG_MSR = 77;
public static final int UC_PPC_REG_FPSCR = 78;
}

View File

@ -0,0 +1,289 @@
// For Unicorn Engine. AUTO-GENERATED FILE, DO NOT EDIT
package unicorn;
public interface RiscvConst {
// RISCV32 CPU
public static final int UC_CPU_RISCV32_ANY = 0;
public static final int UC_CPU_RISCV32_BASE32 = 1;
public static final int UC_CPU_RISCV32_SIFIVE_E31 = 2;
public static final int UC_CPU_RISCV32_SIFIVE_U34 = 3;
// RISCV64 CPU
public static final int UC_CPU_RISCV64_ANY = 0;
public static final int UC_CPU_RISCV64_BASE64 = 1;
public static final int UC_CPU_RISCV64_SIFIVE_E51 = 2;
public static final int UC_CPU_RISCV64_SIFIVE_U54 = 3;
// RISCV registers
public static final int UC_RISCV_REG_INVALID = 0;
// General purpose registers
public static final int UC_RISCV_REG_X0 = 1;
public static final int UC_RISCV_REG_X1 = 2;
public static final int UC_RISCV_REG_X2 = 3;
public static final int UC_RISCV_REG_X3 = 4;
public static final int UC_RISCV_REG_X4 = 5;
public static final int UC_RISCV_REG_X5 = 6;
public static final int UC_RISCV_REG_X6 = 7;
public static final int UC_RISCV_REG_X7 = 8;
public static final int UC_RISCV_REG_X8 = 9;
public static final int UC_RISCV_REG_X9 = 10;
public static final int UC_RISCV_REG_X10 = 11;
public static final int UC_RISCV_REG_X11 = 12;
public static final int UC_RISCV_REG_X12 = 13;
public static final int UC_RISCV_REG_X13 = 14;
public static final int UC_RISCV_REG_X14 = 15;
public static final int UC_RISCV_REG_X15 = 16;
public static final int UC_RISCV_REG_X16 = 17;
public static final int UC_RISCV_REG_X17 = 18;
public static final int UC_RISCV_REG_X18 = 19;
public static final int UC_RISCV_REG_X19 = 20;
public static final int UC_RISCV_REG_X20 = 21;
public static final int UC_RISCV_REG_X21 = 22;
public static final int UC_RISCV_REG_X22 = 23;
public static final int UC_RISCV_REG_X23 = 24;
public static final int UC_RISCV_REG_X24 = 25;
public static final int UC_RISCV_REG_X25 = 26;
public static final int UC_RISCV_REG_X26 = 27;
public static final int UC_RISCV_REG_X27 = 28;
public static final int UC_RISCV_REG_X28 = 29;
public static final int UC_RISCV_REG_X29 = 30;
public static final int UC_RISCV_REG_X30 = 31;
public static final int UC_RISCV_REG_X31 = 32;
// RISCV CSR
public static final int UC_RISCV_REG_USTATUS = 33;
public static final int UC_RISCV_REG_UIE = 34;
public static final int UC_RISCV_REG_UTVEC = 35;
public static final int UC_RISCV_REG_USCRATCH = 36;
public static final int UC_RISCV_REG_UEPC = 37;
public static final int UC_RISCV_REG_UCAUSE = 38;
public static final int UC_RISCV_REG_UTVAL = 39;
public static final int UC_RISCV_REG_UIP = 40;
public static final int UC_RISCV_REG_FFLAGS = 41;
public static final int UC_RISCV_REG_FRM = 42;
public static final int UC_RISCV_REG_FCSR = 43;
public static final int UC_RISCV_REG_CYCLE = 44;
public static final int UC_RISCV_REG_TIME = 45;
public static final int UC_RISCV_REG_INSTRET = 46;
public static final int UC_RISCV_REG_HPMCOUNTER3 = 47;
public static final int UC_RISCV_REG_HPMCOUNTER4 = 48;
public static final int UC_RISCV_REG_HPMCOUNTER5 = 49;
public static final int UC_RISCV_REG_HPMCOUNTER6 = 50;
public static final int UC_RISCV_REG_HPMCOUNTER7 = 51;
public static final int UC_RISCV_REG_HPMCOUNTER8 = 52;
public static final int UC_RISCV_REG_HPMCOUNTER9 = 53;
public static final int UC_RISCV_REG_HPMCOUNTER10 = 54;
public static final int UC_RISCV_REG_HPMCOUNTER11 = 55;
public static final int UC_RISCV_REG_HPMCOUNTER12 = 56;
public static final int UC_RISCV_REG_HPMCOUNTER13 = 57;
public static final int UC_RISCV_REG_HPMCOUNTER14 = 58;
public static final int UC_RISCV_REG_HPMCOUNTER15 = 59;
public static final int UC_RISCV_REG_HPMCOUNTER16 = 60;
public static final int UC_RISCV_REG_HPMCOUNTER17 = 61;
public static final int UC_RISCV_REG_HPMCOUNTER18 = 62;
public static final int UC_RISCV_REG_HPMCOUNTER19 = 63;
public static final int UC_RISCV_REG_HPMCOUNTER20 = 64;
public static final int UC_RISCV_REG_HPMCOUNTER21 = 65;
public static final int UC_RISCV_REG_HPMCOUNTER22 = 66;
public static final int UC_RISCV_REG_HPMCOUNTER23 = 67;
public static final int UC_RISCV_REG_HPMCOUNTER24 = 68;
public static final int UC_RISCV_REG_HPMCOUNTER25 = 69;
public static final int UC_RISCV_REG_HPMCOUNTER26 = 70;
public static final int UC_RISCV_REG_HPMCOUNTER27 = 71;
public static final int UC_RISCV_REG_HPMCOUNTER28 = 72;
public static final int UC_RISCV_REG_HPMCOUNTER29 = 73;
public static final int UC_RISCV_REG_HPMCOUNTER30 = 74;
public static final int UC_RISCV_REG_HPMCOUNTER31 = 75;
public static final int UC_RISCV_REG_CYCLEH = 76;
public static final int UC_RISCV_REG_TIMEH = 77;
public static final int UC_RISCV_REG_INSTRETH = 78;
public static final int UC_RISCV_REG_HPMCOUNTER3H = 79;
public static final int UC_RISCV_REG_HPMCOUNTER4H = 80;
public static final int UC_RISCV_REG_HPMCOUNTER5H = 81;
public static final int UC_RISCV_REG_HPMCOUNTER6H = 82;
public static final int UC_RISCV_REG_HPMCOUNTER7H = 83;
public static final int UC_RISCV_REG_HPMCOUNTER8H = 84;
public static final int UC_RISCV_REG_HPMCOUNTER9H = 85;
public static final int UC_RISCV_REG_HPMCOUNTER10H = 86;
public static final int UC_RISCV_REG_HPMCOUNTER11H = 87;
public static final int UC_RISCV_REG_HPMCOUNTER12H = 88;
public static final int UC_RISCV_REG_HPMCOUNTER13H = 89;
public static final int UC_RISCV_REG_HPMCOUNTER14H = 90;
public static final int UC_RISCV_REG_HPMCOUNTER15H = 91;
public static final int UC_RISCV_REG_HPMCOUNTER16H = 92;
public static final int UC_RISCV_REG_HPMCOUNTER17H = 93;
public static final int UC_RISCV_REG_HPMCOUNTER18H = 94;
public static final int UC_RISCV_REG_HPMCOUNTER19H = 95;
public static final int UC_RISCV_REG_HPMCOUNTER20H = 96;
public static final int UC_RISCV_REG_HPMCOUNTER21H = 97;
public static final int UC_RISCV_REG_HPMCOUNTER22H = 98;
public static final int UC_RISCV_REG_HPMCOUNTER23H = 99;
public static final int UC_RISCV_REG_HPMCOUNTER24H = 100;
public static final int UC_RISCV_REG_HPMCOUNTER25H = 101;
public static final int UC_RISCV_REG_HPMCOUNTER26H = 102;
public static final int UC_RISCV_REG_HPMCOUNTER27H = 103;
public static final int UC_RISCV_REG_HPMCOUNTER28H = 104;
public static final int UC_RISCV_REG_HPMCOUNTER29H = 105;
public static final int UC_RISCV_REG_HPMCOUNTER30H = 106;
public static final int UC_RISCV_REG_HPMCOUNTER31H = 107;
public static final int UC_RISCV_REG_MCYCLE = 108;
public static final int UC_RISCV_REG_MINSTRET = 109;
public static final int UC_RISCV_REG_MCYCLEH = 110;
public static final int UC_RISCV_REG_MINSTRETH = 111;
public static final int UC_RISCV_REG_MVENDORID = 112;
public static final int UC_RISCV_REG_MARCHID = 113;
public static final int UC_RISCV_REG_MIMPID = 114;
public static final int UC_RISCV_REG_MHARTID = 115;
public static final int UC_RISCV_REG_MSTATUS = 116;
public static final int UC_RISCV_REG_MISA = 117;
public static final int UC_RISCV_REG_MEDELEG = 118;
public static final int UC_RISCV_REG_MIDELEG = 119;
public static final int UC_RISCV_REG_MIE = 120;
public static final int UC_RISCV_REG_MTVEC = 121;
public static final int UC_RISCV_REG_MCOUNTEREN = 122;
public static final int UC_RISCV_REG_MSTATUSH = 123;
public static final int UC_RISCV_REG_MUCOUNTEREN = 124;
public static final int UC_RISCV_REG_MSCOUNTEREN = 125;
public static final int UC_RISCV_REG_MHCOUNTEREN = 126;
public static final int UC_RISCV_REG_MSCRATCH = 127;
public static final int UC_RISCV_REG_MEPC = 128;
public static final int UC_RISCV_REG_MCAUSE = 129;
public static final int UC_RISCV_REG_MTVAL = 130;
public static final int UC_RISCV_REG_MIP = 131;
public static final int UC_RISCV_REG_MBADADDR = 132;
public static final int UC_RISCV_REG_SSTATUS = 133;
public static final int UC_RISCV_REG_SEDELEG = 134;
public static final int UC_RISCV_REG_SIDELEG = 135;
public static final int UC_RISCV_REG_SIE = 136;
public static final int UC_RISCV_REG_STVEC = 137;
public static final int UC_RISCV_REG_SCOUNTEREN = 138;
public static final int UC_RISCV_REG_SSCRATCH = 139;
public static final int UC_RISCV_REG_SEPC = 140;
public static final int UC_RISCV_REG_SCAUSE = 141;
public static final int UC_RISCV_REG_STVAL = 142;
public static final int UC_RISCV_REG_SIP = 143;
public static final int UC_RISCV_REG_SBADADDR = 144;
public static final int UC_RISCV_REG_SPTBR = 145;
public static final int UC_RISCV_REG_SATP = 146;
public static final int UC_RISCV_REG_HSTATUS = 147;
public static final int UC_RISCV_REG_HEDELEG = 148;
public static final int UC_RISCV_REG_HIDELEG = 149;
public static final int UC_RISCV_REG_HIE = 150;
public static final int UC_RISCV_REG_HCOUNTEREN = 151;
public static final int UC_RISCV_REG_HTVAL = 152;
public static final int UC_RISCV_REG_HIP = 153;
public static final int UC_RISCV_REG_HTINST = 154;
public static final int UC_RISCV_REG_HGATP = 155;
public static final int UC_RISCV_REG_HTIMEDELTA = 156;
public static final int UC_RISCV_REG_HTIMEDELTAH = 157;
// Floating-point registers
public static final int UC_RISCV_REG_F0 = 158;
public static final int UC_RISCV_REG_F1 = 159;
public static final int UC_RISCV_REG_F2 = 160;
public static final int UC_RISCV_REG_F3 = 161;
public static final int UC_RISCV_REG_F4 = 162;
public static final int UC_RISCV_REG_F5 = 163;
public static final int UC_RISCV_REG_F6 = 164;
public static final int UC_RISCV_REG_F7 = 165;
public static final int UC_RISCV_REG_F8 = 166;
public static final int UC_RISCV_REG_F9 = 167;
public static final int UC_RISCV_REG_F10 = 168;
public static final int UC_RISCV_REG_F11 = 169;
public static final int UC_RISCV_REG_F12 = 170;
public static final int UC_RISCV_REG_F13 = 171;
public static final int UC_RISCV_REG_F14 = 172;
public static final int UC_RISCV_REG_F15 = 173;
public static final int UC_RISCV_REG_F16 = 174;
public static final int UC_RISCV_REG_F17 = 175;
public static final int UC_RISCV_REG_F18 = 176;
public static final int UC_RISCV_REG_F19 = 177;
public static final int UC_RISCV_REG_F20 = 178;
public static final int UC_RISCV_REG_F21 = 179;
public static final int UC_RISCV_REG_F22 = 180;
public static final int UC_RISCV_REG_F23 = 181;
public static final int UC_RISCV_REG_F24 = 182;
public static final int UC_RISCV_REG_F25 = 183;
public static final int UC_RISCV_REG_F26 = 184;
public static final int UC_RISCV_REG_F27 = 185;
public static final int UC_RISCV_REG_F28 = 186;
public static final int UC_RISCV_REG_F29 = 187;
public static final int UC_RISCV_REG_F30 = 188;
public static final int UC_RISCV_REG_F31 = 189;
public static final int UC_RISCV_REG_PC = 190;
public static final int UC_RISCV_REG_ENDING = 191;
// Alias registers
public static final int UC_RISCV_REG_ZERO = 1;
public static final int UC_RISCV_REG_RA = 2;
public static final int UC_RISCV_REG_SP = 3;
public static final int UC_RISCV_REG_GP = 4;
public static final int UC_RISCV_REG_TP = 5;
public static final int UC_RISCV_REG_T0 = 6;
public static final int UC_RISCV_REG_T1 = 7;
public static final int UC_RISCV_REG_T2 = 8;
public static final int UC_RISCV_REG_S0 = 9;
public static final int UC_RISCV_REG_FP = 9;
public static final int UC_RISCV_REG_S1 = 10;
public static final int UC_RISCV_REG_A0 = 11;
public static final int UC_RISCV_REG_A1 = 12;
public static final int UC_RISCV_REG_A2 = 13;
public static final int UC_RISCV_REG_A3 = 14;
public static final int UC_RISCV_REG_A4 = 15;
public static final int UC_RISCV_REG_A5 = 16;
public static final int UC_RISCV_REG_A6 = 17;
public static final int UC_RISCV_REG_A7 = 18;
public static final int UC_RISCV_REG_S2 = 19;
public static final int UC_RISCV_REG_S3 = 20;
public static final int UC_RISCV_REG_S4 = 21;
public static final int UC_RISCV_REG_S5 = 22;
public static final int UC_RISCV_REG_S6 = 23;
public static final int UC_RISCV_REG_S7 = 24;
public static final int UC_RISCV_REG_S8 = 25;
public static final int UC_RISCV_REG_S9 = 26;
public static final int UC_RISCV_REG_S10 = 27;
public static final int UC_RISCV_REG_S11 = 28;
public static final int UC_RISCV_REG_T3 = 29;
public static final int UC_RISCV_REG_T4 = 30;
public static final int UC_RISCV_REG_T5 = 31;
public static final int UC_RISCV_REG_T6 = 32;
public static final int UC_RISCV_REG_FT0 = 158;
public static final int UC_RISCV_REG_FT1 = 159;
public static final int UC_RISCV_REG_FT2 = 160;
public static final int UC_RISCV_REG_FT3 = 161;
public static final int UC_RISCV_REG_FT4 = 162;
public static final int UC_RISCV_REG_FT5 = 163;
public static final int UC_RISCV_REG_FT6 = 164;
public static final int UC_RISCV_REG_FT7 = 165;
public static final int UC_RISCV_REG_FS0 = 166;
public static final int UC_RISCV_REG_FS1 = 167;
public static final int UC_RISCV_REG_FA0 = 168;
public static final int UC_RISCV_REG_FA1 = 169;
public static final int UC_RISCV_REG_FA2 = 170;
public static final int UC_RISCV_REG_FA3 = 171;
public static final int UC_RISCV_REG_FA4 = 172;
public static final int UC_RISCV_REG_FA5 = 173;
public static final int UC_RISCV_REG_FA6 = 174;
public static final int UC_RISCV_REG_FA7 = 175;
public static final int UC_RISCV_REG_FS2 = 176;
public static final int UC_RISCV_REG_FS3 = 177;
public static final int UC_RISCV_REG_FS4 = 178;
public static final int UC_RISCV_REG_FS5 = 179;
public static final int UC_RISCV_REG_FS6 = 180;
public static final int UC_RISCV_REG_FS7 = 181;
public static final int UC_RISCV_REG_FS8 = 182;
public static final int UC_RISCV_REG_FS9 = 183;
public static final int UC_RISCV_REG_FS10 = 184;
public static final int UC_RISCV_REG_FS11 = 185;
public static final int UC_RISCV_REG_FT8 = 186;
public static final int UC_RISCV_REG_FT9 = 187;
public static final int UC_RISCV_REG_FT10 = 188;
public static final int UC_RISCV_REG_FT11 = 189;
}

View File

@ -0,0 +1,127 @@
// For Unicorn Engine. AUTO-GENERATED FILE, DO NOT EDIT
package unicorn;
public interface S390xConst {
// S390X CPU
public static final int UC_CPU_S390X_Z900 = 0;
public static final int UC_CPU_S390X_Z900_2 = 1;
public static final int UC_CPU_S390X_Z900_3 = 2;
public static final int UC_CPU_S390X_Z800 = 3;
public static final int UC_CPU_S390X_Z990 = 4;
public static final int UC_CPU_S390X_Z990_2 = 5;
public static final int UC_CPU_S390X_Z990_3 = 6;
public static final int UC_CPU_S390X_Z890 = 7;
public static final int UC_CPU_S390X_Z990_4 = 8;
public static final int UC_CPU_S390X_Z890_2 = 9;
public static final int UC_CPU_S390X_Z990_5 = 10;
public static final int UC_CPU_S390X_Z890_3 = 11;
public static final int UC_CPU_S390X_Z9EC = 12;
public static final int UC_CPU_S390X_Z9EC_2 = 13;
public static final int UC_CPU_S390X_Z9BC = 14;
public static final int UC_CPU_S390X_Z9EC_3 = 15;
public static final int UC_CPU_S390X_Z9BC_2 = 16;
public static final int UC_CPU_S390X_Z10EC = 17;
public static final int UC_CPU_S390X_Z10EC_2 = 18;
public static final int UC_CPU_S390X_Z10BC = 19;
public static final int UC_CPU_S390X_Z10EC_3 = 20;
public static final int UC_CPU_S390X_Z10BC_2 = 21;
public static final int UC_CPU_S390X_Z196 = 22;
public static final int UC_CPU_S390X_Z196_2 = 23;
public static final int UC_CPU_S390X_Z114 = 24;
public static final int UC_CPU_S390X_ZEC12 = 25;
public static final int UC_CPU_S390X_ZEC12_2 = 26;
public static final int UC_CPU_S390X_ZBC12 = 27;
public static final int UC_CPU_S390X_Z13 = 28;
public static final int UC_CPU_S390X_Z13_2 = 29;
public static final int UC_CPU_S390X_Z13S = 30;
public static final int UC_CPU_S390X_Z14 = 31;
public static final int UC_CPU_S390X_Z14_2 = 32;
public static final int UC_CPU_S390X_Z14ZR1 = 33;
public static final int UC_CPU_S390X_GEN15A = 34;
public static final int UC_CPU_S390X_GEN15B = 35;
public static final int UC_CPU_S390X_QEMU = 36;
public static final int UC_CPU_S390X_MAX = 37;
// S390X registers
public static final int UC_S390X_REG_INVALID = 0;
// General purpose registers
public static final int UC_S390X_REG_R0 = 1;
public static final int UC_S390X_REG_R1 = 2;
public static final int UC_S390X_REG_R2 = 3;
public static final int UC_S390X_REG_R3 = 4;
public static final int UC_S390X_REG_R4 = 5;
public static final int UC_S390X_REG_R5 = 6;
public static final int UC_S390X_REG_R6 = 7;
public static final int UC_S390X_REG_R7 = 8;
public static final int UC_S390X_REG_R8 = 9;
public static final int UC_S390X_REG_R9 = 10;
public static final int UC_S390X_REG_R10 = 11;
public static final int UC_S390X_REG_R11 = 12;
public static final int UC_S390X_REG_R12 = 13;
public static final int UC_S390X_REG_R13 = 14;
public static final int UC_S390X_REG_R14 = 15;
public static final int UC_S390X_REG_R15 = 16;
// Floating point registers
public static final int UC_S390X_REG_F0 = 17;
public static final int UC_S390X_REG_F1 = 18;
public static final int UC_S390X_REG_F2 = 19;
public static final int UC_S390X_REG_F3 = 20;
public static final int UC_S390X_REG_F4 = 21;
public static final int UC_S390X_REG_F5 = 22;
public static final int UC_S390X_REG_F6 = 23;
public static final int UC_S390X_REG_F7 = 24;
public static final int UC_S390X_REG_F8 = 25;
public static final int UC_S390X_REG_F9 = 26;
public static final int UC_S390X_REG_F10 = 27;
public static final int UC_S390X_REG_F11 = 28;
public static final int UC_S390X_REG_F12 = 29;
public static final int UC_S390X_REG_F13 = 30;
public static final int UC_S390X_REG_F14 = 31;
public static final int UC_S390X_REG_F15 = 32;
public static final int UC_S390X_REG_F16 = 33;
public static final int UC_S390X_REG_F17 = 34;
public static final int UC_S390X_REG_F18 = 35;
public static final int UC_S390X_REG_F19 = 36;
public static final int UC_S390X_REG_F20 = 37;
public static final int UC_S390X_REG_F21 = 38;
public static final int UC_S390X_REG_F22 = 39;
public static final int UC_S390X_REG_F23 = 40;
public static final int UC_S390X_REG_F24 = 41;
public static final int UC_S390X_REG_F25 = 42;
public static final int UC_S390X_REG_F26 = 43;
public static final int UC_S390X_REG_F27 = 44;
public static final int UC_S390X_REG_F28 = 45;
public static final int UC_S390X_REG_F29 = 46;
public static final int UC_S390X_REG_F30 = 47;
public static final int UC_S390X_REG_F31 = 48;
// Access registers
public static final int UC_S390X_REG_A0 = 49;
public static final int UC_S390X_REG_A1 = 50;
public static final int UC_S390X_REG_A2 = 51;
public static final int UC_S390X_REG_A3 = 52;
public static final int UC_S390X_REG_A4 = 53;
public static final int UC_S390X_REG_A5 = 54;
public static final int UC_S390X_REG_A6 = 55;
public static final int UC_S390X_REG_A7 = 56;
public static final int UC_S390X_REG_A8 = 57;
public static final int UC_S390X_REG_A9 = 58;
public static final int UC_S390X_REG_A10 = 59;
public static final int UC_S390X_REG_A11 = 60;
public static final int UC_S390X_REG_A12 = 61;
public static final int UC_S390X_REG_A13 = 62;
public static final int UC_S390X_REG_A14 = 63;
public static final int UC_S390X_REG_A15 = 64;
public static final int UC_S390X_REG_PC = 65;
public static final int UC_S390X_REG_PSWM = 66;
public static final int UC_S390X_REG_ENDING = 67;
// Alias registers
}

View File

@ -4,6 +4,42 @@ package unicorn;
public interface SparcConst {
// SPARC32 CPU
public static final int UC_CPU_SPARC32_FUJITSU_MB86904 = 0;
public static final int UC_CPU_SPARC32_FUJITSU_MB86907 = 1;
public static final int UC_CPU_SPARC32_TI_MICROSPARC_I = 2;
public static final int UC_CPU_SPARC32_TI_MICROSPARC_II = 3;
public static final int UC_CPU_SPARC32_TI_MICROSPARC_IIEP = 4;
public static final int UC_CPU_SPARC32_TI_SUPERSPARC_40 = 5;
public static final int UC_CPU_SPARC32_TI_SUPERSPARC_50 = 6;
public static final int UC_CPU_SPARC32_TI_SUPERSPARC_51 = 7;
public static final int UC_CPU_SPARC32_TI_SUPERSPARC_60 = 8;
public static final int UC_CPU_SPARC32_TI_SUPERSPARC_61 = 9;
public static final int UC_CPU_SPARC32_TI_SUPERSPARC_II = 10;
public static final int UC_CPU_SPARC32_LEON2 = 11;
public static final int UC_CPU_SPARC32_LEON3 = 12;
// SPARC64 CPU
public static final int UC_CPU_SPARC64_FUJITSU = 0;
public static final int UC_CPU_SPARC64_FUJITSU_III = 1;
public static final int UC_CPU_SPARC64_FUJITSU_IV = 2;
public static final int UC_CPU_SPARC64_FUJITSU_V = 3;
public static final int UC_CPU_SPARC64_TI_ULTRASPARC_I = 4;
public static final int UC_CPU_SPARC64_TI_ULTRASPARC_II = 5;
public static final int UC_CPU_SPARC64_TI_ULTRASPARC_III = 6;
public static final int UC_CPU_SPARC64_TI_ULTRASPARC_IIE = 7;
public static final int UC_CPU_SPARC64_SUN_ULTRASPARC_III = 8;
public static final int UC_CPU_SPARC64_SUN_ULTRASPARC_III_CU = 9;
public static final int UC_CPU_SPARC64_SUN_ULTRASPARC_IIII = 10;
public static final int UC_CPU_SPARC64_SUN_ULTRASPARC_IV = 11;
public static final int UC_CPU_SPARC64_SUN_ULTRASPARC_IV_PLUS = 12;
public static final int UC_CPU_SPARC64_SUN_ULTRASPARC_IIII_PLUS = 13;
public static final int UC_CPU_SPARC64_SUN_ULTRASPARC_T1 = 14;
public static final int UC_CPU_SPARC64_SUN_ULTRASPARC_T2 = 15;
public static final int UC_CPU_SPARC64_NEC_ULTRASPARC_I = 16;
// SPARC registers
public static final int UC_SPARC_REG_INVALID = 0;

View File

@ -25,7 +25,7 @@ import java.util.*;
public class Unicorn implements UnicornConst, ArmConst, Arm64Const, M68kConst, SparcConst, MipsConst, X86Const {
private long eng;
public long eng;
private int arch;
private int mode;

View File

@ -3,13 +3,18 @@
package unicorn;
public interface UnicornConst {
public static final int UC_API_MAJOR = 1;
public static final int UC_API_MAJOR = 2;
public static final int UC_API_MINOR = 0;
public static final int UC_VERSION_MAJOR = 1;
public static final int UC_API_PATCH = 0;
public static final int UC_API_EXTRA = 5;
public static final int UC_VERSION_MAJOR = 2;
public static final int UC_VERSION_MINOR = 0;
public static final int UC_VERSION_EXTRA = 3;
public static final int UC_VERSION_PATCH = 0;
public static final int UC_VERSION_EXTRA = 5;
public static final int UC_SECOND_SCALE = 1000000;
public static final int UC_MILISECOND_SCALE = 1000;
public static final int UC_ARCH_ARM = 1;
@ -19,7 +24,9 @@ public interface UnicornConst {
public static final int UC_ARCH_PPC = 5;
public static final int UC_ARCH_SPARC = 6;
public static final int UC_ARCH_M68K = 7;
public static final int UC_ARCH_MAX = 8;
public static final int UC_ARCH_RISCV = 8;
public static final int UC_ARCH_S390X = 9;
public static final int UC_ARCH_MAX = 10;
public static final int UC_MODE_LITTLE_ENDIAN = 0;
public static final int UC_MODE_BIG_ENDIAN = 1073741824;
@ -31,7 +38,6 @@ public interface UnicornConst {
public static final int UC_MODE_ARM926 = 128;
public static final int UC_MODE_ARM946 = 256;
public static final int UC_MODE_ARM1176 = 512;
public static final int UC_MODE_ARMBE8 = 1024;
public static final int UC_MODE_MICRO = 16;
public static final int UC_MODE_MIPS3 = 32;
public static final int UC_MODE_MIPS32R6 = 64;
@ -46,6 +52,8 @@ public interface UnicornConst {
public static final int UC_MODE_SPARC32 = 4;
public static final int UC_MODE_SPARC64 = 8;
public static final int UC_MODE_V9 = 16;
public static final int UC_MODE_RISCV32 = 4;
public static final int UC_MODE_RISCV64 = 8;
public static final int UC_ERR_OK = 0;
public static final int UC_ERR_NOMEM = 1;
@ -79,6 +87,10 @@ public interface UnicornConst {
public static final int UC_MEM_READ_PROT = 23;
public static final int UC_MEM_FETCH_PROT = 24;
public static final int UC_MEM_READ_AFTER = 25;
public static final int UC_TCG_OP_SUB = 0;
public static final int UC_TCG_OP_FLAG_CMP = 1;
public static final int UC_TCG_OP_FLAG_DIRECT = 2;
public static final int UC_HOOK_INTR = 1;
public static final int UC_HOOK_INSN = 2;
public static final int UC_HOOK_CODE = 4;
@ -94,6 +106,8 @@ public interface UnicornConst {
public static final int UC_HOOK_MEM_FETCH = 4096;
public static final int UC_HOOK_MEM_READ_AFTER = 8192;
public static final int UC_HOOK_INSN_INVALID = 16384;
public static final int UC_HOOK_EDGE_GENERATED = 32768;
public static final int UC_HOOK_TCG_OPCODE = 65536;
public static final int UC_HOOK_MEM_UNMAPPED = 112;
public static final int UC_HOOK_MEM_PROT = 896;
public static final int UC_HOOK_MEM_READ_INVALID = 144;
@ -106,6 +120,22 @@ public interface UnicornConst {
public static final int UC_QUERY_ARCH = 3;
public static final int UC_QUERY_TIMEOUT = 4;
public static final int UC_CTL_IO_NONE = 0;
public static final int UC_CTL_IO_WRITE = 1;
public static final int UC_CTL_IO_READ = 2;
public static final int UC_CTL_IO_READ_WRITE = 3;
public static final int UC_CTL_UC_MODE = 0;
public static final int UC_CTL_UC_PAGE_SIZE = 1;
public static final int UC_CTL_UC_ARCH = 2;
public static final int UC_CTL_UC_TIMEOUT = 3;
public static final int UC_CTL_UC_USE_EXITS = 4;
public static final int UC_CTL_UC_EXITS_CNT = 5;
public static final int UC_CTL_UC_EXITS = 6;
public static final int UC_CTL_CPU_MODEL = 7;
public static final int UC_CTL_TB_REQUEST_CACHE = 8;
public static final int UC_CTL_TB_REMOVE_CACHE = 9;
public static final int UC_PROT_NONE = 0;
public static final int UC_PROT_READ = 1;
public static final int UC_PROT_WRITE = 2;

View File

@ -4,6 +4,47 @@ package unicorn;
public interface X86Const {
// X86 CPU
public static final int UC_CPU_X86_QEMU64 = 0;
public static final int UC_CPU_X86_PHENOM = 1;
public static final int UC_CPU_X86_CORE2DUO = 2;
public static final int UC_CPU_X86_KVM64 = 3;
public static final int UC_CPU_X86_QEMU32 = 4;
public static final int UC_CPU_X86_KVM32 = 5;
public static final int UC_CPU_X86_COREDUO = 6;
public static final int UC_CPU_X86_486 = 7;
public static final int UC_CPU_X86_PENTIUM = 8;
public static final int UC_CPU_X86_PENTIUM2 = 9;
public static final int UC_CPU_X86_PENTIUM3 = 10;
public static final int UC_CPU_X86_ATHLON = 11;
public static final int UC_CPU_X86_N270 = 12;
public static final int UC_CPU_X86_CONROE = 13;
public static final int UC_CPU_X86_PENRYN = 14;
public static final int UC_CPU_X86_NEHALEM = 15;
public static final int UC_CPU_X86_WESTMERE = 16;
public static final int UC_CPU_X86_SANDYBRIDGE = 17;
public static final int UC_CPU_X86_IVYBRIDGE = 18;
public static final int UC_CPU_X86_HASWELL = 19;
public static final int UC_CPU_X86_BROADWELL = 20;
public static final int UC_CPU_X86_SKYLAKE_CLIENT = 21;
public static final int UC_CPU_X86_SKYLAKE_SERVER = 22;
public static final int UC_CPU_X86_CASCADELAKE_SERVER = 23;
public static final int UC_CPU_X86_COOPERLAKE = 24;
public static final int UC_CPU_X86_ICELAKE_CLIENT = 25;
public static final int UC_CPU_X86_ICELAKE_SERVER = 26;
public static final int UC_CPU_X86_DENVERTON = 27;
public static final int UC_CPU_X86_SNOWRIDGE = 28;
public static final int UC_CPU_X86_KNIGHTSMILL = 29;
public static final int UC_CPU_X86_OPTERON_G1 = 30;
public static final int UC_CPU_X86_OPTERON_G2 = 31;
public static final int UC_CPU_X86_OPTERON_G3 = 32;
public static final int UC_CPU_X86_OPTERON_G4 = 33;
public static final int UC_CPU_X86_OPTERON_G5 = 34;
public static final int UC_CPU_X86_EPYC = 35;
public static final int UC_CPU_X86_DHYANA = 36;
public static final int UC_CPU_X86_EPYC_ROME = 37;
// X86 registers
public static final int UC_X86_REG_INVALID = 0;
@ -33,232 +74,219 @@ public interface X86Const {
public static final int UC_X86_REG_EDX = 24;
public static final int UC_X86_REG_EFLAGS = 25;
public static final int UC_X86_REG_EIP = 26;
public static final int UC_X86_REG_EIZ = 27;
public static final int UC_X86_REG_ES = 28;
public static final int UC_X86_REG_ESI = 29;
public static final int UC_X86_REG_ESP = 30;
public static final int UC_X86_REG_FPSW = 31;
public static final int UC_X86_REG_FS = 32;
public static final int UC_X86_REG_GS = 33;
public static final int UC_X86_REG_IP = 34;
public static final int UC_X86_REG_RAX = 35;
public static final int UC_X86_REG_RBP = 36;
public static final int UC_X86_REG_RBX = 37;
public static final int UC_X86_REG_RCX = 38;
public static final int UC_X86_REG_RDI = 39;
public static final int UC_X86_REG_RDX = 40;
public static final int UC_X86_REG_RIP = 41;
public static final int UC_X86_REG_RIZ = 42;
public static final int UC_X86_REG_RSI = 43;
public static final int UC_X86_REG_RSP = 44;
public static final int UC_X86_REG_SI = 45;
public static final int UC_X86_REG_SIL = 46;
public static final int UC_X86_REG_SP = 47;
public static final int UC_X86_REG_SPL = 48;
public static final int UC_X86_REG_SS = 49;
public static final int UC_X86_REG_CR0 = 50;
public static final int UC_X86_REG_CR1 = 51;
public static final int UC_X86_REG_CR2 = 52;
public static final int UC_X86_REG_CR3 = 53;
public static final int UC_X86_REG_CR4 = 54;
public static final int UC_X86_REG_CR5 = 55;
public static final int UC_X86_REG_CR6 = 56;
public static final int UC_X86_REG_CR7 = 57;
public static final int UC_X86_REG_CR8 = 58;
public static final int UC_X86_REG_CR9 = 59;
public static final int UC_X86_REG_CR10 = 60;
public static final int UC_X86_REG_CR11 = 61;
public static final int UC_X86_REG_CR12 = 62;
public static final int UC_X86_REG_CR13 = 63;
public static final int UC_X86_REG_CR14 = 64;
public static final int UC_X86_REG_CR15 = 65;
public static final int UC_X86_REG_DR0 = 66;
public static final int UC_X86_REG_DR1 = 67;
public static final int UC_X86_REG_DR2 = 68;
public static final int UC_X86_REG_DR3 = 69;
public static final int UC_X86_REG_DR4 = 70;
public static final int UC_X86_REG_DR5 = 71;
public static final int UC_X86_REG_DR6 = 72;
public static final int UC_X86_REG_DR7 = 73;
public static final int UC_X86_REG_DR8 = 74;
public static final int UC_X86_REG_DR9 = 75;
public static final int UC_X86_REG_DR10 = 76;
public static final int UC_X86_REG_DR11 = 77;
public static final int UC_X86_REG_DR12 = 78;
public static final int UC_X86_REG_DR13 = 79;
public static final int UC_X86_REG_DR14 = 80;
public static final int UC_X86_REG_DR15 = 81;
public static final int UC_X86_REG_FP0 = 82;
public static final int UC_X86_REG_FP1 = 83;
public static final int UC_X86_REG_FP2 = 84;
public static final int UC_X86_REG_FP3 = 85;
public static final int UC_X86_REG_FP4 = 86;
public static final int UC_X86_REG_FP5 = 87;
public static final int UC_X86_REG_FP6 = 88;
public static final int UC_X86_REG_FP7 = 89;
public static final int UC_X86_REG_K0 = 90;
public static final int UC_X86_REG_K1 = 91;
public static final int UC_X86_REG_K2 = 92;
public static final int UC_X86_REG_K3 = 93;
public static final int UC_X86_REG_K4 = 94;
public static final int UC_X86_REG_K5 = 95;
public static final int UC_X86_REG_K6 = 96;
public static final int UC_X86_REG_K7 = 97;
public static final int UC_X86_REG_MM0 = 98;
public static final int UC_X86_REG_MM1 = 99;
public static final int UC_X86_REG_MM2 = 100;
public static final int UC_X86_REG_MM3 = 101;
public static final int UC_X86_REG_MM4 = 102;
public static final int UC_X86_REG_MM5 = 103;
public static final int UC_X86_REG_MM6 = 104;
public static final int UC_X86_REG_MM7 = 105;
public static final int UC_X86_REG_R8 = 106;
public static final int UC_X86_REG_R9 = 107;
public static final int UC_X86_REG_R10 = 108;
public static final int UC_X86_REG_R11 = 109;
public static final int UC_X86_REG_R12 = 110;
public static final int UC_X86_REG_R13 = 111;
public static final int UC_X86_REG_R14 = 112;
public static final int UC_X86_REG_R15 = 113;
public static final int UC_X86_REG_ST0 = 114;
public static final int UC_X86_REG_ST1 = 115;
public static final int UC_X86_REG_ST2 = 116;
public static final int UC_X86_REG_ST3 = 117;
public static final int UC_X86_REG_ST4 = 118;
public static final int UC_X86_REG_ST5 = 119;
public static final int UC_X86_REG_ST6 = 120;
public static final int UC_X86_REG_ST7 = 121;
public static final int UC_X86_REG_XMM0 = 122;
public static final int UC_X86_REG_XMM1 = 123;
public static final int UC_X86_REG_XMM2 = 124;
public static final int UC_X86_REG_XMM3 = 125;
public static final int UC_X86_REG_XMM4 = 126;
public static final int UC_X86_REG_XMM5 = 127;
public static final int UC_X86_REG_XMM6 = 128;
public static final int UC_X86_REG_XMM7 = 129;
public static final int UC_X86_REG_XMM8 = 130;
public static final int UC_X86_REG_XMM9 = 131;
public static final int UC_X86_REG_XMM10 = 132;
public static final int UC_X86_REG_XMM11 = 133;
public static final int UC_X86_REG_XMM12 = 134;
public static final int UC_X86_REG_XMM13 = 135;
public static final int UC_X86_REG_XMM14 = 136;
public static final int UC_X86_REG_XMM15 = 137;
public static final int UC_X86_REG_XMM16 = 138;
public static final int UC_X86_REG_XMM17 = 139;
public static final int UC_X86_REG_XMM18 = 140;
public static final int UC_X86_REG_XMM19 = 141;
public static final int UC_X86_REG_XMM20 = 142;
public static final int UC_X86_REG_XMM21 = 143;
public static final int UC_X86_REG_XMM22 = 144;
public static final int UC_X86_REG_XMM23 = 145;
public static final int UC_X86_REG_XMM24 = 146;
public static final int UC_X86_REG_XMM25 = 147;
public static final int UC_X86_REG_XMM26 = 148;
public static final int UC_X86_REG_XMM27 = 149;
public static final int UC_X86_REG_XMM28 = 150;
public static final int UC_X86_REG_XMM29 = 151;
public static final int UC_X86_REG_XMM30 = 152;
public static final int UC_X86_REG_XMM31 = 153;
public static final int UC_X86_REG_YMM0 = 154;
public static final int UC_X86_REG_YMM1 = 155;
public static final int UC_X86_REG_YMM2 = 156;
public static final int UC_X86_REG_YMM3 = 157;
public static final int UC_X86_REG_YMM4 = 158;
public static final int UC_X86_REG_YMM5 = 159;
public static final int UC_X86_REG_YMM6 = 160;
public static final int UC_X86_REG_YMM7 = 161;
public static final int UC_X86_REG_YMM8 = 162;
public static final int UC_X86_REG_YMM9 = 163;
public static final int UC_X86_REG_YMM10 = 164;
public static final int UC_X86_REG_YMM11 = 165;
public static final int UC_X86_REG_YMM12 = 166;
public static final int UC_X86_REG_YMM13 = 167;
public static final int UC_X86_REG_YMM14 = 168;
public static final int UC_X86_REG_YMM15 = 169;
public static final int UC_X86_REG_YMM16 = 170;
public static final int UC_X86_REG_YMM17 = 171;
public static final int UC_X86_REG_YMM18 = 172;
public static final int UC_X86_REG_YMM19 = 173;
public static final int UC_X86_REG_YMM20 = 174;
public static final int UC_X86_REG_YMM21 = 175;
public static final int UC_X86_REG_YMM22 = 176;
public static final int UC_X86_REG_YMM23 = 177;
public static final int UC_X86_REG_YMM24 = 178;
public static final int UC_X86_REG_YMM25 = 179;
public static final int UC_X86_REG_YMM26 = 180;
public static final int UC_X86_REG_YMM27 = 181;
public static final int UC_X86_REG_YMM28 = 182;
public static final int UC_X86_REG_YMM29 = 183;
public static final int UC_X86_REG_YMM30 = 184;
public static final int UC_X86_REG_YMM31 = 185;
public static final int UC_X86_REG_ZMM0 = 186;
public static final int UC_X86_REG_ZMM1 = 187;
public static final int UC_X86_REG_ZMM2 = 188;
public static final int UC_X86_REG_ZMM3 = 189;
public static final int UC_X86_REG_ZMM4 = 190;
public static final int UC_X86_REG_ZMM5 = 191;
public static final int UC_X86_REG_ZMM6 = 192;
public static final int UC_X86_REG_ZMM7 = 193;
public static final int UC_X86_REG_ZMM8 = 194;
public static final int UC_X86_REG_ZMM9 = 195;
public static final int UC_X86_REG_ZMM10 = 196;
public static final int UC_X86_REG_ZMM11 = 197;
public static final int UC_X86_REG_ZMM12 = 198;
public static final int UC_X86_REG_ZMM13 = 199;
public static final int UC_X86_REG_ZMM14 = 200;
public static final int UC_X86_REG_ZMM15 = 201;
public static final int UC_X86_REG_ZMM16 = 202;
public static final int UC_X86_REG_ZMM17 = 203;
public static final int UC_X86_REG_ZMM18 = 204;
public static final int UC_X86_REG_ZMM19 = 205;
public static final int UC_X86_REG_ZMM20 = 206;
public static final int UC_X86_REG_ZMM21 = 207;
public static final int UC_X86_REG_ZMM22 = 208;
public static final int UC_X86_REG_ZMM23 = 209;
public static final int UC_X86_REG_ZMM24 = 210;
public static final int UC_X86_REG_ZMM25 = 211;
public static final int UC_X86_REG_ZMM26 = 212;
public static final int UC_X86_REG_ZMM27 = 213;
public static final int UC_X86_REG_ZMM28 = 214;
public static final int UC_X86_REG_ZMM29 = 215;
public static final int UC_X86_REG_ZMM30 = 216;
public static final int UC_X86_REG_ZMM31 = 217;
public static final int UC_X86_REG_R8B = 218;
public static final int UC_X86_REG_R9B = 219;
public static final int UC_X86_REG_R10B = 220;
public static final int UC_X86_REG_R11B = 221;
public static final int UC_X86_REG_R12B = 222;
public static final int UC_X86_REG_R13B = 223;
public static final int UC_X86_REG_R14B = 224;
public static final int UC_X86_REG_R15B = 225;
public static final int UC_X86_REG_R8D = 226;
public static final int UC_X86_REG_R9D = 227;
public static final int UC_X86_REG_R10D = 228;
public static final int UC_X86_REG_R11D = 229;
public static final int UC_X86_REG_R12D = 230;
public static final int UC_X86_REG_R13D = 231;
public static final int UC_X86_REG_R14D = 232;
public static final int UC_X86_REG_R15D = 233;
public static final int UC_X86_REG_R8W = 234;
public static final int UC_X86_REG_R9W = 235;
public static final int UC_X86_REG_R10W = 236;
public static final int UC_X86_REG_R11W = 237;
public static final int UC_X86_REG_R12W = 238;
public static final int UC_X86_REG_R13W = 239;
public static final int UC_X86_REG_R14W = 240;
public static final int UC_X86_REG_R15W = 241;
public static final int UC_X86_REG_IDTR = 242;
public static final int UC_X86_REG_GDTR = 243;
public static final int UC_X86_REG_LDTR = 244;
public static final int UC_X86_REG_TR = 245;
public static final int UC_X86_REG_FPCW = 246;
public static final int UC_X86_REG_FPTAG = 247;
public static final int UC_X86_REG_MSR = 248;
public static final int UC_X86_REG_MXCSR = 249;
public static final int UC_X86_REG_FS_BASE = 250;
public static final int UC_X86_REG_GS_BASE = 251;
public static final int UC_X86_REG_ENDING = 252;
public static final int UC_X86_REG_ES = 27;
public static final int UC_X86_REG_ESI = 28;
public static final int UC_X86_REG_ESP = 29;
public static final int UC_X86_REG_FPSW = 30;
public static final int UC_X86_REG_FS = 31;
public static final int UC_X86_REG_GS = 32;
public static final int UC_X86_REG_IP = 33;
public static final int UC_X86_REG_RAX = 34;
public static final int UC_X86_REG_RBP = 35;
public static final int UC_X86_REG_RBX = 36;
public static final int UC_X86_REG_RCX = 37;
public static final int UC_X86_REG_RDI = 38;
public static final int UC_X86_REG_RDX = 39;
public static final int UC_X86_REG_RIP = 40;
public static final int UC_X86_REG_RSI = 41;
public static final int UC_X86_REG_RSP = 42;
public static final int UC_X86_REG_SI = 43;
public static final int UC_X86_REG_SIL = 44;
public static final int UC_X86_REG_SP = 45;
public static final int UC_X86_REG_SPL = 46;
public static final int UC_X86_REG_SS = 47;
public static final int UC_X86_REG_CR0 = 48;
public static final int UC_X86_REG_CR1 = 49;
public static final int UC_X86_REG_CR2 = 50;
public static final int UC_X86_REG_CR3 = 51;
public static final int UC_X86_REG_CR4 = 52;
public static final int UC_X86_REG_CR8 = 53;
public static final int UC_X86_REG_DR0 = 54;
public static final int UC_X86_REG_DR1 = 55;
public static final int UC_X86_REG_DR2 = 56;
public static final int UC_X86_REG_DR3 = 57;
public static final int UC_X86_REG_DR4 = 58;
public static final int UC_X86_REG_DR5 = 59;
public static final int UC_X86_REG_DR6 = 60;
public static final int UC_X86_REG_DR7 = 61;
public static final int UC_X86_REG_FP0 = 62;
public static final int UC_X86_REG_FP1 = 63;
public static final int UC_X86_REG_FP2 = 64;
public static final int UC_X86_REG_FP3 = 65;
public static final int UC_X86_REG_FP4 = 66;
public static final int UC_X86_REG_FP5 = 67;
public static final int UC_X86_REG_FP6 = 68;
public static final int UC_X86_REG_FP7 = 69;
public static final int UC_X86_REG_K0 = 70;
public static final int UC_X86_REG_K1 = 71;
public static final int UC_X86_REG_K2 = 72;
public static final int UC_X86_REG_K3 = 73;
public static final int UC_X86_REG_K4 = 74;
public static final int UC_X86_REG_K5 = 75;
public static final int UC_X86_REG_K6 = 76;
public static final int UC_X86_REG_K7 = 77;
public static final int UC_X86_REG_MM0 = 78;
public static final int UC_X86_REG_MM1 = 79;
public static final int UC_X86_REG_MM2 = 80;
public static final int UC_X86_REG_MM3 = 81;
public static final int UC_X86_REG_MM4 = 82;
public static final int UC_X86_REG_MM5 = 83;
public static final int UC_X86_REG_MM6 = 84;
public static final int UC_X86_REG_MM7 = 85;
public static final int UC_X86_REG_R8 = 86;
public static final int UC_X86_REG_R9 = 87;
public static final int UC_X86_REG_R10 = 88;
public static final int UC_X86_REG_R11 = 89;
public static final int UC_X86_REG_R12 = 90;
public static final int UC_X86_REG_R13 = 91;
public static final int UC_X86_REG_R14 = 92;
public static final int UC_X86_REG_R15 = 93;
public static final int UC_X86_REG_ST0 = 94;
public static final int UC_X86_REG_ST1 = 95;
public static final int UC_X86_REG_ST2 = 96;
public static final int UC_X86_REG_ST3 = 97;
public static final int UC_X86_REG_ST4 = 98;
public static final int UC_X86_REG_ST5 = 99;
public static final int UC_X86_REG_ST6 = 100;
public static final int UC_X86_REG_ST7 = 101;
public static final int UC_X86_REG_XMM0 = 102;
public static final int UC_X86_REG_XMM1 = 103;
public static final int UC_X86_REG_XMM2 = 104;
public static final int UC_X86_REG_XMM3 = 105;
public static final int UC_X86_REG_XMM4 = 106;
public static final int UC_X86_REG_XMM5 = 107;
public static final int UC_X86_REG_XMM6 = 108;
public static final int UC_X86_REG_XMM7 = 109;
public static final int UC_X86_REG_XMM8 = 110;
public static final int UC_X86_REG_XMM9 = 111;
public static final int UC_X86_REG_XMM10 = 112;
public static final int UC_X86_REG_XMM11 = 113;
public static final int UC_X86_REG_XMM12 = 114;
public static final int UC_X86_REG_XMM13 = 115;
public static final int UC_X86_REG_XMM14 = 116;
public static final int UC_X86_REG_XMM15 = 117;
public static final int UC_X86_REG_XMM16 = 118;
public static final int UC_X86_REG_XMM17 = 119;
public static final int UC_X86_REG_XMM18 = 120;
public static final int UC_X86_REG_XMM19 = 121;
public static final int UC_X86_REG_XMM20 = 122;
public static final int UC_X86_REG_XMM21 = 123;
public static final int UC_X86_REG_XMM22 = 124;
public static final int UC_X86_REG_XMM23 = 125;
public static final int UC_X86_REG_XMM24 = 126;
public static final int UC_X86_REG_XMM25 = 127;
public static final int UC_X86_REG_XMM26 = 128;
public static final int UC_X86_REG_XMM27 = 129;
public static final int UC_X86_REG_XMM28 = 130;
public static final int UC_X86_REG_XMM29 = 131;
public static final int UC_X86_REG_XMM30 = 132;
public static final int UC_X86_REG_XMM31 = 133;
public static final int UC_X86_REG_YMM0 = 134;
public static final int UC_X86_REG_YMM1 = 135;
public static final int UC_X86_REG_YMM2 = 136;
public static final int UC_X86_REG_YMM3 = 137;
public static final int UC_X86_REG_YMM4 = 138;
public static final int UC_X86_REG_YMM5 = 139;
public static final int UC_X86_REG_YMM6 = 140;
public static final int UC_X86_REG_YMM7 = 141;
public static final int UC_X86_REG_YMM8 = 142;
public static final int UC_X86_REG_YMM9 = 143;
public static final int UC_X86_REG_YMM10 = 144;
public static final int UC_X86_REG_YMM11 = 145;
public static final int UC_X86_REG_YMM12 = 146;
public static final int UC_X86_REG_YMM13 = 147;
public static final int UC_X86_REG_YMM14 = 148;
public static final int UC_X86_REG_YMM15 = 149;
public static final int UC_X86_REG_YMM16 = 150;
public static final int UC_X86_REG_YMM17 = 151;
public static final int UC_X86_REG_YMM18 = 152;
public static final int UC_X86_REG_YMM19 = 153;
public static final int UC_X86_REG_YMM20 = 154;
public static final int UC_X86_REG_YMM21 = 155;
public static final int UC_X86_REG_YMM22 = 156;
public static final int UC_X86_REG_YMM23 = 157;
public static final int UC_X86_REG_YMM24 = 158;
public static final int UC_X86_REG_YMM25 = 159;
public static final int UC_X86_REG_YMM26 = 160;
public static final int UC_X86_REG_YMM27 = 161;
public static final int UC_X86_REG_YMM28 = 162;
public static final int UC_X86_REG_YMM29 = 163;
public static final int UC_X86_REG_YMM30 = 164;
public static final int UC_X86_REG_YMM31 = 165;
public static final int UC_X86_REG_ZMM0 = 166;
public static final int UC_X86_REG_ZMM1 = 167;
public static final int UC_X86_REG_ZMM2 = 168;
public static final int UC_X86_REG_ZMM3 = 169;
public static final int UC_X86_REG_ZMM4 = 170;
public static final int UC_X86_REG_ZMM5 = 171;
public static final int UC_X86_REG_ZMM6 = 172;
public static final int UC_X86_REG_ZMM7 = 173;
public static final int UC_X86_REG_ZMM8 = 174;
public static final int UC_X86_REG_ZMM9 = 175;
public static final int UC_X86_REG_ZMM10 = 176;
public static final int UC_X86_REG_ZMM11 = 177;
public static final int UC_X86_REG_ZMM12 = 178;
public static final int UC_X86_REG_ZMM13 = 179;
public static final int UC_X86_REG_ZMM14 = 180;
public static final int UC_X86_REG_ZMM15 = 181;
public static final int UC_X86_REG_ZMM16 = 182;
public static final int UC_X86_REG_ZMM17 = 183;
public static final int UC_X86_REG_ZMM18 = 184;
public static final int UC_X86_REG_ZMM19 = 185;
public static final int UC_X86_REG_ZMM20 = 186;
public static final int UC_X86_REG_ZMM21 = 187;
public static final int UC_X86_REG_ZMM22 = 188;
public static final int UC_X86_REG_ZMM23 = 189;
public static final int UC_X86_REG_ZMM24 = 190;
public static final int UC_X86_REG_ZMM25 = 191;
public static final int UC_X86_REG_ZMM26 = 192;
public static final int UC_X86_REG_ZMM27 = 193;
public static final int UC_X86_REG_ZMM28 = 194;
public static final int UC_X86_REG_ZMM29 = 195;
public static final int UC_X86_REG_ZMM30 = 196;
public static final int UC_X86_REG_ZMM31 = 197;
public static final int UC_X86_REG_R8B = 198;
public static final int UC_X86_REG_R9B = 199;
public static final int UC_X86_REG_R10B = 200;
public static final int UC_X86_REG_R11B = 201;
public static final int UC_X86_REG_R12B = 202;
public static final int UC_X86_REG_R13B = 203;
public static final int UC_X86_REG_R14B = 204;
public static final int UC_X86_REG_R15B = 205;
public static final int UC_X86_REG_R8D = 206;
public static final int UC_X86_REG_R9D = 207;
public static final int UC_X86_REG_R10D = 208;
public static final int UC_X86_REG_R11D = 209;
public static final int UC_X86_REG_R12D = 210;
public static final int UC_X86_REG_R13D = 211;
public static final int UC_X86_REG_R14D = 212;
public static final int UC_X86_REG_R15D = 213;
public static final int UC_X86_REG_R8W = 214;
public static final int UC_X86_REG_R9W = 215;
public static final int UC_X86_REG_R10W = 216;
public static final int UC_X86_REG_R11W = 217;
public static final int UC_X86_REG_R12W = 218;
public static final int UC_X86_REG_R13W = 219;
public static final int UC_X86_REG_R14W = 220;
public static final int UC_X86_REG_R15W = 221;
public static final int UC_X86_REG_IDTR = 222;
public static final int UC_X86_REG_GDTR = 223;
public static final int UC_X86_REG_LDTR = 224;
public static final int UC_X86_REG_TR = 225;
public static final int UC_X86_REG_FPCW = 226;
public static final int UC_X86_REG_FPTAG = 227;
public static final int UC_X86_REG_MSR = 228;
public static final int UC_X86_REG_MXCSR = 229;
public static final int UC_X86_REG_FS_BASE = 230;
public static final int UC_X86_REG_GS_BASE = 231;
public static final int UC_X86_REG_FLAGS = 232;
public static final int UC_X86_REG_RFLAGS = 233;
public static final int UC_X86_REG_FIP = 234;
public static final int UC_X86_REG_FCS = 235;
public static final int UC_X86_REG_FDP = 236;
public static final int UC_X86_REG_FDS = 237;
public static final int UC_X86_REG_FOP = 238;
public static final int UC_X86_REG_ENDING = 239;
// X86 instructions

View File

@ -5,6 +5,13 @@ unit Arm64Const;
interface
const
// ARM64 CPU
UC_CPU_AARCH64_A57 = 0;
UC_CPU_AARCH64_A53 = 1;
UC_CPU_AARCH64_A72 = 2;
UC_CPU_AARCH64_MAX = 3;
// ARM64 registers
UC_ARM64_REG_INVALID = 0;

View File

@ -5,6 +5,43 @@ unit ArmConst;
interface
const
// ARM CPU
UC_CPU_ARM_926 = 0;
UC_CPU_ARM_946 = 1;
UC_CPU_ARM_1026 = 2;
UC_CPU_ARM_1136_R2 = 3;
UC_CPU_ARM_1136 = 4;
UC_CPU_ARM_1176 = 5;
UC_CPU_ARM_11MPCORE = 6;
UC_CPU_ARM_CORTEX_M0 = 7;
UC_CPU_ARM_CORTEX_M3 = 8;
UC_CPU_ARM_CORTEX_M4 = 9;
UC_CPU_ARM_CORTEX_M7 = 10;
UC_CPU_ARM_CORTEX_M33 = 11;
UC_CPU_ARM_CORTEX_R5 = 12;
UC_CPU_ARM_CORTEX_R5F = 13;
UC_CPU_ARM_CORTEX_A7 = 14;
UC_CPU_ARM_CORTEX_A8 = 15;
UC_CPU_ARM_CORTEX_A9 = 16;
UC_CPU_ARM_CORTEX_A15 = 17;
UC_CPU_ARM_TI925T = 18;
UC_CPU_ARM_SA1100 = 19;
UC_CPU_ARM_SA1110 = 20;
UC_CPU_ARM_PXA250 = 21;
UC_CPU_ARM_PXA255 = 22;
UC_CPU_ARM_PXA260 = 23;
UC_CPU_ARM_PXA261 = 24;
UC_CPU_ARM_PXA262 = 25;
UC_CPU_ARM_PXA270 = 26;
UC_CPU_ARM_PXA270A0 = 27;
UC_CPU_ARM_PXA270A1 = 28;
UC_CPU_ARM_PXA270B0 = 29;
UC_CPU_ARM_PXA270B1 = 30;
UC_CPU_ARM_PXA270C0 = 31;
UC_CPU_ARM_PXA270C5 = 32;
UC_CPU_ARM_MAX = 33;
// ARM registers
UC_ARM_REG_INVALID = 0;
@ -125,7 +162,28 @@ const
UC_ARM_REG_MSP = 115;
UC_ARM_REG_PSP = 116;
UC_ARM_REG_CONTROL = 117;
UC_ARM_REG_ENDING = 118;
UC_ARM_REG_IAPSR = 118;
UC_ARM_REG_EAPSR = 119;
UC_ARM_REG_XPSR = 120;
UC_ARM_REG_EPSR = 121;
UC_ARM_REG_IEPSR = 122;
UC_ARM_REG_PRIMASK = 123;
UC_ARM_REG_BASEPRI = 124;
UC_ARM_REG_BASEPRI_MAX = 125;
UC_ARM_REG_FAULTMASK = 126;
UC_ARM_REG_APSR_NZCVQ = 127;
UC_ARM_REG_APSR_G = 128;
UC_ARM_REG_APSR_NZCVQG = 129;
UC_ARM_REG_IAPSR_NZCVQ = 130;
UC_ARM_REG_IAPSR_G = 131;
UC_ARM_REG_IAPSR_NZCVQG = 132;
UC_ARM_REG_EAPSR_NZCVQ = 133;
UC_ARM_REG_EAPSR_G = 134;
UC_ARM_REG_EAPSR_NZCVQG = 135;
UC_ARM_REG_XPSR_NZCVQ = 136;
UC_ARM_REG_XPSR_G = 137;
UC_ARM_REG_XPSR_NZCVQG = 138;
UC_ARM_REG_ENDING = 139;
// alias registers
UC_ARM_REG_R13 = 12;

View File

@ -5,6 +5,18 @@ unit M68kConst;
interface
const
// M68K CPU
UC_CPU_M68K_M5206 = 0;
UC_CPU_M68K_M68000 = 1;
UC_CPU_M68K_M68020 = 2;
UC_CPU_M68K_M68030 = 3;
UC_CPU_M68K_M68040 = 4;
UC_CPU_M68K_M68060 = 5;
UC_CPU_M68K_M5208 = 6;
UC_CPU_M68K_CFV4E = 7;
UC_CPU_M68K_ANY = 8;
// M68K registers
UC_M68K_REG_INVALID = 0;

View File

@ -5,6 +5,41 @@ unit MipsConst;
interface
const
// MIPS32 CPUS
UC_CPU_MIPS32_4KC = 0;
UC_CPU_MIPS32_4KM = 1;
UC_CPU_MIPS32_4KECR1 = 2;
UC_CPU_MIPS32_4KEMR1 = 3;
UC_CPU_MIPS32_4KEC = 4;
UC_CPU_MIPS32_4KEM = 5;
UC_CPU_MIPS32_24KC = 6;
UC_CPU_MIPS32_24KEC = 7;
UC_CPU_MIPS32_24KF = 8;
UC_CPU_MIPS32_34KF = 9;
UC_CPU_MIPS32_74KF = 10;
UC_CPU_MIPS32_M14K = 11;
UC_CPU_MIPS32_M14KC = 12;
UC_CPU_MIPS32_P5600 = 13;
UC_CPU_MIPS32_MIPS32R6_GENERIC = 14;
UC_CPU_MIPS32_I7200 = 15;
// MIPS64 CPUS
UC_CPU_MIPS64_R4000 = 0;
UC_CPU_MIPS64_VR5432 = 1;
UC_CPU_MIPS64_5KC = 2;
UC_CPU_MIPS64_5KF = 3;
UC_CPU_MIPS64_20KC = 4;
UC_CPU_MIPS64_MIPS64R2_GENERIC = 5;
UC_CPU_MIPS64_5KEC = 6;
UC_CPU_MIPS64_5KEF = 7;
UC_CPU_MIPS64_I6400 = 8;
UC_CPU_MIPS64_I6500 = 9;
UC_CPU_MIPS64_LOONGSON_2E = 10;
UC_CPU_MIPS64_LOONGSON_2F = 11;
UC_CPU_MIPS64_MIPS64DSPR2 = 12;
// MIPS registers
UC_MIPS_REG_INVALID = 0;
@ -158,7 +193,8 @@ const
UC_MIPS_REG_MPL2 = 136;
UC_MIPS_REG_CP0_CONFIG3 = 137;
UC_MIPS_REG_CP0_USERLOCAL = 138;
UC_MIPS_REG_ENDING = 139;
UC_MIPS_REG_CP0_STATUS = 139;
UC_MIPS_REG_ENDING = 140;
UC_MIPS_REG_ZERO = 2;
UC_MIPS_REG_AT = 3;
UC_MIPS_REG_V0 = 4;

View File

@ -0,0 +1,408 @@
// For Unicorn Engine. AUTO-GENERATED FILE, DO NOT EDIT
unit PpcConst;
interface
const
// PPC CPU
UC_CPU_PPC_401 = 0;
UC_CPU_PPC_401A1 = 1;
UC_CPU_PPC_401B2 = 2;
UC_CPU_PPC_401C2 = 3;
UC_CPU_PPC_401D2 = 4;
UC_CPU_PPC_401E2 = 5;
UC_CPU_PPC_401F2 = 6;
UC_CPU_PPC_401G2 = 7;
UC_CPU_PPC_IOP480 = 8;
UC_CPU_PPC_COBRA = 9;
UC_CPU_PPC_403GA = 10;
UC_CPU_PPC_403GB = 11;
UC_CPU_PPC_403GC = 12;
UC_CPU_PPC_403GCX = 13;
UC_CPU_PPC_405D2 = 14;
UC_CPU_PPC_405D4 = 15;
UC_CPU_PPC_405CRA = 16;
UC_CPU_PPC_405CRB = 17;
UC_CPU_PPC_405CRC = 18;
UC_CPU_PPC_405EP = 19;
UC_CPU_PPC_405EZ = 20;
UC_CPU_PPC_405GPA = 21;
UC_CPU_PPC_405GPB = 22;
UC_CPU_PPC_405GPC = 23;
UC_CPU_PPC_405GPD = 24;
UC_CPU_PPC_405GPR = 25;
UC_CPU_PPC_405LP = 26;
UC_CPU_PPC_NPE405H = 27;
UC_CPU_PPC_NPE405H2 = 28;
UC_CPU_PPC_NPE405L = 29;
UC_CPU_PPC_NPE4GS3 = 30;
UC_CPU_PPC_STB03 = 31;
UC_CPU_PPC_STB04 = 32;
UC_CPU_PPC_STB25 = 33;
UC_CPU_PPC_X2VP4 = 34;
UC_CPU_PPC_X2VP20 = 35;
UC_CPU_PPC_440_XILINX = 36;
UC_CPU_PPC_440_XILINX_W_DFPU = 37;
UC_CPU_PPC_440EPA = 38;
UC_CPU_PPC_440EPB = 39;
UC_CPU_PPC_440EPX = 40;
UC_CPU_PPC_460EXB = 41;
UC_CPU_PPC_G2 = 42;
UC_CPU_PPC_G2H4 = 43;
UC_CPU_PPC_G2GP = 44;
UC_CPU_PPC_G2LS = 45;
UC_CPU_PPC_G2HIP3 = 46;
UC_CPU_PPC_G2HIP4 = 47;
UC_CPU_PPC_MPC603 = 48;
UC_CPU_PPC_G2LE = 49;
UC_CPU_PPC_G2LEGP = 50;
UC_CPU_PPC_G2LELS = 51;
UC_CPU_PPC_G2LEGP1 = 52;
UC_CPU_PPC_G2LEGP3 = 53;
UC_CPU_PPC_MPC5200_V10 = 54;
UC_CPU_PPC_MPC5200_V11 = 55;
UC_CPU_PPC_MPC5200_V12 = 56;
UC_CPU_PPC_MPC5200B_V20 = 57;
UC_CPU_PPC_MPC5200B_V21 = 58;
UC_CPU_PPC_E200Z5 = 59;
UC_CPU_PPC_E200Z6 = 60;
UC_CPU_PPC_E300C1 = 61;
UC_CPU_PPC_E300C2 = 62;
UC_CPU_PPC_E300C3 = 63;
UC_CPU_PPC_E300C4 = 64;
UC_CPU_PPC_MPC8343 = 65;
UC_CPU_PPC_MPC8343A = 66;
UC_CPU_PPC_MPC8343E = 67;
UC_CPU_PPC_MPC8343EA = 68;
UC_CPU_PPC_MPC8347T = 69;
UC_CPU_PPC_MPC8347P = 70;
UC_CPU_PPC_MPC8347AT = 71;
UC_CPU_PPC_MPC8347AP = 72;
UC_CPU_PPC_MPC8347ET = 73;
UC_CPU_PPC_MPC8347EP = 74;
UC_CPU_PPC_MPC8347EAT = 75;
UC_CPU_PPC_MPC8347EAP = 76;
UC_CPU_PPC_MPC8349 = 77;
UC_CPU_PPC_MPC8349A = 78;
UC_CPU_PPC_MPC8349E = 79;
UC_CPU_PPC_MPC8349EA = 80;
UC_CPU_PPC_MPC8377 = 81;
UC_CPU_PPC_MPC8377E = 82;
UC_CPU_PPC_MPC8378 = 83;
UC_CPU_PPC_MPC8378E = 84;
UC_CPU_PPC_MPC8379 = 85;
UC_CPU_PPC_MPC8379E = 86;
UC_CPU_PPC_E500_V10 = 87;
UC_CPU_PPC_E500_V20 = 88;
UC_CPU_PPC_E500V2_V10 = 89;
UC_CPU_PPC_E500V2_V20 = 90;
UC_CPU_PPC_E500V2_V21 = 91;
UC_CPU_PPC_E500V2_V22 = 92;
UC_CPU_PPC_E500V2_V30 = 93;
UC_CPU_PPC_E500MC = 94;
UC_CPU_PPC_MPC8533_V10 = 95;
UC_CPU_PPC_MPC8533_V11 = 96;
UC_CPU_PPC_MPC8533E_V10 = 97;
UC_CPU_PPC_MPC8533E_V11 = 98;
UC_CPU_PPC_MPC8540_V10 = 99;
UC_CPU_PPC_MPC8540_V20 = 100;
UC_CPU_PPC_MPC8540_V21 = 101;
UC_CPU_PPC_MPC8541_V10 = 102;
UC_CPU_PPC_MPC8541_V11 = 103;
UC_CPU_PPC_MPC8541E_V10 = 104;
UC_CPU_PPC_MPC8541E_V11 = 105;
UC_CPU_PPC_MPC8543_V10 = 106;
UC_CPU_PPC_MPC8543_V11 = 107;
UC_CPU_PPC_MPC8543_V20 = 108;
UC_CPU_PPC_MPC8543_V21 = 109;
UC_CPU_PPC_MPC8543E_V10 = 110;
UC_CPU_PPC_MPC8543E_V11 = 111;
UC_CPU_PPC_MPC8543E_V20 = 112;
UC_CPU_PPC_MPC8543E_V21 = 113;
UC_CPU_PPC_MPC8544_V10 = 114;
UC_CPU_PPC_MPC8544_V11 = 115;
UC_CPU_PPC_MPC8544E_V10 = 116;
UC_CPU_PPC_MPC8544E_V11 = 117;
UC_CPU_PPC_MPC8545_V20 = 118;
UC_CPU_PPC_MPC8545_V21 = 119;
UC_CPU_PPC_MPC8545E_V20 = 120;
UC_CPU_PPC_MPC8545E_V21 = 121;
UC_CPU_PPC_MPC8547E_V20 = 122;
UC_CPU_PPC_MPC8547E_V21 = 123;
UC_CPU_PPC_MPC8548_V10 = 124;
UC_CPU_PPC_MPC8548_V11 = 125;
UC_CPU_PPC_MPC8548_V20 = 126;
UC_CPU_PPC_MPC8548_V21 = 127;
UC_CPU_PPC_MPC8548E_V10 = 128;
UC_CPU_PPC_MPC8548E_V11 = 129;
UC_CPU_PPC_MPC8548E_V20 = 130;
UC_CPU_PPC_MPC8548E_V21 = 131;
UC_CPU_PPC_MPC8555_V10 = 132;
UC_CPU_PPC_MPC8555_V11 = 133;
UC_CPU_PPC_MPC8555E_V10 = 134;
UC_CPU_PPC_MPC8555E_V11 = 135;
UC_CPU_PPC_MPC8560_V10 = 136;
UC_CPU_PPC_MPC8560_V20 = 137;
UC_CPU_PPC_MPC8560_V21 = 138;
UC_CPU_PPC_MPC8567 = 139;
UC_CPU_PPC_MPC8567E = 140;
UC_CPU_PPC_MPC8568 = 141;
UC_CPU_PPC_MPC8568E = 142;
UC_CPU_PPC_MPC8572 = 143;
UC_CPU_PPC_MPC8572E = 144;
UC_CPU_PPC_E600 = 145;
UC_CPU_PPC_MPC8610 = 146;
UC_CPU_PPC_MPC8641 = 147;
UC_CPU_PPC_MPC8641D = 148;
UC_CPU_PPC_601_V0 = 149;
UC_CPU_PPC_601_V1 = 150;
UC_CPU_PPC_601_V2 = 151;
UC_CPU_PPC_602 = 152;
UC_CPU_PPC_603 = 153;
UC_CPU_PPC_603E_V1_1 = 154;
UC_CPU_PPC_603E_V1_2 = 155;
UC_CPU_PPC_603E_V1_3 = 156;
UC_CPU_PPC_603E_V1_4 = 157;
UC_CPU_PPC_603E_V2_2 = 158;
UC_CPU_PPC_603E_V3 = 159;
UC_CPU_PPC_603E_V4 = 160;
UC_CPU_PPC_603E_V4_1 = 161;
UC_CPU_PPC_603E7 = 162;
UC_CPU_PPC_603E7T = 163;
UC_CPU_PPC_603E7V = 164;
UC_CPU_PPC_603E7V1 = 165;
UC_CPU_PPC_603E7V2 = 166;
UC_CPU_PPC_603P = 167;
UC_CPU_PPC_604 = 168;
UC_CPU_PPC_604E_V1_0 = 169;
UC_CPU_PPC_604E_V2_2 = 170;
UC_CPU_PPC_604E_V2_4 = 171;
UC_CPU_PPC_604R = 172;
UC_CPU_PPC_740_V1_0 = 173;
UC_CPU_PPC_750_V1_0 = 174;
UC_CPU_PPC_740_V2_0 = 175;
UC_CPU_PPC_750_V2_0 = 176;
UC_CPU_PPC_740_V2_1 = 177;
UC_CPU_PPC_750_V2_1 = 178;
UC_CPU_PPC_740_V2_2 = 179;
UC_CPU_PPC_750_V2_2 = 180;
UC_CPU_PPC_740_V3_0 = 181;
UC_CPU_PPC_750_V3_0 = 182;
UC_CPU_PPC_740_V3_1 = 183;
UC_CPU_PPC_750_V3_1 = 184;
UC_CPU_PPC_740E = 185;
UC_CPU_PPC_750E = 186;
UC_CPU_PPC_740P = 187;
UC_CPU_PPC_750P = 188;
UC_CPU_PPC_750CL_V1_0 = 189;
UC_CPU_PPC_750CL_V2_0 = 190;
UC_CPU_PPC_750CX_V1_0 = 191;
UC_CPU_PPC_750CX_V2_0 = 192;
UC_CPU_PPC_750CX_V2_1 = 193;
UC_CPU_PPC_750CX_V2_2 = 194;
UC_CPU_PPC_750CXE_V2_1 = 195;
UC_CPU_PPC_750CXE_V2_2 = 196;
UC_CPU_PPC_750CXE_V2_3 = 197;
UC_CPU_PPC_750CXE_V2_4 = 198;
UC_CPU_PPC_750CXE_V2_4B = 199;
UC_CPU_PPC_750CXE_V3_0 = 200;
UC_CPU_PPC_750CXE_V3_1 = 201;
UC_CPU_PPC_750CXE_V3_1B = 202;
UC_CPU_PPC_750CXR = 203;
UC_CPU_PPC_750FL = 204;
UC_CPU_PPC_750FX_V1_0 = 205;
UC_CPU_PPC_750FX_V2_0 = 206;
UC_CPU_PPC_750FX_V2_1 = 207;
UC_CPU_PPC_750FX_V2_2 = 208;
UC_CPU_PPC_750FX_V2_3 = 209;
UC_CPU_PPC_750GL = 210;
UC_CPU_PPC_750GX_V1_0 = 211;
UC_CPU_PPC_750GX_V1_1 = 212;
UC_CPU_PPC_750GX_V1_2 = 213;
UC_CPU_PPC_750L_V2_0 = 214;
UC_CPU_PPC_750L_V2_1 = 215;
UC_CPU_PPC_750L_V2_2 = 216;
UC_CPU_PPC_750L_V3_0 = 217;
UC_CPU_PPC_750L_V3_2 = 218;
UC_CPU_PPC_745_V1_0 = 219;
UC_CPU_PPC_755_V1_0 = 220;
UC_CPU_PPC_745_V1_1 = 221;
UC_CPU_PPC_755_V1_1 = 222;
UC_CPU_PPC_745_V2_0 = 223;
UC_CPU_PPC_755_V2_0 = 224;
UC_CPU_PPC_745_V2_1 = 225;
UC_CPU_PPC_755_V2_1 = 226;
UC_CPU_PPC_745_V2_2 = 227;
UC_CPU_PPC_755_V2_2 = 228;
UC_CPU_PPC_745_V2_3 = 229;
UC_CPU_PPC_755_V2_3 = 230;
UC_CPU_PPC_745_V2_4 = 231;
UC_CPU_PPC_755_V2_4 = 232;
UC_CPU_PPC_745_V2_5 = 233;
UC_CPU_PPC_755_V2_5 = 234;
UC_CPU_PPC_745_V2_6 = 235;
UC_CPU_PPC_755_V2_6 = 236;
UC_CPU_PPC_745_V2_7 = 237;
UC_CPU_PPC_755_V2_7 = 238;
UC_CPU_PPC_745_V2_8 = 239;
UC_CPU_PPC_755_V2_8 = 240;
UC_CPU_PPC_7400_V1_0 = 241;
UC_CPU_PPC_7400_V1_1 = 242;
UC_CPU_PPC_7400_V2_0 = 243;
UC_CPU_PPC_7400_V2_1 = 244;
UC_CPU_PPC_7400_V2_2 = 245;
UC_CPU_PPC_7400_V2_6 = 246;
UC_CPU_PPC_7400_V2_7 = 247;
UC_CPU_PPC_7400_V2_8 = 248;
UC_CPU_PPC_7400_V2_9 = 249;
UC_CPU_PPC_7410_V1_0 = 250;
UC_CPU_PPC_7410_V1_1 = 251;
UC_CPU_PPC_7410_V1_2 = 252;
UC_CPU_PPC_7410_V1_3 = 253;
UC_CPU_PPC_7410_V1_4 = 254;
UC_CPU_PPC_7448_V1_0 = 255;
UC_CPU_PPC_7448_V1_1 = 256;
UC_CPU_PPC_7448_V2_0 = 257;
UC_CPU_PPC_7448_V2_1 = 258;
UC_CPU_PPC_7450_V1_0 = 259;
UC_CPU_PPC_7450_V1_1 = 260;
UC_CPU_PPC_7450_V1_2 = 261;
UC_CPU_PPC_7450_V2_0 = 262;
UC_CPU_PPC_7450_V2_1 = 263;
UC_CPU_PPC_7441_V2_1 = 264;
UC_CPU_PPC_7441_V2_3 = 265;
UC_CPU_PPC_7451_V2_3 = 266;
UC_CPU_PPC_7441_V2_10 = 267;
UC_CPU_PPC_7451_V2_10 = 268;
UC_CPU_PPC_7445_V1_0 = 269;
UC_CPU_PPC_7455_V1_0 = 270;
UC_CPU_PPC_7445_V2_1 = 271;
UC_CPU_PPC_7455_V2_1 = 272;
UC_CPU_PPC_7445_V3_2 = 273;
UC_CPU_PPC_7455_V3_2 = 274;
UC_CPU_PPC_7445_V3_3 = 275;
UC_CPU_PPC_7455_V3_3 = 276;
UC_CPU_PPC_7445_V3_4 = 277;
UC_CPU_PPC_7455_V3_4 = 278;
UC_CPU_PPC_7447_V1_0 = 279;
UC_CPU_PPC_7457_V1_0 = 280;
UC_CPU_PPC_7447_V1_1 = 281;
UC_CPU_PPC_7457_V1_1 = 282;
UC_CPU_PPC_7457_V1_2 = 283;
UC_CPU_PPC_7447A_V1_0 = 284;
UC_CPU_PPC_7457A_V1_0 = 285;
UC_CPU_PPC_7447A_V1_1 = 286;
UC_CPU_PPC_7457A_V1_1 = 287;
UC_CPU_PPC_7447A_V1_2 = 288;
UC_CPU_PPC_7457A_V1_2 = 289;
// PPC64 CPU
UC_CPU_PPC_E5500 = 0;
UC_CPU_PPC_E6500 = 1;
UC_CPU_PPC_970_V2_2 = 2;
UC_CPU_PPC_970FX_V1_0 = 3;
UC_CPU_PPC_970FX_V2_0 = 4;
UC_CPU_PPC_970FX_V2_1 = 5;
UC_CPU_PPC_970FX_V3_0 = 6;
UC_CPU_PPC_970FX_V3_1 = 7;
UC_CPU_PPC_970MP_V1_0 = 8;
UC_CPU_PPC_970MP_V1_1 = 9;
UC_CPU_PPC_POWER5_V2_1 = 10;
UC_CPU_PPC_POWER7_V2_3 = 11;
UC_CPU_PPC_POWER7_V2_1 = 12;
UC_CPU_PPC_POWER8E_V2_1 = 13;
UC_CPU_PPC_POWER8_V2_0 = 14;
UC_CPU_PPC_POWER8NVL_V1_0 = 15;
UC_CPU_PPC_POWER9_V1_0 = 16;
UC_CPU_PPC_POWER9_V2_0 = 17;
UC_CPU_PPC_POWER10_V1_0 = 18;
// PPC registers
UC_PPC_REG_INVALID = 0;
// General purpose registers
UC_PPC_REG_PC = 1;
UC_PPC_REG_0 = 2;
UC_PPC_REG_1 = 3;
UC_PPC_REG_2 = 4;
UC_PPC_REG_3 = 5;
UC_PPC_REG_4 = 6;
UC_PPC_REG_5 = 7;
UC_PPC_REG_6 = 8;
UC_PPC_REG_7 = 9;
UC_PPC_REG_8 = 10;
UC_PPC_REG_9 = 11;
UC_PPC_REG_10 = 12;
UC_PPC_REG_11 = 13;
UC_PPC_REG_12 = 14;
UC_PPC_REG_13 = 15;
UC_PPC_REG_14 = 16;
UC_PPC_REG_15 = 17;
UC_PPC_REG_16 = 18;
UC_PPC_REG_17 = 19;
UC_PPC_REG_18 = 20;
UC_PPC_REG_19 = 21;
UC_PPC_REG_20 = 22;
UC_PPC_REG_21 = 23;
UC_PPC_REG_22 = 24;
UC_PPC_REG_23 = 25;
UC_PPC_REG_24 = 26;
UC_PPC_REG_25 = 27;
UC_PPC_REG_26 = 28;
UC_PPC_REG_27 = 29;
UC_PPC_REG_28 = 30;
UC_PPC_REG_29 = 31;
UC_PPC_REG_30 = 32;
UC_PPC_REG_31 = 33;
UC_PPC_REG_CR0 = 34;
UC_PPC_REG_CR1 = 35;
UC_PPC_REG_CR2 = 36;
UC_PPC_REG_CR3 = 37;
UC_PPC_REG_CR4 = 38;
UC_PPC_REG_CR5 = 39;
UC_PPC_REG_CR6 = 40;
UC_PPC_REG_CR7 = 41;
UC_PPC_REG_FPR0 = 42;
UC_PPC_REG_FPR1 = 43;
UC_PPC_REG_FPR2 = 44;
UC_PPC_REG_FPR3 = 45;
UC_PPC_REG_FPR4 = 46;
UC_PPC_REG_FPR5 = 47;
UC_PPC_REG_FPR6 = 48;
UC_PPC_REG_FPR7 = 49;
UC_PPC_REG_FPR8 = 50;
UC_PPC_REG_FPR9 = 51;
UC_PPC_REG_FPR10 = 52;
UC_PPC_REG_FPR11 = 53;
UC_PPC_REG_FPR12 = 54;
UC_PPC_REG_FPR13 = 55;
UC_PPC_REG_FPR14 = 56;
UC_PPC_REG_FPR15 = 57;
UC_PPC_REG_FPR16 = 58;
UC_PPC_REG_FPR17 = 59;
UC_PPC_REG_FPR18 = 60;
UC_PPC_REG_FPR19 = 61;
UC_PPC_REG_FPR20 = 62;
UC_PPC_REG_FPR21 = 63;
UC_PPC_REG_FPR22 = 64;
UC_PPC_REG_FPR23 = 65;
UC_PPC_REG_FPR24 = 66;
UC_PPC_REG_FPR25 = 67;
UC_PPC_REG_FPR26 = 68;
UC_PPC_REG_FPR27 = 69;
UC_PPC_REG_FPR28 = 70;
UC_PPC_REG_FPR29 = 71;
UC_PPC_REG_FPR30 = 72;
UC_PPC_REG_FPR31 = 73;
UC_PPC_REG_LR = 74;
UC_PPC_REG_XER = 75;
UC_PPC_REG_CTR = 76;
UC_PPC_REG_MSR = 77;
UC_PPC_REG_FPSCR = 78;
implementation
end.

View File

@ -0,0 +1,291 @@
// For Unicorn Engine. AUTO-GENERATED FILE, DO NOT EDIT
unit RiscvConst;
interface
const
// RISCV32 CPU
UC_CPU_RISCV32_ANY = 0;
UC_CPU_RISCV32_BASE32 = 1;
UC_CPU_RISCV32_SIFIVE_E31 = 2;
UC_CPU_RISCV32_SIFIVE_U34 = 3;
// RISCV64 CPU
UC_CPU_RISCV64_ANY = 0;
UC_CPU_RISCV64_BASE64 = 1;
UC_CPU_RISCV64_SIFIVE_E51 = 2;
UC_CPU_RISCV64_SIFIVE_U54 = 3;
// RISCV registers
UC_RISCV_REG_INVALID = 0;
// General purpose registers
UC_RISCV_REG_X0 = 1;
UC_RISCV_REG_X1 = 2;
UC_RISCV_REG_X2 = 3;
UC_RISCV_REG_X3 = 4;
UC_RISCV_REG_X4 = 5;
UC_RISCV_REG_X5 = 6;
UC_RISCV_REG_X6 = 7;
UC_RISCV_REG_X7 = 8;
UC_RISCV_REG_X8 = 9;
UC_RISCV_REG_X9 = 10;
UC_RISCV_REG_X10 = 11;
UC_RISCV_REG_X11 = 12;
UC_RISCV_REG_X12 = 13;
UC_RISCV_REG_X13 = 14;
UC_RISCV_REG_X14 = 15;
UC_RISCV_REG_X15 = 16;
UC_RISCV_REG_X16 = 17;
UC_RISCV_REG_X17 = 18;
UC_RISCV_REG_X18 = 19;
UC_RISCV_REG_X19 = 20;
UC_RISCV_REG_X20 = 21;
UC_RISCV_REG_X21 = 22;
UC_RISCV_REG_X22 = 23;
UC_RISCV_REG_X23 = 24;
UC_RISCV_REG_X24 = 25;
UC_RISCV_REG_X25 = 26;
UC_RISCV_REG_X26 = 27;
UC_RISCV_REG_X27 = 28;
UC_RISCV_REG_X28 = 29;
UC_RISCV_REG_X29 = 30;
UC_RISCV_REG_X30 = 31;
UC_RISCV_REG_X31 = 32;
// RISCV CSR
UC_RISCV_REG_USTATUS = 33;
UC_RISCV_REG_UIE = 34;
UC_RISCV_REG_UTVEC = 35;
UC_RISCV_REG_USCRATCH = 36;
UC_RISCV_REG_UEPC = 37;
UC_RISCV_REG_UCAUSE = 38;
UC_RISCV_REG_UTVAL = 39;
UC_RISCV_REG_UIP = 40;
UC_RISCV_REG_FFLAGS = 41;
UC_RISCV_REG_FRM = 42;
UC_RISCV_REG_FCSR = 43;
UC_RISCV_REG_CYCLE = 44;
UC_RISCV_REG_TIME = 45;
UC_RISCV_REG_INSTRET = 46;
UC_RISCV_REG_HPMCOUNTER3 = 47;
UC_RISCV_REG_HPMCOUNTER4 = 48;
UC_RISCV_REG_HPMCOUNTER5 = 49;
UC_RISCV_REG_HPMCOUNTER6 = 50;
UC_RISCV_REG_HPMCOUNTER7 = 51;
UC_RISCV_REG_HPMCOUNTER8 = 52;
UC_RISCV_REG_HPMCOUNTER9 = 53;
UC_RISCV_REG_HPMCOUNTER10 = 54;
UC_RISCV_REG_HPMCOUNTER11 = 55;
UC_RISCV_REG_HPMCOUNTER12 = 56;
UC_RISCV_REG_HPMCOUNTER13 = 57;
UC_RISCV_REG_HPMCOUNTER14 = 58;
UC_RISCV_REG_HPMCOUNTER15 = 59;
UC_RISCV_REG_HPMCOUNTER16 = 60;
UC_RISCV_REG_HPMCOUNTER17 = 61;
UC_RISCV_REG_HPMCOUNTER18 = 62;
UC_RISCV_REG_HPMCOUNTER19 = 63;
UC_RISCV_REG_HPMCOUNTER20 = 64;
UC_RISCV_REG_HPMCOUNTER21 = 65;
UC_RISCV_REG_HPMCOUNTER22 = 66;
UC_RISCV_REG_HPMCOUNTER23 = 67;
UC_RISCV_REG_HPMCOUNTER24 = 68;
UC_RISCV_REG_HPMCOUNTER25 = 69;
UC_RISCV_REG_HPMCOUNTER26 = 70;
UC_RISCV_REG_HPMCOUNTER27 = 71;
UC_RISCV_REG_HPMCOUNTER28 = 72;
UC_RISCV_REG_HPMCOUNTER29 = 73;
UC_RISCV_REG_HPMCOUNTER30 = 74;
UC_RISCV_REG_HPMCOUNTER31 = 75;
UC_RISCV_REG_CYCLEH = 76;
UC_RISCV_REG_TIMEH = 77;
UC_RISCV_REG_INSTRETH = 78;
UC_RISCV_REG_HPMCOUNTER3H = 79;
UC_RISCV_REG_HPMCOUNTER4H = 80;
UC_RISCV_REG_HPMCOUNTER5H = 81;
UC_RISCV_REG_HPMCOUNTER6H = 82;
UC_RISCV_REG_HPMCOUNTER7H = 83;
UC_RISCV_REG_HPMCOUNTER8H = 84;
UC_RISCV_REG_HPMCOUNTER9H = 85;
UC_RISCV_REG_HPMCOUNTER10H = 86;
UC_RISCV_REG_HPMCOUNTER11H = 87;
UC_RISCV_REG_HPMCOUNTER12H = 88;
UC_RISCV_REG_HPMCOUNTER13H = 89;
UC_RISCV_REG_HPMCOUNTER14H = 90;
UC_RISCV_REG_HPMCOUNTER15H = 91;
UC_RISCV_REG_HPMCOUNTER16H = 92;
UC_RISCV_REG_HPMCOUNTER17H = 93;
UC_RISCV_REG_HPMCOUNTER18H = 94;
UC_RISCV_REG_HPMCOUNTER19H = 95;
UC_RISCV_REG_HPMCOUNTER20H = 96;
UC_RISCV_REG_HPMCOUNTER21H = 97;
UC_RISCV_REG_HPMCOUNTER22H = 98;
UC_RISCV_REG_HPMCOUNTER23H = 99;
UC_RISCV_REG_HPMCOUNTER24H = 100;
UC_RISCV_REG_HPMCOUNTER25H = 101;
UC_RISCV_REG_HPMCOUNTER26H = 102;
UC_RISCV_REG_HPMCOUNTER27H = 103;
UC_RISCV_REG_HPMCOUNTER28H = 104;
UC_RISCV_REG_HPMCOUNTER29H = 105;
UC_RISCV_REG_HPMCOUNTER30H = 106;
UC_RISCV_REG_HPMCOUNTER31H = 107;
UC_RISCV_REG_MCYCLE = 108;
UC_RISCV_REG_MINSTRET = 109;
UC_RISCV_REG_MCYCLEH = 110;
UC_RISCV_REG_MINSTRETH = 111;
UC_RISCV_REG_MVENDORID = 112;
UC_RISCV_REG_MARCHID = 113;
UC_RISCV_REG_MIMPID = 114;
UC_RISCV_REG_MHARTID = 115;
UC_RISCV_REG_MSTATUS = 116;
UC_RISCV_REG_MISA = 117;
UC_RISCV_REG_MEDELEG = 118;
UC_RISCV_REG_MIDELEG = 119;
UC_RISCV_REG_MIE = 120;
UC_RISCV_REG_MTVEC = 121;
UC_RISCV_REG_MCOUNTEREN = 122;
UC_RISCV_REG_MSTATUSH = 123;
UC_RISCV_REG_MUCOUNTEREN = 124;
UC_RISCV_REG_MSCOUNTEREN = 125;
UC_RISCV_REG_MHCOUNTEREN = 126;
UC_RISCV_REG_MSCRATCH = 127;
UC_RISCV_REG_MEPC = 128;
UC_RISCV_REG_MCAUSE = 129;
UC_RISCV_REG_MTVAL = 130;
UC_RISCV_REG_MIP = 131;
UC_RISCV_REG_MBADADDR = 132;
UC_RISCV_REG_SSTATUS = 133;
UC_RISCV_REG_SEDELEG = 134;
UC_RISCV_REG_SIDELEG = 135;
UC_RISCV_REG_SIE = 136;
UC_RISCV_REG_STVEC = 137;
UC_RISCV_REG_SCOUNTEREN = 138;
UC_RISCV_REG_SSCRATCH = 139;
UC_RISCV_REG_SEPC = 140;
UC_RISCV_REG_SCAUSE = 141;
UC_RISCV_REG_STVAL = 142;
UC_RISCV_REG_SIP = 143;
UC_RISCV_REG_SBADADDR = 144;
UC_RISCV_REG_SPTBR = 145;
UC_RISCV_REG_SATP = 146;
UC_RISCV_REG_HSTATUS = 147;
UC_RISCV_REG_HEDELEG = 148;
UC_RISCV_REG_HIDELEG = 149;
UC_RISCV_REG_HIE = 150;
UC_RISCV_REG_HCOUNTEREN = 151;
UC_RISCV_REG_HTVAL = 152;
UC_RISCV_REG_HIP = 153;
UC_RISCV_REG_HTINST = 154;
UC_RISCV_REG_HGATP = 155;
UC_RISCV_REG_HTIMEDELTA = 156;
UC_RISCV_REG_HTIMEDELTAH = 157;
// Floating-point registers
UC_RISCV_REG_F0 = 158;
UC_RISCV_REG_F1 = 159;
UC_RISCV_REG_F2 = 160;
UC_RISCV_REG_F3 = 161;
UC_RISCV_REG_F4 = 162;
UC_RISCV_REG_F5 = 163;
UC_RISCV_REG_F6 = 164;
UC_RISCV_REG_F7 = 165;
UC_RISCV_REG_F8 = 166;
UC_RISCV_REG_F9 = 167;
UC_RISCV_REG_F10 = 168;
UC_RISCV_REG_F11 = 169;
UC_RISCV_REG_F12 = 170;
UC_RISCV_REG_F13 = 171;
UC_RISCV_REG_F14 = 172;
UC_RISCV_REG_F15 = 173;
UC_RISCV_REG_F16 = 174;
UC_RISCV_REG_F17 = 175;
UC_RISCV_REG_F18 = 176;
UC_RISCV_REG_F19 = 177;
UC_RISCV_REG_F20 = 178;
UC_RISCV_REG_F21 = 179;
UC_RISCV_REG_F22 = 180;
UC_RISCV_REG_F23 = 181;
UC_RISCV_REG_F24 = 182;
UC_RISCV_REG_F25 = 183;
UC_RISCV_REG_F26 = 184;
UC_RISCV_REG_F27 = 185;
UC_RISCV_REG_F28 = 186;
UC_RISCV_REG_F29 = 187;
UC_RISCV_REG_F30 = 188;
UC_RISCV_REG_F31 = 189;
UC_RISCV_REG_PC = 190;
UC_RISCV_REG_ENDING = 191;
// Alias registers
UC_RISCV_REG_ZERO = 1;
UC_RISCV_REG_RA = 2;
UC_RISCV_REG_SP = 3;
UC_RISCV_REG_GP = 4;
UC_RISCV_REG_TP = 5;
UC_RISCV_REG_T0 = 6;
UC_RISCV_REG_T1 = 7;
UC_RISCV_REG_T2 = 8;
UC_RISCV_REG_S0 = 9;
UC_RISCV_REG_FP = 9;
UC_RISCV_REG_S1 = 10;
UC_RISCV_REG_A0 = 11;
UC_RISCV_REG_A1 = 12;
UC_RISCV_REG_A2 = 13;
UC_RISCV_REG_A3 = 14;
UC_RISCV_REG_A4 = 15;
UC_RISCV_REG_A5 = 16;
UC_RISCV_REG_A6 = 17;
UC_RISCV_REG_A7 = 18;
UC_RISCV_REG_S2 = 19;
UC_RISCV_REG_S3 = 20;
UC_RISCV_REG_S4 = 21;
UC_RISCV_REG_S5 = 22;
UC_RISCV_REG_S6 = 23;
UC_RISCV_REG_S7 = 24;
UC_RISCV_REG_S8 = 25;
UC_RISCV_REG_S9 = 26;
UC_RISCV_REG_S10 = 27;
UC_RISCV_REG_S11 = 28;
UC_RISCV_REG_T3 = 29;
UC_RISCV_REG_T4 = 30;
UC_RISCV_REG_T5 = 31;
UC_RISCV_REG_T6 = 32;
UC_RISCV_REG_FT0 = 158;
UC_RISCV_REG_FT1 = 159;
UC_RISCV_REG_FT2 = 160;
UC_RISCV_REG_FT3 = 161;
UC_RISCV_REG_FT4 = 162;
UC_RISCV_REG_FT5 = 163;
UC_RISCV_REG_FT6 = 164;
UC_RISCV_REG_FT7 = 165;
UC_RISCV_REG_FS0 = 166;
UC_RISCV_REG_FS1 = 167;
UC_RISCV_REG_FA0 = 168;
UC_RISCV_REG_FA1 = 169;
UC_RISCV_REG_FA2 = 170;
UC_RISCV_REG_FA3 = 171;
UC_RISCV_REG_FA4 = 172;
UC_RISCV_REG_FA5 = 173;
UC_RISCV_REG_FA6 = 174;
UC_RISCV_REG_FA7 = 175;
UC_RISCV_REG_FS2 = 176;
UC_RISCV_REG_FS3 = 177;
UC_RISCV_REG_FS4 = 178;
UC_RISCV_REG_FS5 = 179;
UC_RISCV_REG_FS6 = 180;
UC_RISCV_REG_FS7 = 181;
UC_RISCV_REG_FS8 = 182;
UC_RISCV_REG_FS9 = 183;
UC_RISCV_REG_FS10 = 184;
UC_RISCV_REG_FS11 = 185;
UC_RISCV_REG_FT8 = 186;
UC_RISCV_REG_FT9 = 187;
UC_RISCV_REG_FT10 = 188;
UC_RISCV_REG_FT11 = 189;
implementation
end.

View File

@ -0,0 +1,129 @@
// For Unicorn Engine. AUTO-GENERATED FILE, DO NOT EDIT
unit S390xConst;
interface
const
// S390X CPU
UC_CPU_S390X_Z900 = 0;
UC_CPU_S390X_Z900_2 = 1;
UC_CPU_S390X_Z900_3 = 2;
UC_CPU_S390X_Z800 = 3;
UC_CPU_S390X_Z990 = 4;
UC_CPU_S390X_Z990_2 = 5;
UC_CPU_S390X_Z990_3 = 6;
UC_CPU_S390X_Z890 = 7;
UC_CPU_S390X_Z990_4 = 8;
UC_CPU_S390X_Z890_2 = 9;
UC_CPU_S390X_Z990_5 = 10;
UC_CPU_S390X_Z890_3 = 11;
UC_CPU_S390X_Z9EC = 12;
UC_CPU_S390X_Z9EC_2 = 13;
UC_CPU_S390X_Z9BC = 14;
UC_CPU_S390X_Z9EC_3 = 15;
UC_CPU_S390X_Z9BC_2 = 16;
UC_CPU_S390X_Z10EC = 17;
UC_CPU_S390X_Z10EC_2 = 18;
UC_CPU_S390X_Z10BC = 19;
UC_CPU_S390X_Z10EC_3 = 20;
UC_CPU_S390X_Z10BC_2 = 21;
UC_CPU_S390X_Z196 = 22;
UC_CPU_S390X_Z196_2 = 23;
UC_CPU_S390X_Z114 = 24;
UC_CPU_S390X_ZEC12 = 25;
UC_CPU_S390X_ZEC12_2 = 26;
UC_CPU_S390X_ZBC12 = 27;
UC_CPU_S390X_Z13 = 28;
UC_CPU_S390X_Z13_2 = 29;
UC_CPU_S390X_Z13S = 30;
UC_CPU_S390X_Z14 = 31;
UC_CPU_S390X_Z14_2 = 32;
UC_CPU_S390X_Z14ZR1 = 33;
UC_CPU_S390X_GEN15A = 34;
UC_CPU_S390X_GEN15B = 35;
UC_CPU_S390X_QEMU = 36;
UC_CPU_S390X_MAX = 37;
// S390X registers
UC_S390X_REG_INVALID = 0;
// General purpose registers
UC_S390X_REG_R0 = 1;
UC_S390X_REG_R1 = 2;
UC_S390X_REG_R2 = 3;
UC_S390X_REG_R3 = 4;
UC_S390X_REG_R4 = 5;
UC_S390X_REG_R5 = 6;
UC_S390X_REG_R6 = 7;
UC_S390X_REG_R7 = 8;
UC_S390X_REG_R8 = 9;
UC_S390X_REG_R9 = 10;
UC_S390X_REG_R10 = 11;
UC_S390X_REG_R11 = 12;
UC_S390X_REG_R12 = 13;
UC_S390X_REG_R13 = 14;
UC_S390X_REG_R14 = 15;
UC_S390X_REG_R15 = 16;
// Floating point registers
UC_S390X_REG_F0 = 17;
UC_S390X_REG_F1 = 18;
UC_S390X_REG_F2 = 19;
UC_S390X_REG_F3 = 20;
UC_S390X_REG_F4 = 21;
UC_S390X_REG_F5 = 22;
UC_S390X_REG_F6 = 23;
UC_S390X_REG_F7 = 24;
UC_S390X_REG_F8 = 25;
UC_S390X_REG_F9 = 26;
UC_S390X_REG_F10 = 27;
UC_S390X_REG_F11 = 28;
UC_S390X_REG_F12 = 29;
UC_S390X_REG_F13 = 30;
UC_S390X_REG_F14 = 31;
UC_S390X_REG_F15 = 32;
UC_S390X_REG_F16 = 33;
UC_S390X_REG_F17 = 34;
UC_S390X_REG_F18 = 35;
UC_S390X_REG_F19 = 36;
UC_S390X_REG_F20 = 37;
UC_S390X_REG_F21 = 38;
UC_S390X_REG_F22 = 39;
UC_S390X_REG_F23 = 40;
UC_S390X_REG_F24 = 41;
UC_S390X_REG_F25 = 42;
UC_S390X_REG_F26 = 43;
UC_S390X_REG_F27 = 44;
UC_S390X_REG_F28 = 45;
UC_S390X_REG_F29 = 46;
UC_S390X_REG_F30 = 47;
UC_S390X_REG_F31 = 48;
// Access registers
UC_S390X_REG_A0 = 49;
UC_S390X_REG_A1 = 50;
UC_S390X_REG_A2 = 51;
UC_S390X_REG_A3 = 52;
UC_S390X_REG_A4 = 53;
UC_S390X_REG_A5 = 54;
UC_S390X_REG_A6 = 55;
UC_S390X_REG_A7 = 56;
UC_S390X_REG_A8 = 57;
UC_S390X_REG_A9 = 58;
UC_S390X_REG_A10 = 59;
UC_S390X_REG_A11 = 60;
UC_S390X_REG_A12 = 61;
UC_S390X_REG_A13 = 62;
UC_S390X_REG_A14 = 63;
UC_S390X_REG_A15 = 64;
UC_S390X_REG_PC = 65;
UC_S390X_REG_PSWM = 66;
UC_S390X_REG_ENDING = 67;
// Alias registers
implementation
end.

View File

@ -5,6 +5,42 @@ unit SparcConst;
interface
const
// SPARC32 CPU
UC_CPU_SPARC32_FUJITSU_MB86904 = 0;
UC_CPU_SPARC32_FUJITSU_MB86907 = 1;
UC_CPU_SPARC32_TI_MICROSPARC_I = 2;
UC_CPU_SPARC32_TI_MICROSPARC_II = 3;
UC_CPU_SPARC32_TI_MICROSPARC_IIEP = 4;
UC_CPU_SPARC32_TI_SUPERSPARC_40 = 5;
UC_CPU_SPARC32_TI_SUPERSPARC_50 = 6;
UC_CPU_SPARC32_TI_SUPERSPARC_51 = 7;
UC_CPU_SPARC32_TI_SUPERSPARC_60 = 8;
UC_CPU_SPARC32_TI_SUPERSPARC_61 = 9;
UC_CPU_SPARC32_TI_SUPERSPARC_II = 10;
UC_CPU_SPARC32_LEON2 = 11;
UC_CPU_SPARC32_LEON3 = 12;
// SPARC64 CPU
UC_CPU_SPARC64_FUJITSU = 0;
UC_CPU_SPARC64_FUJITSU_III = 1;
UC_CPU_SPARC64_FUJITSU_IV = 2;
UC_CPU_SPARC64_FUJITSU_V = 3;
UC_CPU_SPARC64_TI_ULTRASPARC_I = 4;
UC_CPU_SPARC64_TI_ULTRASPARC_II = 5;
UC_CPU_SPARC64_TI_ULTRASPARC_III = 6;
UC_CPU_SPARC64_TI_ULTRASPARC_IIE = 7;
UC_CPU_SPARC64_SUN_ULTRASPARC_III = 8;
UC_CPU_SPARC64_SUN_ULTRASPARC_III_CU = 9;
UC_CPU_SPARC64_SUN_ULTRASPARC_IIII = 10;
UC_CPU_SPARC64_SUN_ULTRASPARC_IV = 11;
UC_CPU_SPARC64_SUN_ULTRASPARC_IV_PLUS = 12;
UC_CPU_SPARC64_SUN_ULTRASPARC_IIII_PLUS = 13;
UC_CPU_SPARC64_SUN_ULTRASPARC_T1 = 14;
UC_CPU_SPARC64_SUN_ULTRASPARC_T2 = 15;
UC_CPU_SPARC64_NEC_ULTRASPARC_I = 16;
// SPARC registers
UC_SPARC_REG_INVALID = 0;

View File

@ -4,13 +4,18 @@ unit UnicornConst;
interface
const UC_API_MAJOR = 1;
const UC_API_MAJOR = 2;
UC_API_MINOR = 0;
UC_VERSION_MAJOR = 1;
UC_API_PATCH = 0;
UC_API_EXTRA = 5;
UC_VERSION_MAJOR = 2;
UC_VERSION_MINOR = 0;
UC_VERSION_EXTRA = 3;
UC_VERSION_PATCH = 0;
UC_VERSION_EXTRA = 5;
UC_SECOND_SCALE = 1000000;
UC_MILISECOND_SCALE = 1000;
UC_ARCH_ARM = 1;
@ -20,7 +25,9 @@ const UC_API_MAJOR = 1;
UC_ARCH_PPC = 5;
UC_ARCH_SPARC = 6;
UC_ARCH_M68K = 7;
UC_ARCH_MAX = 8;
UC_ARCH_RISCV = 8;
UC_ARCH_S390X = 9;
UC_ARCH_MAX = 10;
UC_MODE_LITTLE_ENDIAN = 0;
UC_MODE_BIG_ENDIAN = 1073741824;
@ -32,7 +39,6 @@ const UC_API_MAJOR = 1;
UC_MODE_ARM926 = 128;
UC_MODE_ARM946 = 256;
UC_MODE_ARM1176 = 512;
UC_MODE_ARMBE8 = 1024;
UC_MODE_MICRO = 16;
UC_MODE_MIPS3 = 32;
UC_MODE_MIPS32R6 = 64;
@ -47,6 +53,8 @@ const UC_API_MAJOR = 1;
UC_MODE_SPARC32 = 4;
UC_MODE_SPARC64 = 8;
UC_MODE_V9 = 16;
UC_MODE_RISCV32 = 4;
UC_MODE_RISCV64 = 8;
UC_ERR_OK = 0;
UC_ERR_NOMEM = 1;
@ -80,6 +88,10 @@ const UC_API_MAJOR = 1;
UC_MEM_READ_PROT = 23;
UC_MEM_FETCH_PROT = 24;
UC_MEM_READ_AFTER = 25;
UC_TCG_OP_SUB = 0;
UC_TCG_OP_FLAG_CMP = 1;
UC_TCG_OP_FLAG_DIRECT = 2;
UC_HOOK_INTR = 1;
UC_HOOK_INSN = 2;
UC_HOOK_CODE = 4;
@ -95,6 +107,8 @@ const UC_API_MAJOR = 1;
UC_HOOK_MEM_FETCH = 4096;
UC_HOOK_MEM_READ_AFTER = 8192;
UC_HOOK_INSN_INVALID = 16384;
UC_HOOK_EDGE_GENERATED = 32768;
UC_HOOK_TCG_OPCODE = 65536;
UC_HOOK_MEM_UNMAPPED = 112;
UC_HOOK_MEM_PROT = 896;
UC_HOOK_MEM_READ_INVALID = 144;
@ -107,6 +121,22 @@ const UC_API_MAJOR = 1;
UC_QUERY_ARCH = 3;
UC_QUERY_TIMEOUT = 4;
UC_CTL_IO_NONE = 0;
UC_CTL_IO_WRITE = 1;
UC_CTL_IO_READ = 2;
UC_CTL_IO_READ_WRITE = 3;
UC_CTL_UC_MODE = 0;
UC_CTL_UC_PAGE_SIZE = 1;
UC_CTL_UC_ARCH = 2;
UC_CTL_UC_TIMEOUT = 3;
UC_CTL_UC_USE_EXITS = 4;
UC_CTL_UC_EXITS_CNT = 5;
UC_CTL_UC_EXITS = 6;
UC_CTL_CPU_MODEL = 7;
UC_CTL_TB_REQUEST_CACHE = 8;
UC_CTL_TB_REMOVE_CACHE = 9;
UC_PROT_NONE = 0;
UC_PROT_READ = 1;
UC_PROT_WRITE = 2;

View File

@ -5,6 +5,47 @@ unit X86Const;
interface
const
// X86 CPU
UC_CPU_X86_QEMU64 = 0;
UC_CPU_X86_PHENOM = 1;
UC_CPU_X86_CORE2DUO = 2;
UC_CPU_X86_KVM64 = 3;
UC_CPU_X86_QEMU32 = 4;
UC_CPU_X86_KVM32 = 5;
UC_CPU_X86_COREDUO = 6;
UC_CPU_X86_486 = 7;
UC_CPU_X86_PENTIUM = 8;
UC_CPU_X86_PENTIUM2 = 9;
UC_CPU_X86_PENTIUM3 = 10;
UC_CPU_X86_ATHLON = 11;
UC_CPU_X86_N270 = 12;
UC_CPU_X86_CONROE = 13;
UC_CPU_X86_PENRYN = 14;
UC_CPU_X86_NEHALEM = 15;
UC_CPU_X86_WESTMERE = 16;
UC_CPU_X86_SANDYBRIDGE = 17;
UC_CPU_X86_IVYBRIDGE = 18;
UC_CPU_X86_HASWELL = 19;
UC_CPU_X86_BROADWELL = 20;
UC_CPU_X86_SKYLAKE_CLIENT = 21;
UC_CPU_X86_SKYLAKE_SERVER = 22;
UC_CPU_X86_CASCADELAKE_SERVER = 23;
UC_CPU_X86_COOPERLAKE = 24;
UC_CPU_X86_ICELAKE_CLIENT = 25;
UC_CPU_X86_ICELAKE_SERVER = 26;
UC_CPU_X86_DENVERTON = 27;
UC_CPU_X86_SNOWRIDGE = 28;
UC_CPU_X86_KNIGHTSMILL = 29;
UC_CPU_X86_OPTERON_G1 = 30;
UC_CPU_X86_OPTERON_G2 = 31;
UC_CPU_X86_OPTERON_G3 = 32;
UC_CPU_X86_OPTERON_G4 = 33;
UC_CPU_X86_OPTERON_G5 = 34;
UC_CPU_X86_EPYC = 35;
UC_CPU_X86_DHYANA = 36;
UC_CPU_X86_EPYC_ROME = 37;
// X86 registers
UC_X86_REG_INVALID = 0;
@ -34,232 +75,219 @@ const
UC_X86_REG_EDX = 24;
UC_X86_REG_EFLAGS = 25;
UC_X86_REG_EIP = 26;
UC_X86_REG_EIZ = 27;
UC_X86_REG_ES = 28;
UC_X86_REG_ESI = 29;
UC_X86_REG_ESP = 30;
UC_X86_REG_FPSW = 31;
UC_X86_REG_FS = 32;
UC_X86_REG_GS = 33;
UC_X86_REG_IP = 34;
UC_X86_REG_RAX = 35;
UC_X86_REG_RBP = 36;
UC_X86_REG_RBX = 37;
UC_X86_REG_RCX = 38;
UC_X86_REG_RDI = 39;
UC_X86_REG_RDX = 40;
UC_X86_REG_RIP = 41;
UC_X86_REG_RIZ = 42;
UC_X86_REG_RSI = 43;
UC_X86_REG_RSP = 44;
UC_X86_REG_SI = 45;
UC_X86_REG_SIL = 46;
UC_X86_REG_SP = 47;
UC_X86_REG_SPL = 48;
UC_X86_REG_SS = 49;
UC_X86_REG_CR0 = 50;
UC_X86_REG_CR1 = 51;
UC_X86_REG_CR2 = 52;
UC_X86_REG_CR3 = 53;
UC_X86_REG_CR4 = 54;
UC_X86_REG_CR5 = 55;
UC_X86_REG_CR6 = 56;
UC_X86_REG_CR7 = 57;
UC_X86_REG_CR8 = 58;
UC_X86_REG_CR9 = 59;
UC_X86_REG_CR10 = 60;
UC_X86_REG_CR11 = 61;
UC_X86_REG_CR12 = 62;
UC_X86_REG_CR13 = 63;
UC_X86_REG_CR14 = 64;
UC_X86_REG_CR15 = 65;
UC_X86_REG_DR0 = 66;
UC_X86_REG_DR1 = 67;
UC_X86_REG_DR2 = 68;
UC_X86_REG_DR3 = 69;
UC_X86_REG_DR4 = 70;
UC_X86_REG_DR5 = 71;
UC_X86_REG_DR6 = 72;
UC_X86_REG_DR7 = 73;
UC_X86_REG_DR8 = 74;
UC_X86_REG_DR9 = 75;
UC_X86_REG_DR10 = 76;
UC_X86_REG_DR11 = 77;
UC_X86_REG_DR12 = 78;
UC_X86_REG_DR13 = 79;
UC_X86_REG_DR14 = 80;
UC_X86_REG_DR15 = 81;
UC_X86_REG_FP0 = 82;
UC_X86_REG_FP1 = 83;
UC_X86_REG_FP2 = 84;
UC_X86_REG_FP3 = 85;
UC_X86_REG_FP4 = 86;
UC_X86_REG_FP5 = 87;
UC_X86_REG_FP6 = 88;
UC_X86_REG_FP7 = 89;
UC_X86_REG_K0 = 90;
UC_X86_REG_K1 = 91;
UC_X86_REG_K2 = 92;
UC_X86_REG_K3 = 93;
UC_X86_REG_K4 = 94;
UC_X86_REG_K5 = 95;
UC_X86_REG_K6 = 96;
UC_X86_REG_K7 = 97;
UC_X86_REG_MM0 = 98;
UC_X86_REG_MM1 = 99;
UC_X86_REG_MM2 = 100;
UC_X86_REG_MM3 = 101;
UC_X86_REG_MM4 = 102;
UC_X86_REG_MM5 = 103;
UC_X86_REG_MM6 = 104;
UC_X86_REG_MM7 = 105;
UC_X86_REG_R8 = 106;
UC_X86_REG_R9 = 107;
UC_X86_REG_R10 = 108;
UC_X86_REG_R11 = 109;
UC_X86_REG_R12 = 110;
UC_X86_REG_R13 = 111;
UC_X86_REG_R14 = 112;
UC_X86_REG_R15 = 113;
UC_X86_REG_ST0 = 114;
UC_X86_REG_ST1 = 115;
UC_X86_REG_ST2 = 116;
UC_X86_REG_ST3 = 117;
UC_X86_REG_ST4 = 118;
UC_X86_REG_ST5 = 119;
UC_X86_REG_ST6 = 120;
UC_X86_REG_ST7 = 121;
UC_X86_REG_XMM0 = 122;
UC_X86_REG_XMM1 = 123;
UC_X86_REG_XMM2 = 124;
UC_X86_REG_XMM3 = 125;
UC_X86_REG_XMM4 = 126;
UC_X86_REG_XMM5 = 127;
UC_X86_REG_XMM6 = 128;
UC_X86_REG_XMM7 = 129;
UC_X86_REG_XMM8 = 130;
UC_X86_REG_XMM9 = 131;
UC_X86_REG_XMM10 = 132;
UC_X86_REG_XMM11 = 133;
UC_X86_REG_XMM12 = 134;
UC_X86_REG_XMM13 = 135;
UC_X86_REG_XMM14 = 136;
UC_X86_REG_XMM15 = 137;
UC_X86_REG_XMM16 = 138;
UC_X86_REG_XMM17 = 139;
UC_X86_REG_XMM18 = 140;
UC_X86_REG_XMM19 = 141;
UC_X86_REG_XMM20 = 142;
UC_X86_REG_XMM21 = 143;
UC_X86_REG_XMM22 = 144;
UC_X86_REG_XMM23 = 145;
UC_X86_REG_XMM24 = 146;
UC_X86_REG_XMM25 = 147;
UC_X86_REG_XMM26 = 148;
UC_X86_REG_XMM27 = 149;
UC_X86_REG_XMM28 = 150;
UC_X86_REG_XMM29 = 151;
UC_X86_REG_XMM30 = 152;
UC_X86_REG_XMM31 = 153;
UC_X86_REG_YMM0 = 154;
UC_X86_REG_YMM1 = 155;
UC_X86_REG_YMM2 = 156;
UC_X86_REG_YMM3 = 157;
UC_X86_REG_YMM4 = 158;
UC_X86_REG_YMM5 = 159;
UC_X86_REG_YMM6 = 160;
UC_X86_REG_YMM7 = 161;
UC_X86_REG_YMM8 = 162;
UC_X86_REG_YMM9 = 163;
UC_X86_REG_YMM10 = 164;
UC_X86_REG_YMM11 = 165;
UC_X86_REG_YMM12 = 166;
UC_X86_REG_YMM13 = 167;
UC_X86_REG_YMM14 = 168;
UC_X86_REG_YMM15 = 169;
UC_X86_REG_YMM16 = 170;
UC_X86_REG_YMM17 = 171;
UC_X86_REG_YMM18 = 172;
UC_X86_REG_YMM19 = 173;
UC_X86_REG_YMM20 = 174;
UC_X86_REG_YMM21 = 175;
UC_X86_REG_YMM22 = 176;
UC_X86_REG_YMM23 = 177;
UC_X86_REG_YMM24 = 178;
UC_X86_REG_YMM25 = 179;
UC_X86_REG_YMM26 = 180;
UC_X86_REG_YMM27 = 181;
UC_X86_REG_YMM28 = 182;
UC_X86_REG_YMM29 = 183;
UC_X86_REG_YMM30 = 184;
UC_X86_REG_YMM31 = 185;
UC_X86_REG_ZMM0 = 186;
UC_X86_REG_ZMM1 = 187;
UC_X86_REG_ZMM2 = 188;
UC_X86_REG_ZMM3 = 189;
UC_X86_REG_ZMM4 = 190;
UC_X86_REG_ZMM5 = 191;
UC_X86_REG_ZMM6 = 192;
UC_X86_REG_ZMM7 = 193;
UC_X86_REG_ZMM8 = 194;
UC_X86_REG_ZMM9 = 195;
UC_X86_REG_ZMM10 = 196;
UC_X86_REG_ZMM11 = 197;
UC_X86_REG_ZMM12 = 198;
UC_X86_REG_ZMM13 = 199;
UC_X86_REG_ZMM14 = 200;
UC_X86_REG_ZMM15 = 201;
UC_X86_REG_ZMM16 = 202;
UC_X86_REG_ZMM17 = 203;
UC_X86_REG_ZMM18 = 204;
UC_X86_REG_ZMM19 = 205;
UC_X86_REG_ZMM20 = 206;
UC_X86_REG_ZMM21 = 207;
UC_X86_REG_ZMM22 = 208;
UC_X86_REG_ZMM23 = 209;
UC_X86_REG_ZMM24 = 210;
UC_X86_REG_ZMM25 = 211;
UC_X86_REG_ZMM26 = 212;
UC_X86_REG_ZMM27 = 213;
UC_X86_REG_ZMM28 = 214;
UC_X86_REG_ZMM29 = 215;
UC_X86_REG_ZMM30 = 216;
UC_X86_REG_ZMM31 = 217;
UC_X86_REG_R8B = 218;
UC_X86_REG_R9B = 219;
UC_X86_REG_R10B = 220;
UC_X86_REG_R11B = 221;
UC_X86_REG_R12B = 222;
UC_X86_REG_R13B = 223;
UC_X86_REG_R14B = 224;
UC_X86_REG_R15B = 225;
UC_X86_REG_R8D = 226;
UC_X86_REG_R9D = 227;
UC_X86_REG_R10D = 228;
UC_X86_REG_R11D = 229;
UC_X86_REG_R12D = 230;
UC_X86_REG_R13D = 231;
UC_X86_REG_R14D = 232;
UC_X86_REG_R15D = 233;
UC_X86_REG_R8W = 234;
UC_X86_REG_R9W = 235;
UC_X86_REG_R10W = 236;
UC_X86_REG_R11W = 237;
UC_X86_REG_R12W = 238;
UC_X86_REG_R13W = 239;
UC_X86_REG_R14W = 240;
UC_X86_REG_R15W = 241;
UC_X86_REG_IDTR = 242;
UC_X86_REG_GDTR = 243;
UC_X86_REG_LDTR = 244;
UC_X86_REG_TR = 245;
UC_X86_REG_FPCW = 246;
UC_X86_REG_FPTAG = 247;
UC_X86_REG_MSR = 248;
UC_X86_REG_MXCSR = 249;
UC_X86_REG_FS_BASE = 250;
UC_X86_REG_GS_BASE = 251;
UC_X86_REG_ENDING = 252;
UC_X86_REG_ES = 27;
UC_X86_REG_ESI = 28;
UC_X86_REG_ESP = 29;
UC_X86_REG_FPSW = 30;
UC_X86_REG_FS = 31;
UC_X86_REG_GS = 32;
UC_X86_REG_IP = 33;
UC_X86_REG_RAX = 34;
UC_X86_REG_RBP = 35;
UC_X86_REG_RBX = 36;
UC_X86_REG_RCX = 37;
UC_X86_REG_RDI = 38;
UC_X86_REG_RDX = 39;
UC_X86_REG_RIP = 40;
UC_X86_REG_RSI = 41;
UC_X86_REG_RSP = 42;
UC_X86_REG_SI = 43;
UC_X86_REG_SIL = 44;
UC_X86_REG_SP = 45;
UC_X86_REG_SPL = 46;
UC_X86_REG_SS = 47;
UC_X86_REG_CR0 = 48;
UC_X86_REG_CR1 = 49;
UC_X86_REG_CR2 = 50;
UC_X86_REG_CR3 = 51;
UC_X86_REG_CR4 = 52;
UC_X86_REG_CR8 = 53;
UC_X86_REG_DR0 = 54;
UC_X86_REG_DR1 = 55;
UC_X86_REG_DR2 = 56;
UC_X86_REG_DR3 = 57;
UC_X86_REG_DR4 = 58;
UC_X86_REG_DR5 = 59;
UC_X86_REG_DR6 = 60;
UC_X86_REG_DR7 = 61;
UC_X86_REG_FP0 = 62;
UC_X86_REG_FP1 = 63;
UC_X86_REG_FP2 = 64;
UC_X86_REG_FP3 = 65;
UC_X86_REG_FP4 = 66;
UC_X86_REG_FP5 = 67;
UC_X86_REG_FP6 = 68;
UC_X86_REG_FP7 = 69;
UC_X86_REG_K0 = 70;
UC_X86_REG_K1 = 71;
UC_X86_REG_K2 = 72;
UC_X86_REG_K3 = 73;
UC_X86_REG_K4 = 74;
UC_X86_REG_K5 = 75;
UC_X86_REG_K6 = 76;
UC_X86_REG_K7 = 77;
UC_X86_REG_MM0 = 78;
UC_X86_REG_MM1 = 79;
UC_X86_REG_MM2 = 80;
UC_X86_REG_MM3 = 81;
UC_X86_REG_MM4 = 82;
UC_X86_REG_MM5 = 83;
UC_X86_REG_MM6 = 84;
UC_X86_REG_MM7 = 85;
UC_X86_REG_R8 = 86;
UC_X86_REG_R9 = 87;
UC_X86_REG_R10 = 88;
UC_X86_REG_R11 = 89;
UC_X86_REG_R12 = 90;
UC_X86_REG_R13 = 91;
UC_X86_REG_R14 = 92;
UC_X86_REG_R15 = 93;
UC_X86_REG_ST0 = 94;
UC_X86_REG_ST1 = 95;
UC_X86_REG_ST2 = 96;
UC_X86_REG_ST3 = 97;
UC_X86_REG_ST4 = 98;
UC_X86_REG_ST5 = 99;
UC_X86_REG_ST6 = 100;
UC_X86_REG_ST7 = 101;
UC_X86_REG_XMM0 = 102;
UC_X86_REG_XMM1 = 103;
UC_X86_REG_XMM2 = 104;
UC_X86_REG_XMM3 = 105;
UC_X86_REG_XMM4 = 106;
UC_X86_REG_XMM5 = 107;
UC_X86_REG_XMM6 = 108;
UC_X86_REG_XMM7 = 109;
UC_X86_REG_XMM8 = 110;
UC_X86_REG_XMM9 = 111;
UC_X86_REG_XMM10 = 112;
UC_X86_REG_XMM11 = 113;
UC_X86_REG_XMM12 = 114;
UC_X86_REG_XMM13 = 115;
UC_X86_REG_XMM14 = 116;
UC_X86_REG_XMM15 = 117;
UC_X86_REG_XMM16 = 118;
UC_X86_REG_XMM17 = 119;
UC_X86_REG_XMM18 = 120;
UC_X86_REG_XMM19 = 121;
UC_X86_REG_XMM20 = 122;
UC_X86_REG_XMM21 = 123;
UC_X86_REG_XMM22 = 124;
UC_X86_REG_XMM23 = 125;
UC_X86_REG_XMM24 = 126;
UC_X86_REG_XMM25 = 127;
UC_X86_REG_XMM26 = 128;
UC_X86_REG_XMM27 = 129;
UC_X86_REG_XMM28 = 130;
UC_X86_REG_XMM29 = 131;
UC_X86_REG_XMM30 = 132;
UC_X86_REG_XMM31 = 133;
UC_X86_REG_YMM0 = 134;
UC_X86_REG_YMM1 = 135;
UC_X86_REG_YMM2 = 136;
UC_X86_REG_YMM3 = 137;
UC_X86_REG_YMM4 = 138;
UC_X86_REG_YMM5 = 139;
UC_X86_REG_YMM6 = 140;
UC_X86_REG_YMM7 = 141;
UC_X86_REG_YMM8 = 142;
UC_X86_REG_YMM9 = 143;
UC_X86_REG_YMM10 = 144;
UC_X86_REG_YMM11 = 145;
UC_X86_REG_YMM12 = 146;
UC_X86_REG_YMM13 = 147;
UC_X86_REG_YMM14 = 148;
UC_X86_REG_YMM15 = 149;
UC_X86_REG_YMM16 = 150;
UC_X86_REG_YMM17 = 151;
UC_X86_REG_YMM18 = 152;
UC_X86_REG_YMM19 = 153;
UC_X86_REG_YMM20 = 154;
UC_X86_REG_YMM21 = 155;
UC_X86_REG_YMM22 = 156;
UC_X86_REG_YMM23 = 157;
UC_X86_REG_YMM24 = 158;
UC_X86_REG_YMM25 = 159;
UC_X86_REG_YMM26 = 160;
UC_X86_REG_YMM27 = 161;
UC_X86_REG_YMM28 = 162;
UC_X86_REG_YMM29 = 163;
UC_X86_REG_YMM30 = 164;
UC_X86_REG_YMM31 = 165;
UC_X86_REG_ZMM0 = 166;
UC_X86_REG_ZMM1 = 167;
UC_X86_REG_ZMM2 = 168;
UC_X86_REG_ZMM3 = 169;
UC_X86_REG_ZMM4 = 170;
UC_X86_REG_ZMM5 = 171;
UC_X86_REG_ZMM6 = 172;
UC_X86_REG_ZMM7 = 173;
UC_X86_REG_ZMM8 = 174;
UC_X86_REG_ZMM9 = 175;
UC_X86_REG_ZMM10 = 176;
UC_X86_REG_ZMM11 = 177;
UC_X86_REG_ZMM12 = 178;
UC_X86_REG_ZMM13 = 179;
UC_X86_REG_ZMM14 = 180;
UC_X86_REG_ZMM15 = 181;
UC_X86_REG_ZMM16 = 182;
UC_X86_REG_ZMM17 = 183;
UC_X86_REG_ZMM18 = 184;
UC_X86_REG_ZMM19 = 185;
UC_X86_REG_ZMM20 = 186;
UC_X86_REG_ZMM21 = 187;
UC_X86_REG_ZMM22 = 188;
UC_X86_REG_ZMM23 = 189;
UC_X86_REG_ZMM24 = 190;
UC_X86_REG_ZMM25 = 191;
UC_X86_REG_ZMM26 = 192;
UC_X86_REG_ZMM27 = 193;
UC_X86_REG_ZMM28 = 194;
UC_X86_REG_ZMM29 = 195;
UC_X86_REG_ZMM30 = 196;
UC_X86_REG_ZMM31 = 197;
UC_X86_REG_R8B = 198;
UC_X86_REG_R9B = 199;
UC_X86_REG_R10B = 200;
UC_X86_REG_R11B = 201;
UC_X86_REG_R12B = 202;
UC_X86_REG_R13B = 203;
UC_X86_REG_R14B = 204;
UC_X86_REG_R15B = 205;
UC_X86_REG_R8D = 206;
UC_X86_REG_R9D = 207;
UC_X86_REG_R10D = 208;
UC_X86_REG_R11D = 209;
UC_X86_REG_R12D = 210;
UC_X86_REG_R13D = 211;
UC_X86_REG_R14D = 212;
UC_X86_REG_R15D = 213;
UC_X86_REG_R8W = 214;
UC_X86_REG_R9W = 215;
UC_X86_REG_R10W = 216;
UC_X86_REG_R11W = 217;
UC_X86_REG_R12W = 218;
UC_X86_REG_R13W = 219;
UC_X86_REG_R14W = 220;
UC_X86_REG_R15W = 221;
UC_X86_REG_IDTR = 222;
UC_X86_REG_GDTR = 223;
UC_X86_REG_LDTR = 224;
UC_X86_REG_TR = 225;
UC_X86_REG_FPCW = 226;
UC_X86_REG_FPTAG = 227;
UC_X86_REG_MSR = 228;
UC_X86_REG_MXCSR = 229;
UC_X86_REG_FS_BASE = 230;
UC_X86_REG_GS_BASE = 231;
UC_X86_REG_FLAGS = 232;
UC_X86_REG_RFLAGS = 233;
UC_X86_REG_FIP = 234;
UC_X86_REG_FCS = 235;
UC_X86_REG_FDP = 236;
UC_X86_REG_FDS = 237;
UC_X86_REG_FOP = 238;
UC_X86_REG_ENDING = 239;
// X86 instructions

View File

@ -3,16 +3,16 @@
.PHONY: gen_const install install3 clean sdist sdist3 bdist bdist3 sdist_win bdist_win
gen_const:
cd .. && python const_generator.py python
cd .. && python3 const_generator.py python
install:
rm -rf src/ dist/
rm -rf prebuilt/win64/unicorn.dll
rm -rf prebuilt/win32/unicorn.dll
if test -n "${DESTDIR}"; then \
python setup.py install --root="${DESTDIR}"; \
python3 setup.py install --root="${DESTDIR}"; \
else \
python setup.py install; \
python3 setup.py install; \
fi
install3:
@ -30,7 +30,7 @@ sdist:
rm -rf src/ dist/
rm -rf prebuilt/win64/unicorn.dll
rm -rf prebuilt/win32/unicorn.dll
python setup.py sdist register upload
python3 setup.py sdist register upload
# build & upload PyPi package with source code of the core
sdist3:
@ -44,7 +44,7 @@ bdist:
rm -rf src/ dist/
rm -rf prebuilt/win64/unicorn.dll
rm -rf prebuilt/win32/unicorn.dll
python setup.py bdist_wheel register upload
python3 setup.py bdist_wheel register upload
# build & upload PyPi package with precompiled core
bdist3:
@ -57,7 +57,7 @@ bdist3:
# NOTE: be sure to have precompiled core under prebuilt/win*/ beforehand
sdist_win:
rm -rf src/ dist/
python setup.py sdist register upload
python3 setup.py sdist register upload
# build & upload PyPi package with prebuilt core
# NOTE: be sure to have precompiled core under prebuilt/win*/ beforehand

View File

@ -45,7 +45,7 @@ def test_arm64():
# tracing all basic blocks with customized callback
mu.hook_add(UC_HOOK_BLOCK, hook_block)
# tracing one instruction at ADDRESS with customized callback
# tracing one instruction with customized callback
mu.hook_add(UC_HOOK_CODE, hook_code, begin=ADDRESS, end=ADDRESS)
# emulate machine code in infinite time

View File

@ -0,0 +1,122 @@
# Unicorn Emulator Engine
# By Lazymio(@wtdcode), 2021
from unicorn import *
from unicorn.unicorn import UC_HOOK_EDGE_GEN_CB
from unicorn.x86_const import *
from datetime import datetime
def test_uc_ctl_read():
uc = Uc(UC_ARCH_X86, UC_MODE_32)
print("Reading some properties by uc_ctl.")
arch = uc.ctl_get_arch()
mode = uc.ctl_get_mode()
page_size = uc.ctl_get_page_size()
timeout = uc.ctl_get_timeout()
print(f">>> arch={arch} mode={mode} page size={page_size} timeout={timeout}")
def time_emulation(uc, start, end):
n = datetime.now()
uc.emu_start(start, end)
return (datetime.now() - n).total_seconds() * 1e6
def test_uc_ctl_tb_cache():
# Initialize emulator in X86-32bit mode
uc = Uc(UC_ARCH_X86, UC_MODE_32)
addr = 0x10000
# Fill the code buffer with NOP.
code = b"\x90" * 8 * 512
print("Controling the TB cache in a finer granularity by uc_ctl.")
uc.mem_map(addr, 0x10000)
# Write our code to the memory.
uc.mem_write(addr, code)
# Do emulation without any cache.
standard = time_emulation(uc, addr, addr + len(code))
# Now we request cache for all TBs.
for i in range(8):
tb = uc.ctl_request_cache(addr + i * 512)
print(f">>> TB is cached at {hex(tb.pc)} which has {tb.icount} instructions with {tb.size} bytes")
# Do emulation with all TB cached.
cached = time_emulation(uc, addr, addr + len(code))
# Now we clear cache for all TBs.
for i in range(8):
uc.ctl_remove_cache(addr + i * 512)
evicted = time_emulation(uc, addr, addr + len(code))
print(f">>> Run time: First time {standard}, Cached: {cached}, Cached evicted: {evicted}")
def trace_new_edge(uc, cur, prev, data):
print(f">>> Getting a new edge from {hex(prev.pc + prev.size - 1)} to {hex(cur.pc)}")
def trace_tcg_sub(uc, address, arg1, arg2, data):
print(f">>> Get a tcg sub opcode at {hex(address)} with args: {arg1} and {arg2}")
def test_uc_ctl_exits():
uc = Uc(UC_ARCH_X86, UC_MODE_32)
addr = 0x1000
# cmp eax, 0;
# jg lb;
# inc eax;
# nop;
# lb:
# inc ebx;
# nop;
code = b"\x83\xf8\x00\x7f\x02\x40\x90\x43\x90"
exits = [addr + 6, addr + 8]
print("Using multiple exits by uc_ctl")
uc.mem_map(addr, 0x1000)
# Write our code to the memory.
uc.mem_write(addr, code)
# We trace if any new edge is generated.
uc.hook_add(UC_HOOK_EDGE_GENERATED, trace_new_edge)
# Trace cmp instruction.
uc.hook_add(UC_HOOK_TCG_OPCODE, trace_tcg_sub, UC_TCG_OP_SUB, UC_TCG_OP_FLAG_CMP)
uc.ctl_exits_enabled(True)
uc.ctl_set_exits(exits)
# This should stop at ADDRESS + 6 and increase eax, even thouhg we don't provide an exit.
uc.emu_start(addr, 0)
eax = uc.reg_read(UC_X86_REG_EAX)
ebx = uc.reg_read(UC_X86_REG_EBX)
print(f">>> eax = {hex(eax)} and ebx = {hex(ebx)} after the first emulation")
# This should stop at ADDRESS + 8, even thouhg we don't provide an exit.
uc.emu_start(addr, 0)
eax = uc.reg_read(UC_X86_REG_EAX)
ebx = uc.reg_read(UC_X86_REG_EBX)
print(f">>> eax = {hex(eax)} and ebx = {hex(ebx)} after the first emulation")
if __name__ == "__main__":
test_uc_ctl_read()
print("="*32)
test_uc_ctl_tb_cache()
print("="*32)
test_uc_ctl_exits()

65
bindings/python/sample_ppc.py Executable file
View File

@ -0,0 +1,65 @@
#!/usr/bin/env python
# Sample code for PPC of Unicorn. Nguyen Anh Quynh <aquynh@gmail.com>
#
from __future__ import print_function
from unicorn import *
from unicorn.ppc_const import *
# code to be emulated
PPC_CODE = b"\x7F\x46\x1A\x14" # add r26, r6, r3
# memory address where emulation starts
ADDRESS = 0x10000
# callback for tracing basic blocks
def hook_block(uc, address, size, user_data):
print(">>> Tracing basic block at 0x%x, block size = 0x%x" %(address, size))
# callback for tracing instructions
def hook_code(uc, address, size, user_data):
print(">>> Tracing instruction at 0x%x, instruction size = 0x%x" %(address, size))
# Test PPC
def test_ppc():
print("Emulate PPC code")
try:
# Initialize emulator in PPC EB mode
mu = Uc(UC_ARCH_PPC, UC_MODE_PPC32 | UC_MODE_BIG_ENDIAN)
# map 2MB memory for this emulation
mu.mem_map(ADDRESS, 2 * 1024 * 1024)
# write machine code to be emulated to memory
mu.mem_write(ADDRESS, PPC_CODE)
# initialize machine registers
mu.reg_write(UC_PPC_REG_3, 0x1234)
mu.reg_write(UC_PPC_REG_6, 0x6789)
mu.reg_write(UC_PPC_REG_26, 0x5555)
# tracing all basic blocks with customized callback
mu.hook_add(UC_HOOK_BLOCK, hook_block)
# tracing all instructions with customized callback
mu.hook_add(UC_HOOK_CODE, hook_code)
# emulate machine code in infinite time
mu.emu_start(ADDRESS, ADDRESS + len(PPC_CODE))
# now print out some registers
print(">>> Emulation done. Below is the CPU context")
r26 = mu.reg_read(UC_PPC_REG_26)
print(">>> r26 = 0x%x" % r26)
except UcError as e:
print("ERROR: %s" % e)
if __name__ == '__main__':
test_ppc()

71
bindings/python/sample_riscv.py Executable file
View File

@ -0,0 +1,71 @@
#!/usr/bin/env python
# Sample code for RISCV of Unicorn. Nguyen Anh Quynh <aquynh@gmail.com>
#
from __future__ import print_function
from unicorn import *
from unicorn.riscv_const import *
'''
$ cstool riscv64 1305100093850502
0 13 05 10 00 addi a0, zero, 1
4 93 85 05 02 addi a1, a1, 0x20
'''
RISCV_CODE = b"\x13\x05\x10\x00\x93\x85\x05\x02"
# memory address where emulation starts
ADDRESS = 0x10000
# callback for tracing basic blocks
def hook_block(uc, address, size, user_data):
print(">>> Tracing basic block at 0x%x, block size = 0x%x" %(address, size))
# callback for tracing instructions
def hook_code(uc, address, size, user_data):
print(">>> Tracing instruction at 0x%x, instruction size = 0x%x" %(address, size))
# Test RISCV
def test_riscv():
print("Emulate RISCV code")
try:
# Initialize emulator in RISCV32 mode
mu = Uc(UC_ARCH_RISCV, UC_MODE_RISCV32)
# map 2MB memory for this emulation
mu.mem_map(ADDRESS, 2 * 1024 * 1024)
# write machine code to be emulated to memory
mu.mem_write(ADDRESS, RISCV_CODE)
# initialize machine registers
mu.reg_write(UC_RISCV_REG_A0, 0x1234)
mu.reg_write(UC_RISCV_REG_A1, 0x7890)
# tracing all basic blocks with customized callback
mu.hook_add(UC_HOOK_BLOCK, hook_block)
# tracing all instructions with customized callback
mu.hook_add(UC_HOOK_CODE, hook_code)
# emulate machine code in infinite time
mu.emu_start(ADDRESS, ADDRESS + len(RISCV_CODE))
# now print out some registers
print(">>> Emulation done. Below is the CPU context")
a0 = mu.reg_read(UC_RISCV_REG_A0)
a1 = mu.reg_read(UC_RISCV_REG_A1)
print(">>> A0 = 0x%x" %a0)
print(">>> A1 = 0x%x" %a1)
except UcError as e:
print("ERROR: %s" % e)
if __name__ == '__main__':
test_riscv()

View File

@ -0,0 +1,62 @@
#!/usr/bin/env python
from unicorn import *
from unicorn.s390x_const import *
# lr %r2, %r3
S390X_CODE = b"\x18\x23"
# memory address where emulation starts
ADDRESS = 0x10000
# callback for tracing basic blocks
def hook_block(uc, address, size, user_data):
print(">>> Tracing basic block at 0x%x, block size = 0x%x" %(address, size))
# callback for tracing instructions
def hook_code(uc, address, size, user_data):
print(">>> Tracing instruction at 0x%x, instruction size = 0x%x" %(address, size))
# Test RISCV
def test_s390x():
print("Emulate S390X code")
try:
# Initialize emulator in big endian mode
mu = Uc(UC_ARCH_S390X, UC_MODE_BIG_ENDIAN)
# map 2MB memory for this emulation
mu.mem_map(ADDRESS, 2 * 1024 * 1024)
# write machine code to be emulated to memory
mu.mem_write(ADDRESS, S390X_CODE)
# initialize machine registers
mu.reg_write(UC_S390X_REG_R3, 0x7890)
# tracing all basic blocks with customized callback
mu.hook_add(UC_HOOK_BLOCK, hook_block)
# tracing all instructions with customized callback
mu.hook_add(UC_HOOK_CODE, hook_code)
# emulate machine code in infinite time
mu.emu_start(ADDRESS, ADDRESS + len(S390X_CODE))
# now print out some registers
print(">>> Emulation done. Below is the CPU context")
r2 = mu.reg_read(UC_S390X_REG_R2)
r3 = mu.reg_read(UC_S390X_REG_R3)
print(">>> R2 = 0x%x" % r2)
print(">>> R3 = 0x%x" % r3)
except UcError as e:
print("ERROR: %s" % e)
if __name__ == '__main__':
test_s390x()

View File

@ -16,6 +16,7 @@ X86_CODE64 = b"\x41\xBC\x3B\xB0\x28\x2A\x49\x0F\xC9\x90\x4D\x0F\xAD\xCF\x49\x87\
X86_CODE32_INOUT = b"\x41\xE4\x3F\x4a\xE6\x46\x43" # INC ecx; IN AL, 0x3f; DEC edx; OUT 0x46, AL; INC ebx
X86_CODE64_SYSCALL = b'\x0f\x05' # SYSCALL
X86_CODE16 = b'\x00\x00' # add byte ptr [bx + si], al
X86_MMIO_CODE = b"\x89\x0d\x04\x00\x02\x00\x8b\x0d\x04\x00\x02\x00" # mov [0x20004], ecx; mov ecx, [0x20004]
# memory address where emulation starts
ADDRESS = 0x1000000
@ -386,7 +387,6 @@ def test_i386_loop():
except UcError as e:
print("ERROR: %s" % e)
# Test X86 32 bit with IN/OUT instruction
def test_i386_inout():
print("Emulate i386 code with IN/OUT instructions")
@ -464,6 +464,9 @@ def test_i386_context_save():
print(">>> Unpickling CPU context")
saved_context = pickle.loads(pickled_saved_context)
print(">>> Modifying some register.")
saved_context.reg_write(UC_X86_REG_EAX, 0xc8c8)
print(">>> CPU context restored. Below is the CPU context")
mu.context_restore(saved_context)
print(">>> EAX = 0x%x" %(mu.reg_read(UC_X86_REG_EAX)))
@ -628,6 +631,38 @@ def test_x86_16():
except UcError as e:
print("ERROR: %s" % e)
def mmio_read_cb(uc, offset, size, data):
print(f">>> Read IO memory at offset {hex(offset)} with {hex(size)} bytes and return 0x19260817")
return 0x19260817
def mmio_write_cb(uc, offset, size, value, data):
print(f">>> Write value {hex(value)} to IO memory at offset {hex(offset)} with {hex(size)} bytes")
def test_i386_mmio():
print("Test i386 IO memory")
try:
# Initialize emulator in X86-32bit mode
mu = Uc(UC_ARCH_X86, UC_MODE_32)
# map 8KB memory for this emulation and write the code
mu.mem_map(0x10000, 0x8000)
mu.mem_write(0x10000, X86_MMIO_CODE)
# map the IO memory
mu.mmio_map(0x20000, 0x4000, mmio_read_cb, None, mmio_write_cb, None)
# prepare registers.
mu.reg_write(UC_X86_REG_ECX, 0xdeadbeef)
# emulate machine code in infinite time
mu.emu_start(0x10000, 0x10000 + len(X86_MMIO_CODE))
# now print out some registers
print(f">>> Emulation done. ECX={hex(mu.reg_read(UC_X86_REG_ECX))}")
except UcError as e:
print("ERROR: %s" % e)
if __name__ == '__main__':
test_x86_16()
@ -651,3 +686,5 @@ if __name__ == '__main__':
test_x86_64()
print("=" * 35)
test_x86_64_syscall()
print("=" * 35)
test_i386_mmio()

View File

@ -15,7 +15,6 @@ from distutils.util import get_platform
from distutils.command.build import build
from distutils.command.sdist import sdist
from setuptools.command.bdist_egg import bdist_egg
from setuptools.command.develop import develop
SYSTEM = sys.platform
@ -23,52 +22,21 @@ SYSTEM = sys.platform
IS_64BITS = platform.architecture()[0] == '64bit'
# are we building from the repository or from a source distribution?
ROOT_DIR = os.path.dirname(os.path.abspath(__file__))
ROOT_DIR = os.path.dirname(os.path.realpath(__file__))
LIBS_DIR = os.path.join(ROOT_DIR, 'unicorn', 'lib')
HEADERS_DIR = os.path.join(ROOT_DIR, 'unicorn', 'include')
SRC_DIR = os.path.join(ROOT_DIR, 'src')
BUILD_DIR = SRC_DIR if os.path.exists(SRC_DIR) else os.path.join(ROOT_DIR, '../..')
UC_DIR = os.path.join(ROOT_DIR, '../..')
BUILD_DIR = os.path.join(UC_DIR, 'build_python')
# Parse version from pkgconfig.mk
VERSION_DATA = {}
with open(os.path.join(BUILD_DIR, 'pkgconfig.mk')) as fp:
lines = fp.readlines()
for line in lines:
line = line.strip()
if len(line) == 0:
continue
if line.startswith('#'):
continue
if '=' not in line:
continue
k, v = line.split('=', 1)
k = k.strip()
v = v.strip()
if len(k) == 0 or len(v) == 0:
continue
VERSION_DATA[k] = v
if 'PKG_MAJOR' not in VERSION_DATA or \
'PKG_MINOR' not in VERSION_DATA or \
'PKG_EXTRA' not in VERSION_DATA:
raise Exception("Malformed pkgconfig.mk")
if 'PKG_TAG' in VERSION_DATA:
VERSION = '{PKG_MAJOR}.{PKG_MINOR}.{PKG_EXTRA}.{PKG_TAG}'.format(**VERSION_DATA)
else:
VERSION = '{PKG_MAJOR}.{PKG_MINOR}.{PKG_EXTRA}'.format(**VERSION_DATA)
VERSION = "2.0.0rc5.post1"
if SYSTEM == 'darwin':
LIBRARY_FILE = "libunicorn.dylib"
MAC_LIBRARY_FILE = "libunicorn*.dylib"
STATIC_LIBRARY_FILE = None
elif SYSTEM == 'win32':
elif SYSTEM in ('win32', 'cygwin'):
LIBRARY_FILE = "unicorn.dll"
STATIC_LIBRARY_FILE = "unicorn.lib"
elif SYSTEM == 'cygwin':
LIBRARY_FILE = "cygunicorn.dll"
STATIC_LIBRARY_FILE = None
else:
LIBRARY_FILE = "libunicorn.so"
STATIC_LIBRARY_FILE = None
@ -84,7 +52,6 @@ def copy_sources():
"""
src = []
os.system('make -C %s clean' % os.path.join(ROOT_DIR, '../..'))
shutil.rmtree(SRC_DIR, ignore_errors=True)
os.mkdir(SRC_DIR)
@ -103,14 +70,10 @@ def copy_sources():
src.extend(glob.glob(os.path.join(ROOT_DIR, "../../*.[ch]")))
src.extend(glob.glob(os.path.join(ROOT_DIR, "../../*.mk")))
src.extend(glob.glob(os.path.join(ROOT_DIR, "../../Makefile")))
src.extend(glob.glob(os.path.join(ROOT_DIR, "../../LICENSE*")))
src.extend(glob.glob(os.path.join(ROOT_DIR, "../../README.md")))
src.extend(glob.glob(os.path.join(ROOT_DIR, "../../*.TXT")))
src.extend(glob.glob(os.path.join(ROOT_DIR, "../../RELEASE_NOTES")))
src.extend(glob.glob(os.path.join(ROOT_DIR, "../../make.sh")))
src.extend(glob.glob(os.path.join(ROOT_DIR, "../../CMakeLists.txt")))
src.extend(glob.glob(os.path.join(ROOT_DIR, "../../pkgconfig.mk")))
for filename in src:
outpath = os.path.join(SRC_DIR, os.path.basename(filename))
@ -130,7 +93,7 @@ def build_libraries():
os.mkdir(LIBS_DIR)
# copy public headers
shutil.copytree(os.path.join(BUILD_DIR, 'include', 'unicorn'), os.path.join(HEADERS_DIR, 'unicorn'))
shutil.copytree(os.path.join(UC_DIR, 'include', 'unicorn'), os.path.join(HEADERS_DIR, 'unicorn'))
# check if a prebuilt library exists
# if so, use it instead of building
@ -141,61 +104,54 @@ def build_libraries():
return
# otherwise, build!!
os.chdir(BUILD_DIR)
os.chdir(UC_DIR)
try:
subprocess.check_call(['msbuild', '-ver'])
subprocess.check_call(['msbuild', '/help'])
except:
has_msbuild = False
else:
has_msbuild = True
if has_msbuild and SYSTEM == 'win32':
if platform.architecture()[0] == '32bit':
plat = 'Win32'
elif 'win32' in sys.argv:
plat = 'Win32'
else:
plat = 'x64'
plat = 'Win32' if platform.architecture()[0] == '32bit' else 'x64'
conf = 'Debug' if os.getenv('DEBUG', '') else 'Release'
subprocess.call(['msbuild', 'unicorn.sln', '-m', '-p:Platform=' + plat, '-p:Configuration=' + conf], cwd=os.path.join(BUILD_DIR, 'msvc'))
if not os.path.exists(BUILD_DIR):
os.mkdir(BUILD_DIR)
subprocess.check_call(['cmake', '-B', BUILD_DIR, '-G', "Visual Studio 16 2019", "-A", plat, "-DCMAKE_BUILD_TYPE=" + conf])
subprocess.check_call(['msbuild', 'unicorn.sln', '-m', '-p:Platform=' + plat, '-p:Configuration=' + conf], cwd=BUILD_DIR)
obj_dir = os.path.join(BUILD_DIR, 'msvc', plat, conf)
obj_dir = os.path.join(BUILD_DIR, conf)
shutil.copy(os.path.join(obj_dir, LIBRARY_FILE), LIBS_DIR)
shutil.copy(os.path.join(obj_dir, STATIC_LIBRARY_FILE), LIBS_DIR)
else:
# platform description refs at https://docs.python.org/2/library/sys.html#sys.platform
new_env = dict(os.environ)
new_env['UNICORN_BUILD_CORE_ONLY'] = 'yes'
cmd = ['sh', './make.sh']
if SYSTEM == "win32":
if IS_64BITS:
cmd.append('cross-win64')
else:
cmd.append('cross-win32')
if not os.path.exists(BUILD_DIR):
os.mkdir(BUILD_DIR)
conf = 'Debug' if os.getenv('DEBUG', '') else 'Release'
subprocess.call(cmd, env=new_env)
if SYSTEM == 'darwin':
for file in glob.glob(MAC_LIBRARY_FILE):
try:
shutil.copy(file, LIBS_DIR, follow_symlinks=False)
except:
shutil.copy(file, LIBS_DIR)
else:
shutil.copy(LIBRARY_FILE, LIBS_DIR)
cmake_args = ["cmake", '-B', BUILD_DIR, "-DCMAKE_BUILD_TYPE=" + conf]
if os.getenv("TRACE", ""):
cmake_args += ["-DUNICORN_TRACER=on"]
subprocess.check_call(cmake_args)
os.chdir(BUILD_DIR)
threads = os.getenv("THREADS", "4")
subprocess.check_call(["cmake", "--build", ".", "-j" + threads])
shutil.copy(LIBRARY_FILE, LIBS_DIR)
try:
# static library may fail to build on windows if user doesn't have visual studio installed. this is fine.
if STATIC_LIBRARY_FILE is not None:
shutil.copy(STATIC_LIBRARY_FILE, LIBS_DIR)
except:
except FileNotFoundError:
print('Warning: Could not build static library file! This build is not appropriate for a binary distribution')
# enforce this
if 'upload' in sys.argv:
sys.exit(1)
os.chdir(cwd)
class custom_sdist(sdist):
def run(self):
clean_bins()
@ -211,12 +167,6 @@ class custom_build(build):
build_libraries()
return build.run(self)
class custom_develop(develop):
def run(self):
log.info("Building C extensions")
build_libraries()
return develop.run(self)
class custom_bdist_egg(bdist_egg):
def run(self):
self.run_command('build')
@ -225,6 +175,10 @@ class custom_bdist_egg(bdist_egg):
def dummy_src():
return []
cmdclass = {}
cmdclass['build'] = custom_build
cmdclass['sdist'] = custom_sdist
cmdclass['bdist_egg'] = custom_bdist_egg
if 'bdist_wheel' in sys.argv and '--plat-name' not in sys.argv:
idx = sys.argv.index('bdist_wheel') + 1
@ -245,14 +199,28 @@ if 'bdist_wheel' in sys.argv and '--plat-name' not in sys.argv:
# https://www.python.org/dev/peps/pep-0425/
sys.argv.insert(idx + 1, name.replace('.', '_').replace('-', '_'))
try:
from setuptools.command.develop import develop
class custom_develop(develop):
def run(self):
log.info("Building C extensions")
build_libraries()
return develop.run(self)
cmdclass['develop'] = custom_develop
except ImportError:
print("Proper 'develop' support unavailable.")
def join_all(src, files):
return tuple(os.path.join(src, f) for f in files)
long_desc = '''
Unicorn is a lightweight, multi-platform, multi-architecture CPU emulator framework
based on [QEMU](https://qemu.org).
based on [QEMU](http://qemu.org).
Unicorn offers some unparalleled features:
- Multi-architecture: ARM, ARM64 (ARMv8), M68K, MIPS, SPARC, and X86 (16, 32, 64-bit)
- Multi-architecture: ARM, ARM64 (ARMv8), M68K, MIPS, PowerPC, SPARC and X86 (16, 32, 64-bit)
- Clean/simple/lightweight/intuitive architecture-neutral API
- Implemented in pure C language, with bindings for Crystal, Clojure, Visual Basic, Perl, Rust, Ruby, Python, Java, .NET, Go, Delphi/Free Pascal, Haskell, Pharo, and Lua.
- Native support for Windows & *nix (with Mac OSX, Linux, *BSD & Solaris confirmed)
@ -261,7 +229,7 @@ Unicorn offers some unparalleled features:
- Thread-safety by design
- Distributed under free software license GPLv2
Further information is available at https://www.unicorn-engine.org
Further information is available at http://www.unicorn-engine.org
'''
setup(
@ -274,14 +242,14 @@ setup(
description='Unicorn CPU emulator engine',
long_description=long_desc,
long_description_content_type="text/markdown",
url='https://www.unicorn-engine.org',
url='http://www.unicorn-engine.org',
classifiers=[
'License :: OSI Approved :: BSD License',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 3',
],
requires=['ctypes'],
cmdclass={'build': custom_build, 'develop': custom_develop, 'sdist': custom_sdist, 'bdist_egg': custom_bdist_egg},
cmdclass=cmdclass,
zip_safe=False,
include_package_data=True,
is_pure=False,

View File

@ -1,5 +1,12 @@
# For Unicorn Engine. AUTO-GENERATED FILE, DO NOT EDIT [arm64_const.py]
# ARM64 CPU
UC_CPU_AARCH64_A57 = 0
UC_CPU_AARCH64_A53 = 1
UC_CPU_AARCH64_A72 = 2
UC_CPU_AARCH64_MAX = 3
# ARM64 registers
UC_ARM64_REG_INVALID = 0

View File

@ -1,5 +1,42 @@
# For Unicorn Engine. AUTO-GENERATED FILE, DO NOT EDIT [arm_const.py]
# ARM CPU
UC_CPU_ARM_926 = 0
UC_CPU_ARM_946 = 1
UC_CPU_ARM_1026 = 2
UC_CPU_ARM_1136_R2 = 3
UC_CPU_ARM_1136 = 4
UC_CPU_ARM_1176 = 5
UC_CPU_ARM_11MPCORE = 6
UC_CPU_ARM_CORTEX_M0 = 7
UC_CPU_ARM_CORTEX_M3 = 8
UC_CPU_ARM_CORTEX_M4 = 9
UC_CPU_ARM_CORTEX_M7 = 10
UC_CPU_ARM_CORTEX_M33 = 11
UC_CPU_ARM_CORTEX_R5 = 12
UC_CPU_ARM_CORTEX_R5F = 13
UC_CPU_ARM_CORTEX_A7 = 14
UC_CPU_ARM_CORTEX_A8 = 15
UC_CPU_ARM_CORTEX_A9 = 16
UC_CPU_ARM_CORTEX_A15 = 17
UC_CPU_ARM_TI925T = 18
UC_CPU_ARM_SA1100 = 19
UC_CPU_ARM_SA1110 = 20
UC_CPU_ARM_PXA250 = 21
UC_CPU_ARM_PXA255 = 22
UC_CPU_ARM_PXA260 = 23
UC_CPU_ARM_PXA261 = 24
UC_CPU_ARM_PXA262 = 25
UC_CPU_ARM_PXA270 = 26
UC_CPU_ARM_PXA270A0 = 27
UC_CPU_ARM_PXA270A1 = 28
UC_CPU_ARM_PXA270B0 = 29
UC_CPU_ARM_PXA270B1 = 30
UC_CPU_ARM_PXA270C0 = 31
UC_CPU_ARM_PXA270C5 = 32
UC_CPU_ARM_MAX = 33
# ARM registers
UC_ARM_REG_INVALID = 0
@ -120,7 +157,28 @@ UC_ARM_REG_IPSR = 114
UC_ARM_REG_MSP = 115
UC_ARM_REG_PSP = 116
UC_ARM_REG_CONTROL = 117
UC_ARM_REG_ENDING = 118
UC_ARM_REG_IAPSR = 118
UC_ARM_REG_EAPSR = 119
UC_ARM_REG_XPSR = 120
UC_ARM_REG_EPSR = 121
UC_ARM_REG_IEPSR = 122
UC_ARM_REG_PRIMASK = 123
UC_ARM_REG_BASEPRI = 124
UC_ARM_REG_BASEPRI_MAX = 125
UC_ARM_REG_FAULTMASK = 126
UC_ARM_REG_APSR_NZCVQ = 127
UC_ARM_REG_APSR_G = 128
UC_ARM_REG_APSR_NZCVQG = 129
UC_ARM_REG_IAPSR_NZCVQ = 130
UC_ARM_REG_IAPSR_G = 131
UC_ARM_REG_IAPSR_NZCVQG = 132
UC_ARM_REG_EAPSR_NZCVQ = 133
UC_ARM_REG_EAPSR_G = 134
UC_ARM_REG_EAPSR_NZCVQG = 135
UC_ARM_REG_XPSR_NZCVQ = 136
UC_ARM_REG_XPSR_G = 137
UC_ARM_REG_XPSR_NZCVQG = 138
UC_ARM_REG_ENDING = 139
# alias registers
UC_ARM_REG_R13 = 12

View File

@ -1,5 +1,17 @@
# For Unicorn Engine. AUTO-GENERATED FILE, DO NOT EDIT [m68k_const.py]
# M68K CPU
UC_CPU_M68K_M5206 = 0
UC_CPU_M68K_M68000 = 1
UC_CPU_M68K_M68020 = 2
UC_CPU_M68K_M68030 = 3
UC_CPU_M68K_M68040 = 4
UC_CPU_M68K_M68060 = 5
UC_CPU_M68K_M5208 = 6
UC_CPU_M68K_CFV4E = 7
UC_CPU_M68K_ANY = 8
# M68K registers
UC_M68K_REG_INVALID = 0

View File

@ -1,5 +1,40 @@
# For Unicorn Engine. AUTO-GENERATED FILE, DO NOT EDIT [mips_const.py]
# MIPS32 CPUS
UC_CPU_MIPS32_4KC = 0
UC_CPU_MIPS32_4KM = 1
UC_CPU_MIPS32_4KECR1 = 2
UC_CPU_MIPS32_4KEMR1 = 3
UC_CPU_MIPS32_4KEC = 4
UC_CPU_MIPS32_4KEM = 5
UC_CPU_MIPS32_24KC = 6
UC_CPU_MIPS32_24KEC = 7
UC_CPU_MIPS32_24KF = 8
UC_CPU_MIPS32_34KF = 9
UC_CPU_MIPS32_74KF = 10
UC_CPU_MIPS32_M14K = 11
UC_CPU_MIPS32_M14KC = 12
UC_CPU_MIPS32_P5600 = 13
UC_CPU_MIPS32_MIPS32R6_GENERIC = 14
UC_CPU_MIPS32_I7200 = 15
# MIPS64 CPUS
UC_CPU_MIPS64_R4000 = 0
UC_CPU_MIPS64_VR5432 = 1
UC_CPU_MIPS64_5KC = 2
UC_CPU_MIPS64_5KF = 3
UC_CPU_MIPS64_20KC = 4
UC_CPU_MIPS64_MIPS64R2_GENERIC = 5
UC_CPU_MIPS64_5KEC = 6
UC_CPU_MIPS64_5KEF = 7
UC_CPU_MIPS64_I6400 = 8
UC_CPU_MIPS64_I6500 = 9
UC_CPU_MIPS64_LOONGSON_2E = 10
UC_CPU_MIPS64_LOONGSON_2F = 11
UC_CPU_MIPS64_MIPS64DSPR2 = 12
# MIPS registers
UC_MIPS_REG_INVALID = 0
@ -153,7 +188,8 @@ UC_MIPS_REG_MPL1 = 135
UC_MIPS_REG_MPL2 = 136
UC_MIPS_REG_CP0_CONFIG3 = 137
UC_MIPS_REG_CP0_USERLOCAL = 138
UC_MIPS_REG_ENDING = 139
UC_MIPS_REG_CP0_STATUS = 139
UC_MIPS_REG_ENDING = 140
UC_MIPS_REG_ZERO = 2
UC_MIPS_REG_AT = 3
UC_MIPS_REG_V0 = 4

View File

@ -0,0 +1,400 @@
# For Unicorn Engine. AUTO-GENERATED FILE, DO NOT EDIT [ppc_const.py]
# PPC CPU
UC_CPU_PPC_401 = 0
UC_CPU_PPC_401A1 = 1
UC_CPU_PPC_401B2 = 2
UC_CPU_PPC_401C2 = 3
UC_CPU_PPC_401D2 = 4
UC_CPU_PPC_401E2 = 5
UC_CPU_PPC_401F2 = 6
UC_CPU_PPC_401G2 = 7
UC_CPU_PPC_IOP480 = 8
UC_CPU_PPC_COBRA = 9
UC_CPU_PPC_403GA = 10
UC_CPU_PPC_403GB = 11
UC_CPU_PPC_403GC = 12
UC_CPU_PPC_403GCX = 13
UC_CPU_PPC_405D2 = 14
UC_CPU_PPC_405D4 = 15
UC_CPU_PPC_405CRA = 16
UC_CPU_PPC_405CRB = 17
UC_CPU_PPC_405CRC = 18
UC_CPU_PPC_405EP = 19
UC_CPU_PPC_405EZ = 20
UC_CPU_PPC_405GPA = 21
UC_CPU_PPC_405GPB = 22
UC_CPU_PPC_405GPC = 23
UC_CPU_PPC_405GPD = 24
UC_CPU_PPC_405GPR = 25
UC_CPU_PPC_405LP = 26
UC_CPU_PPC_NPE405H = 27
UC_CPU_PPC_NPE405H2 = 28
UC_CPU_PPC_NPE405L = 29
UC_CPU_PPC_NPE4GS3 = 30
UC_CPU_PPC_STB03 = 31
UC_CPU_PPC_STB04 = 32
UC_CPU_PPC_STB25 = 33
UC_CPU_PPC_X2VP4 = 34
UC_CPU_PPC_X2VP20 = 35
UC_CPU_PPC_440_XILINX = 36
UC_CPU_PPC_440_XILINX_W_DFPU = 37
UC_CPU_PPC_440EPA = 38
UC_CPU_PPC_440EPB = 39
UC_CPU_PPC_440EPX = 40
UC_CPU_PPC_460EXB = 41
UC_CPU_PPC_G2 = 42
UC_CPU_PPC_G2H4 = 43
UC_CPU_PPC_G2GP = 44
UC_CPU_PPC_G2LS = 45
UC_CPU_PPC_G2HIP3 = 46
UC_CPU_PPC_G2HIP4 = 47
UC_CPU_PPC_MPC603 = 48
UC_CPU_PPC_G2LE = 49
UC_CPU_PPC_G2LEGP = 50
UC_CPU_PPC_G2LELS = 51
UC_CPU_PPC_G2LEGP1 = 52
UC_CPU_PPC_G2LEGP3 = 53
UC_CPU_PPC_MPC5200_V10 = 54
UC_CPU_PPC_MPC5200_V11 = 55
UC_CPU_PPC_MPC5200_V12 = 56
UC_CPU_PPC_MPC5200B_V20 = 57
UC_CPU_PPC_MPC5200B_V21 = 58
UC_CPU_PPC_E200Z5 = 59
UC_CPU_PPC_E200Z6 = 60
UC_CPU_PPC_E300C1 = 61
UC_CPU_PPC_E300C2 = 62
UC_CPU_PPC_E300C3 = 63
UC_CPU_PPC_E300C4 = 64
UC_CPU_PPC_MPC8343 = 65
UC_CPU_PPC_MPC8343A = 66
UC_CPU_PPC_MPC8343E = 67
UC_CPU_PPC_MPC8343EA = 68
UC_CPU_PPC_MPC8347T = 69
UC_CPU_PPC_MPC8347P = 70
UC_CPU_PPC_MPC8347AT = 71
UC_CPU_PPC_MPC8347AP = 72
UC_CPU_PPC_MPC8347ET = 73
UC_CPU_PPC_MPC8347EP = 74
UC_CPU_PPC_MPC8347EAT = 75
UC_CPU_PPC_MPC8347EAP = 76
UC_CPU_PPC_MPC8349 = 77
UC_CPU_PPC_MPC8349A = 78
UC_CPU_PPC_MPC8349E = 79
UC_CPU_PPC_MPC8349EA = 80
UC_CPU_PPC_MPC8377 = 81
UC_CPU_PPC_MPC8377E = 82
UC_CPU_PPC_MPC8378 = 83
UC_CPU_PPC_MPC8378E = 84
UC_CPU_PPC_MPC8379 = 85
UC_CPU_PPC_MPC8379E = 86
UC_CPU_PPC_E500_V10 = 87
UC_CPU_PPC_E500_V20 = 88
UC_CPU_PPC_E500V2_V10 = 89
UC_CPU_PPC_E500V2_V20 = 90
UC_CPU_PPC_E500V2_V21 = 91
UC_CPU_PPC_E500V2_V22 = 92
UC_CPU_PPC_E500V2_V30 = 93
UC_CPU_PPC_E500MC = 94
UC_CPU_PPC_MPC8533_V10 = 95
UC_CPU_PPC_MPC8533_V11 = 96
UC_CPU_PPC_MPC8533E_V10 = 97
UC_CPU_PPC_MPC8533E_V11 = 98
UC_CPU_PPC_MPC8540_V10 = 99
UC_CPU_PPC_MPC8540_V20 = 100
UC_CPU_PPC_MPC8540_V21 = 101
UC_CPU_PPC_MPC8541_V10 = 102
UC_CPU_PPC_MPC8541_V11 = 103
UC_CPU_PPC_MPC8541E_V10 = 104
UC_CPU_PPC_MPC8541E_V11 = 105
UC_CPU_PPC_MPC8543_V10 = 106
UC_CPU_PPC_MPC8543_V11 = 107
UC_CPU_PPC_MPC8543_V20 = 108
UC_CPU_PPC_MPC8543_V21 = 109
UC_CPU_PPC_MPC8543E_V10 = 110
UC_CPU_PPC_MPC8543E_V11 = 111
UC_CPU_PPC_MPC8543E_V20 = 112
UC_CPU_PPC_MPC8543E_V21 = 113
UC_CPU_PPC_MPC8544_V10 = 114
UC_CPU_PPC_MPC8544_V11 = 115
UC_CPU_PPC_MPC8544E_V10 = 116
UC_CPU_PPC_MPC8544E_V11 = 117
UC_CPU_PPC_MPC8545_V20 = 118
UC_CPU_PPC_MPC8545_V21 = 119
UC_CPU_PPC_MPC8545E_V20 = 120
UC_CPU_PPC_MPC8545E_V21 = 121
UC_CPU_PPC_MPC8547E_V20 = 122
UC_CPU_PPC_MPC8547E_V21 = 123
UC_CPU_PPC_MPC8548_V10 = 124
UC_CPU_PPC_MPC8548_V11 = 125
UC_CPU_PPC_MPC8548_V20 = 126
UC_CPU_PPC_MPC8548_V21 = 127
UC_CPU_PPC_MPC8548E_V10 = 128
UC_CPU_PPC_MPC8548E_V11 = 129
UC_CPU_PPC_MPC8548E_V20 = 130
UC_CPU_PPC_MPC8548E_V21 = 131
UC_CPU_PPC_MPC8555_V10 = 132
UC_CPU_PPC_MPC8555_V11 = 133
UC_CPU_PPC_MPC8555E_V10 = 134
UC_CPU_PPC_MPC8555E_V11 = 135
UC_CPU_PPC_MPC8560_V10 = 136
UC_CPU_PPC_MPC8560_V20 = 137
UC_CPU_PPC_MPC8560_V21 = 138
UC_CPU_PPC_MPC8567 = 139
UC_CPU_PPC_MPC8567E = 140
UC_CPU_PPC_MPC8568 = 141
UC_CPU_PPC_MPC8568E = 142
UC_CPU_PPC_MPC8572 = 143
UC_CPU_PPC_MPC8572E = 144
UC_CPU_PPC_E600 = 145
UC_CPU_PPC_MPC8610 = 146
UC_CPU_PPC_MPC8641 = 147
UC_CPU_PPC_MPC8641D = 148
UC_CPU_PPC_601_V0 = 149
UC_CPU_PPC_601_V1 = 150
UC_CPU_PPC_601_V2 = 151
UC_CPU_PPC_602 = 152
UC_CPU_PPC_603 = 153
UC_CPU_PPC_603E_V1_1 = 154
UC_CPU_PPC_603E_V1_2 = 155
UC_CPU_PPC_603E_V1_3 = 156
UC_CPU_PPC_603E_V1_4 = 157
UC_CPU_PPC_603E_V2_2 = 158
UC_CPU_PPC_603E_V3 = 159
UC_CPU_PPC_603E_V4 = 160
UC_CPU_PPC_603E_V4_1 = 161
UC_CPU_PPC_603E7 = 162
UC_CPU_PPC_603E7T = 163
UC_CPU_PPC_603E7V = 164
UC_CPU_PPC_603E7V1 = 165
UC_CPU_PPC_603E7V2 = 166
UC_CPU_PPC_603P = 167
UC_CPU_PPC_604 = 168
UC_CPU_PPC_604E_V1_0 = 169
UC_CPU_PPC_604E_V2_2 = 170
UC_CPU_PPC_604E_V2_4 = 171
UC_CPU_PPC_604R = 172
UC_CPU_PPC_740_V1_0 = 173
UC_CPU_PPC_750_V1_0 = 174
UC_CPU_PPC_740_V2_0 = 175
UC_CPU_PPC_750_V2_0 = 176
UC_CPU_PPC_740_V2_1 = 177
UC_CPU_PPC_750_V2_1 = 178
UC_CPU_PPC_740_V2_2 = 179
UC_CPU_PPC_750_V2_2 = 180
UC_CPU_PPC_740_V3_0 = 181
UC_CPU_PPC_750_V3_0 = 182
UC_CPU_PPC_740_V3_1 = 183
UC_CPU_PPC_750_V3_1 = 184
UC_CPU_PPC_740E = 185
UC_CPU_PPC_750E = 186
UC_CPU_PPC_740P = 187
UC_CPU_PPC_750P = 188
UC_CPU_PPC_750CL_V1_0 = 189
UC_CPU_PPC_750CL_V2_0 = 190
UC_CPU_PPC_750CX_V1_0 = 191
UC_CPU_PPC_750CX_V2_0 = 192
UC_CPU_PPC_750CX_V2_1 = 193
UC_CPU_PPC_750CX_V2_2 = 194
UC_CPU_PPC_750CXE_V2_1 = 195
UC_CPU_PPC_750CXE_V2_2 = 196
UC_CPU_PPC_750CXE_V2_3 = 197
UC_CPU_PPC_750CXE_V2_4 = 198
UC_CPU_PPC_750CXE_V2_4B = 199
UC_CPU_PPC_750CXE_V3_0 = 200
UC_CPU_PPC_750CXE_V3_1 = 201
UC_CPU_PPC_750CXE_V3_1B = 202
UC_CPU_PPC_750CXR = 203
UC_CPU_PPC_750FL = 204
UC_CPU_PPC_750FX_V1_0 = 205
UC_CPU_PPC_750FX_V2_0 = 206
UC_CPU_PPC_750FX_V2_1 = 207
UC_CPU_PPC_750FX_V2_2 = 208
UC_CPU_PPC_750FX_V2_3 = 209
UC_CPU_PPC_750GL = 210
UC_CPU_PPC_750GX_V1_0 = 211
UC_CPU_PPC_750GX_V1_1 = 212
UC_CPU_PPC_750GX_V1_2 = 213
UC_CPU_PPC_750L_V2_0 = 214
UC_CPU_PPC_750L_V2_1 = 215
UC_CPU_PPC_750L_V2_2 = 216
UC_CPU_PPC_750L_V3_0 = 217
UC_CPU_PPC_750L_V3_2 = 218
UC_CPU_PPC_745_V1_0 = 219
UC_CPU_PPC_755_V1_0 = 220
UC_CPU_PPC_745_V1_1 = 221
UC_CPU_PPC_755_V1_1 = 222
UC_CPU_PPC_745_V2_0 = 223
UC_CPU_PPC_755_V2_0 = 224
UC_CPU_PPC_745_V2_1 = 225
UC_CPU_PPC_755_V2_1 = 226
UC_CPU_PPC_745_V2_2 = 227
UC_CPU_PPC_755_V2_2 = 228
UC_CPU_PPC_745_V2_3 = 229
UC_CPU_PPC_755_V2_3 = 230
UC_CPU_PPC_745_V2_4 = 231
UC_CPU_PPC_755_V2_4 = 232
UC_CPU_PPC_745_V2_5 = 233
UC_CPU_PPC_755_V2_5 = 234
UC_CPU_PPC_745_V2_6 = 235
UC_CPU_PPC_755_V2_6 = 236
UC_CPU_PPC_745_V2_7 = 237
UC_CPU_PPC_755_V2_7 = 238
UC_CPU_PPC_745_V2_8 = 239
UC_CPU_PPC_755_V2_8 = 240
UC_CPU_PPC_7400_V1_0 = 241
UC_CPU_PPC_7400_V1_1 = 242
UC_CPU_PPC_7400_V2_0 = 243
UC_CPU_PPC_7400_V2_1 = 244
UC_CPU_PPC_7400_V2_2 = 245
UC_CPU_PPC_7400_V2_6 = 246
UC_CPU_PPC_7400_V2_7 = 247
UC_CPU_PPC_7400_V2_8 = 248
UC_CPU_PPC_7400_V2_9 = 249
UC_CPU_PPC_7410_V1_0 = 250
UC_CPU_PPC_7410_V1_1 = 251
UC_CPU_PPC_7410_V1_2 = 252
UC_CPU_PPC_7410_V1_3 = 253
UC_CPU_PPC_7410_V1_4 = 254
UC_CPU_PPC_7448_V1_0 = 255
UC_CPU_PPC_7448_V1_1 = 256
UC_CPU_PPC_7448_V2_0 = 257
UC_CPU_PPC_7448_V2_1 = 258
UC_CPU_PPC_7450_V1_0 = 259
UC_CPU_PPC_7450_V1_1 = 260
UC_CPU_PPC_7450_V1_2 = 261
UC_CPU_PPC_7450_V2_0 = 262
UC_CPU_PPC_7450_V2_1 = 263
UC_CPU_PPC_7441_V2_1 = 264
UC_CPU_PPC_7441_V2_3 = 265
UC_CPU_PPC_7451_V2_3 = 266
UC_CPU_PPC_7441_V2_10 = 267
UC_CPU_PPC_7451_V2_10 = 268
UC_CPU_PPC_7445_V1_0 = 269
UC_CPU_PPC_7455_V1_0 = 270
UC_CPU_PPC_7445_V2_1 = 271
UC_CPU_PPC_7455_V2_1 = 272
UC_CPU_PPC_7445_V3_2 = 273
UC_CPU_PPC_7455_V3_2 = 274
UC_CPU_PPC_7445_V3_3 = 275
UC_CPU_PPC_7455_V3_3 = 276
UC_CPU_PPC_7445_V3_4 = 277
UC_CPU_PPC_7455_V3_4 = 278
UC_CPU_PPC_7447_V1_0 = 279
UC_CPU_PPC_7457_V1_0 = 280
UC_CPU_PPC_7447_V1_1 = 281
UC_CPU_PPC_7457_V1_1 = 282
UC_CPU_PPC_7457_V1_2 = 283
UC_CPU_PPC_7447A_V1_0 = 284
UC_CPU_PPC_7457A_V1_0 = 285
UC_CPU_PPC_7447A_V1_1 = 286
UC_CPU_PPC_7457A_V1_1 = 287
UC_CPU_PPC_7447A_V1_2 = 288
UC_CPU_PPC_7457A_V1_2 = 289
# PPC64 CPU
UC_CPU_PPC_E5500 = 0
UC_CPU_PPC_E6500 = 1
UC_CPU_PPC_970_V2_2 = 2
UC_CPU_PPC_970FX_V1_0 = 3
UC_CPU_PPC_970FX_V2_0 = 4
UC_CPU_PPC_970FX_V2_1 = 5
UC_CPU_PPC_970FX_V3_0 = 6
UC_CPU_PPC_970FX_V3_1 = 7
UC_CPU_PPC_970MP_V1_0 = 8
UC_CPU_PPC_970MP_V1_1 = 9
UC_CPU_PPC_POWER5_V2_1 = 10
UC_CPU_PPC_POWER7_V2_3 = 11
UC_CPU_PPC_POWER7_V2_1 = 12
UC_CPU_PPC_POWER8E_V2_1 = 13
UC_CPU_PPC_POWER8_V2_0 = 14
UC_CPU_PPC_POWER8NVL_V1_0 = 15
UC_CPU_PPC_POWER9_V1_0 = 16
UC_CPU_PPC_POWER9_V2_0 = 17
UC_CPU_PPC_POWER10_V1_0 = 18
# PPC registers
UC_PPC_REG_INVALID = 0
# General purpose registers
UC_PPC_REG_PC = 1
UC_PPC_REG_0 = 2
UC_PPC_REG_1 = 3
UC_PPC_REG_2 = 4
UC_PPC_REG_3 = 5
UC_PPC_REG_4 = 6
UC_PPC_REG_5 = 7
UC_PPC_REG_6 = 8
UC_PPC_REG_7 = 9
UC_PPC_REG_8 = 10
UC_PPC_REG_9 = 11
UC_PPC_REG_10 = 12
UC_PPC_REG_11 = 13
UC_PPC_REG_12 = 14
UC_PPC_REG_13 = 15
UC_PPC_REG_14 = 16
UC_PPC_REG_15 = 17
UC_PPC_REG_16 = 18
UC_PPC_REG_17 = 19
UC_PPC_REG_18 = 20
UC_PPC_REG_19 = 21
UC_PPC_REG_20 = 22
UC_PPC_REG_21 = 23
UC_PPC_REG_22 = 24
UC_PPC_REG_23 = 25
UC_PPC_REG_24 = 26
UC_PPC_REG_25 = 27
UC_PPC_REG_26 = 28
UC_PPC_REG_27 = 29
UC_PPC_REG_28 = 30
UC_PPC_REG_29 = 31
UC_PPC_REG_30 = 32
UC_PPC_REG_31 = 33
UC_PPC_REG_CR0 = 34
UC_PPC_REG_CR1 = 35
UC_PPC_REG_CR2 = 36
UC_PPC_REG_CR3 = 37
UC_PPC_REG_CR4 = 38
UC_PPC_REG_CR5 = 39
UC_PPC_REG_CR6 = 40
UC_PPC_REG_CR7 = 41
UC_PPC_REG_FPR0 = 42
UC_PPC_REG_FPR1 = 43
UC_PPC_REG_FPR2 = 44
UC_PPC_REG_FPR3 = 45
UC_PPC_REG_FPR4 = 46
UC_PPC_REG_FPR5 = 47
UC_PPC_REG_FPR6 = 48
UC_PPC_REG_FPR7 = 49
UC_PPC_REG_FPR8 = 50
UC_PPC_REG_FPR9 = 51
UC_PPC_REG_FPR10 = 52
UC_PPC_REG_FPR11 = 53
UC_PPC_REG_FPR12 = 54
UC_PPC_REG_FPR13 = 55
UC_PPC_REG_FPR14 = 56
UC_PPC_REG_FPR15 = 57
UC_PPC_REG_FPR16 = 58
UC_PPC_REG_FPR17 = 59
UC_PPC_REG_FPR18 = 60
UC_PPC_REG_FPR19 = 61
UC_PPC_REG_FPR20 = 62
UC_PPC_REG_FPR21 = 63
UC_PPC_REG_FPR22 = 64
UC_PPC_REG_FPR23 = 65
UC_PPC_REG_FPR24 = 66
UC_PPC_REG_FPR25 = 67
UC_PPC_REG_FPR26 = 68
UC_PPC_REG_FPR27 = 69
UC_PPC_REG_FPR28 = 70
UC_PPC_REG_FPR29 = 71
UC_PPC_REG_FPR30 = 72
UC_PPC_REG_FPR31 = 73
UC_PPC_REG_LR = 74
UC_PPC_REG_XER = 75
UC_PPC_REG_CTR = 76
UC_PPC_REG_MSR = 77
UC_PPC_REG_FPSCR = 78

View File

@ -0,0 +1,283 @@
# For Unicorn Engine. AUTO-GENERATED FILE, DO NOT EDIT [riscv_const.py]
# RISCV32 CPU
UC_CPU_RISCV32_ANY = 0
UC_CPU_RISCV32_BASE32 = 1
UC_CPU_RISCV32_SIFIVE_E31 = 2
UC_CPU_RISCV32_SIFIVE_U34 = 3
# RISCV64 CPU
UC_CPU_RISCV64_ANY = 0
UC_CPU_RISCV64_BASE64 = 1
UC_CPU_RISCV64_SIFIVE_E51 = 2
UC_CPU_RISCV64_SIFIVE_U54 = 3
# RISCV registers
UC_RISCV_REG_INVALID = 0
# General purpose registers
UC_RISCV_REG_X0 = 1
UC_RISCV_REG_X1 = 2
UC_RISCV_REG_X2 = 3
UC_RISCV_REG_X3 = 4
UC_RISCV_REG_X4 = 5
UC_RISCV_REG_X5 = 6
UC_RISCV_REG_X6 = 7
UC_RISCV_REG_X7 = 8
UC_RISCV_REG_X8 = 9
UC_RISCV_REG_X9 = 10
UC_RISCV_REG_X10 = 11
UC_RISCV_REG_X11 = 12
UC_RISCV_REG_X12 = 13
UC_RISCV_REG_X13 = 14
UC_RISCV_REG_X14 = 15
UC_RISCV_REG_X15 = 16
UC_RISCV_REG_X16 = 17
UC_RISCV_REG_X17 = 18
UC_RISCV_REG_X18 = 19
UC_RISCV_REG_X19 = 20
UC_RISCV_REG_X20 = 21
UC_RISCV_REG_X21 = 22
UC_RISCV_REG_X22 = 23
UC_RISCV_REG_X23 = 24
UC_RISCV_REG_X24 = 25
UC_RISCV_REG_X25 = 26
UC_RISCV_REG_X26 = 27
UC_RISCV_REG_X27 = 28
UC_RISCV_REG_X28 = 29
UC_RISCV_REG_X29 = 30
UC_RISCV_REG_X30 = 31
UC_RISCV_REG_X31 = 32
# RISCV CSR
UC_RISCV_REG_USTATUS = 33
UC_RISCV_REG_UIE = 34
UC_RISCV_REG_UTVEC = 35
UC_RISCV_REG_USCRATCH = 36
UC_RISCV_REG_UEPC = 37
UC_RISCV_REG_UCAUSE = 38
UC_RISCV_REG_UTVAL = 39
UC_RISCV_REG_UIP = 40
UC_RISCV_REG_FFLAGS = 41
UC_RISCV_REG_FRM = 42
UC_RISCV_REG_FCSR = 43
UC_RISCV_REG_CYCLE = 44
UC_RISCV_REG_TIME = 45
UC_RISCV_REG_INSTRET = 46
UC_RISCV_REG_HPMCOUNTER3 = 47
UC_RISCV_REG_HPMCOUNTER4 = 48
UC_RISCV_REG_HPMCOUNTER5 = 49
UC_RISCV_REG_HPMCOUNTER6 = 50
UC_RISCV_REG_HPMCOUNTER7 = 51
UC_RISCV_REG_HPMCOUNTER8 = 52
UC_RISCV_REG_HPMCOUNTER9 = 53
UC_RISCV_REG_HPMCOUNTER10 = 54
UC_RISCV_REG_HPMCOUNTER11 = 55
UC_RISCV_REG_HPMCOUNTER12 = 56
UC_RISCV_REG_HPMCOUNTER13 = 57
UC_RISCV_REG_HPMCOUNTER14 = 58
UC_RISCV_REG_HPMCOUNTER15 = 59
UC_RISCV_REG_HPMCOUNTER16 = 60
UC_RISCV_REG_HPMCOUNTER17 = 61
UC_RISCV_REG_HPMCOUNTER18 = 62
UC_RISCV_REG_HPMCOUNTER19 = 63
UC_RISCV_REG_HPMCOUNTER20 = 64
UC_RISCV_REG_HPMCOUNTER21 = 65
UC_RISCV_REG_HPMCOUNTER22 = 66
UC_RISCV_REG_HPMCOUNTER23 = 67
UC_RISCV_REG_HPMCOUNTER24 = 68
UC_RISCV_REG_HPMCOUNTER25 = 69
UC_RISCV_REG_HPMCOUNTER26 = 70
UC_RISCV_REG_HPMCOUNTER27 = 71
UC_RISCV_REG_HPMCOUNTER28 = 72
UC_RISCV_REG_HPMCOUNTER29 = 73
UC_RISCV_REG_HPMCOUNTER30 = 74
UC_RISCV_REG_HPMCOUNTER31 = 75
UC_RISCV_REG_CYCLEH = 76
UC_RISCV_REG_TIMEH = 77
UC_RISCV_REG_INSTRETH = 78
UC_RISCV_REG_HPMCOUNTER3H = 79
UC_RISCV_REG_HPMCOUNTER4H = 80
UC_RISCV_REG_HPMCOUNTER5H = 81
UC_RISCV_REG_HPMCOUNTER6H = 82
UC_RISCV_REG_HPMCOUNTER7H = 83
UC_RISCV_REG_HPMCOUNTER8H = 84
UC_RISCV_REG_HPMCOUNTER9H = 85
UC_RISCV_REG_HPMCOUNTER10H = 86
UC_RISCV_REG_HPMCOUNTER11H = 87
UC_RISCV_REG_HPMCOUNTER12H = 88
UC_RISCV_REG_HPMCOUNTER13H = 89
UC_RISCV_REG_HPMCOUNTER14H = 90
UC_RISCV_REG_HPMCOUNTER15H = 91
UC_RISCV_REG_HPMCOUNTER16H = 92
UC_RISCV_REG_HPMCOUNTER17H = 93
UC_RISCV_REG_HPMCOUNTER18H = 94
UC_RISCV_REG_HPMCOUNTER19H = 95
UC_RISCV_REG_HPMCOUNTER20H = 96
UC_RISCV_REG_HPMCOUNTER21H = 97
UC_RISCV_REG_HPMCOUNTER22H = 98
UC_RISCV_REG_HPMCOUNTER23H = 99
UC_RISCV_REG_HPMCOUNTER24H = 100
UC_RISCV_REG_HPMCOUNTER25H = 101
UC_RISCV_REG_HPMCOUNTER26H = 102
UC_RISCV_REG_HPMCOUNTER27H = 103
UC_RISCV_REG_HPMCOUNTER28H = 104
UC_RISCV_REG_HPMCOUNTER29H = 105
UC_RISCV_REG_HPMCOUNTER30H = 106
UC_RISCV_REG_HPMCOUNTER31H = 107
UC_RISCV_REG_MCYCLE = 108
UC_RISCV_REG_MINSTRET = 109
UC_RISCV_REG_MCYCLEH = 110
UC_RISCV_REG_MINSTRETH = 111
UC_RISCV_REG_MVENDORID = 112
UC_RISCV_REG_MARCHID = 113
UC_RISCV_REG_MIMPID = 114
UC_RISCV_REG_MHARTID = 115
UC_RISCV_REG_MSTATUS = 116
UC_RISCV_REG_MISA = 117
UC_RISCV_REG_MEDELEG = 118
UC_RISCV_REG_MIDELEG = 119
UC_RISCV_REG_MIE = 120
UC_RISCV_REG_MTVEC = 121
UC_RISCV_REG_MCOUNTEREN = 122
UC_RISCV_REG_MSTATUSH = 123
UC_RISCV_REG_MUCOUNTEREN = 124
UC_RISCV_REG_MSCOUNTEREN = 125
UC_RISCV_REG_MHCOUNTEREN = 126
UC_RISCV_REG_MSCRATCH = 127
UC_RISCV_REG_MEPC = 128
UC_RISCV_REG_MCAUSE = 129
UC_RISCV_REG_MTVAL = 130
UC_RISCV_REG_MIP = 131
UC_RISCV_REG_MBADADDR = 132
UC_RISCV_REG_SSTATUS = 133
UC_RISCV_REG_SEDELEG = 134
UC_RISCV_REG_SIDELEG = 135
UC_RISCV_REG_SIE = 136
UC_RISCV_REG_STVEC = 137
UC_RISCV_REG_SCOUNTEREN = 138
UC_RISCV_REG_SSCRATCH = 139
UC_RISCV_REG_SEPC = 140
UC_RISCV_REG_SCAUSE = 141
UC_RISCV_REG_STVAL = 142
UC_RISCV_REG_SIP = 143
UC_RISCV_REG_SBADADDR = 144
UC_RISCV_REG_SPTBR = 145
UC_RISCV_REG_SATP = 146
UC_RISCV_REG_HSTATUS = 147
UC_RISCV_REG_HEDELEG = 148
UC_RISCV_REG_HIDELEG = 149
UC_RISCV_REG_HIE = 150
UC_RISCV_REG_HCOUNTEREN = 151
UC_RISCV_REG_HTVAL = 152
UC_RISCV_REG_HIP = 153
UC_RISCV_REG_HTINST = 154
UC_RISCV_REG_HGATP = 155
UC_RISCV_REG_HTIMEDELTA = 156
UC_RISCV_REG_HTIMEDELTAH = 157
# Floating-point registers
UC_RISCV_REG_F0 = 158
UC_RISCV_REG_F1 = 159
UC_RISCV_REG_F2 = 160
UC_RISCV_REG_F3 = 161
UC_RISCV_REG_F4 = 162
UC_RISCV_REG_F5 = 163
UC_RISCV_REG_F6 = 164
UC_RISCV_REG_F7 = 165
UC_RISCV_REG_F8 = 166
UC_RISCV_REG_F9 = 167
UC_RISCV_REG_F10 = 168
UC_RISCV_REG_F11 = 169
UC_RISCV_REG_F12 = 170
UC_RISCV_REG_F13 = 171
UC_RISCV_REG_F14 = 172
UC_RISCV_REG_F15 = 173
UC_RISCV_REG_F16 = 174
UC_RISCV_REG_F17 = 175
UC_RISCV_REG_F18 = 176
UC_RISCV_REG_F19 = 177
UC_RISCV_REG_F20 = 178
UC_RISCV_REG_F21 = 179
UC_RISCV_REG_F22 = 180
UC_RISCV_REG_F23 = 181
UC_RISCV_REG_F24 = 182
UC_RISCV_REG_F25 = 183
UC_RISCV_REG_F26 = 184
UC_RISCV_REG_F27 = 185
UC_RISCV_REG_F28 = 186
UC_RISCV_REG_F29 = 187
UC_RISCV_REG_F30 = 188
UC_RISCV_REG_F31 = 189
UC_RISCV_REG_PC = 190
UC_RISCV_REG_ENDING = 191
# Alias registers
UC_RISCV_REG_ZERO = 1
UC_RISCV_REG_RA = 2
UC_RISCV_REG_SP = 3
UC_RISCV_REG_GP = 4
UC_RISCV_REG_TP = 5
UC_RISCV_REG_T0 = 6
UC_RISCV_REG_T1 = 7
UC_RISCV_REG_T2 = 8
UC_RISCV_REG_S0 = 9
UC_RISCV_REG_FP = 9
UC_RISCV_REG_S1 = 10
UC_RISCV_REG_A0 = 11
UC_RISCV_REG_A1 = 12
UC_RISCV_REG_A2 = 13
UC_RISCV_REG_A3 = 14
UC_RISCV_REG_A4 = 15
UC_RISCV_REG_A5 = 16
UC_RISCV_REG_A6 = 17
UC_RISCV_REG_A7 = 18
UC_RISCV_REG_S2 = 19
UC_RISCV_REG_S3 = 20
UC_RISCV_REG_S4 = 21
UC_RISCV_REG_S5 = 22
UC_RISCV_REG_S6 = 23
UC_RISCV_REG_S7 = 24
UC_RISCV_REG_S8 = 25
UC_RISCV_REG_S9 = 26
UC_RISCV_REG_S10 = 27
UC_RISCV_REG_S11 = 28
UC_RISCV_REG_T3 = 29
UC_RISCV_REG_T4 = 30
UC_RISCV_REG_T5 = 31
UC_RISCV_REG_T6 = 32
UC_RISCV_REG_FT0 = 158
UC_RISCV_REG_FT1 = 159
UC_RISCV_REG_FT2 = 160
UC_RISCV_REG_FT3 = 161
UC_RISCV_REG_FT4 = 162
UC_RISCV_REG_FT5 = 163
UC_RISCV_REG_FT6 = 164
UC_RISCV_REG_FT7 = 165
UC_RISCV_REG_FS0 = 166
UC_RISCV_REG_FS1 = 167
UC_RISCV_REG_FA0 = 168
UC_RISCV_REG_FA1 = 169
UC_RISCV_REG_FA2 = 170
UC_RISCV_REG_FA3 = 171
UC_RISCV_REG_FA4 = 172
UC_RISCV_REG_FA5 = 173
UC_RISCV_REG_FA6 = 174
UC_RISCV_REG_FA7 = 175
UC_RISCV_REG_FS2 = 176
UC_RISCV_REG_FS3 = 177
UC_RISCV_REG_FS4 = 178
UC_RISCV_REG_FS5 = 179
UC_RISCV_REG_FS6 = 180
UC_RISCV_REG_FS7 = 181
UC_RISCV_REG_FS8 = 182
UC_RISCV_REG_FS9 = 183
UC_RISCV_REG_FS10 = 184
UC_RISCV_REG_FS11 = 185
UC_RISCV_REG_FT8 = 186
UC_RISCV_REG_FT9 = 187
UC_RISCV_REG_FT10 = 188
UC_RISCV_REG_FT11 = 189

View File

@ -0,0 +1,121 @@
# For Unicorn Engine. AUTO-GENERATED FILE, DO NOT EDIT [s390x_const.py]
# S390X CPU
UC_CPU_S390X_Z900 = 0
UC_CPU_S390X_Z900_2 = 1
UC_CPU_S390X_Z900_3 = 2
UC_CPU_S390X_Z800 = 3
UC_CPU_S390X_Z990 = 4
UC_CPU_S390X_Z990_2 = 5
UC_CPU_S390X_Z990_3 = 6
UC_CPU_S390X_Z890 = 7
UC_CPU_S390X_Z990_4 = 8
UC_CPU_S390X_Z890_2 = 9
UC_CPU_S390X_Z990_5 = 10
UC_CPU_S390X_Z890_3 = 11
UC_CPU_S390X_Z9EC = 12
UC_CPU_S390X_Z9EC_2 = 13
UC_CPU_S390X_Z9BC = 14
UC_CPU_S390X_Z9EC_3 = 15
UC_CPU_S390X_Z9BC_2 = 16
UC_CPU_S390X_Z10EC = 17
UC_CPU_S390X_Z10EC_2 = 18
UC_CPU_S390X_Z10BC = 19
UC_CPU_S390X_Z10EC_3 = 20
UC_CPU_S390X_Z10BC_2 = 21
UC_CPU_S390X_Z196 = 22
UC_CPU_S390X_Z196_2 = 23
UC_CPU_S390X_Z114 = 24
UC_CPU_S390X_ZEC12 = 25
UC_CPU_S390X_ZEC12_2 = 26
UC_CPU_S390X_ZBC12 = 27
UC_CPU_S390X_Z13 = 28
UC_CPU_S390X_Z13_2 = 29
UC_CPU_S390X_Z13S = 30
UC_CPU_S390X_Z14 = 31
UC_CPU_S390X_Z14_2 = 32
UC_CPU_S390X_Z14ZR1 = 33
UC_CPU_S390X_GEN15A = 34
UC_CPU_S390X_GEN15B = 35
UC_CPU_S390X_QEMU = 36
UC_CPU_S390X_MAX = 37
# S390X registers
UC_S390X_REG_INVALID = 0
# General purpose registers
UC_S390X_REG_R0 = 1
UC_S390X_REG_R1 = 2
UC_S390X_REG_R2 = 3
UC_S390X_REG_R3 = 4
UC_S390X_REG_R4 = 5
UC_S390X_REG_R5 = 6
UC_S390X_REG_R6 = 7
UC_S390X_REG_R7 = 8
UC_S390X_REG_R8 = 9
UC_S390X_REG_R9 = 10
UC_S390X_REG_R10 = 11
UC_S390X_REG_R11 = 12
UC_S390X_REG_R12 = 13
UC_S390X_REG_R13 = 14
UC_S390X_REG_R14 = 15
UC_S390X_REG_R15 = 16
# Floating point registers
UC_S390X_REG_F0 = 17
UC_S390X_REG_F1 = 18
UC_S390X_REG_F2 = 19
UC_S390X_REG_F3 = 20
UC_S390X_REG_F4 = 21
UC_S390X_REG_F5 = 22
UC_S390X_REG_F6 = 23
UC_S390X_REG_F7 = 24
UC_S390X_REG_F8 = 25
UC_S390X_REG_F9 = 26
UC_S390X_REG_F10 = 27
UC_S390X_REG_F11 = 28
UC_S390X_REG_F12 = 29
UC_S390X_REG_F13 = 30
UC_S390X_REG_F14 = 31
UC_S390X_REG_F15 = 32
UC_S390X_REG_F16 = 33
UC_S390X_REG_F17 = 34
UC_S390X_REG_F18 = 35
UC_S390X_REG_F19 = 36
UC_S390X_REG_F20 = 37
UC_S390X_REG_F21 = 38
UC_S390X_REG_F22 = 39
UC_S390X_REG_F23 = 40
UC_S390X_REG_F24 = 41
UC_S390X_REG_F25 = 42
UC_S390X_REG_F26 = 43
UC_S390X_REG_F27 = 44
UC_S390X_REG_F28 = 45
UC_S390X_REG_F29 = 46
UC_S390X_REG_F30 = 47
UC_S390X_REG_F31 = 48
# Access registers
UC_S390X_REG_A0 = 49
UC_S390X_REG_A1 = 50
UC_S390X_REG_A2 = 51
UC_S390X_REG_A3 = 52
UC_S390X_REG_A4 = 53
UC_S390X_REG_A5 = 54
UC_S390X_REG_A6 = 55
UC_S390X_REG_A7 = 56
UC_S390X_REG_A8 = 57
UC_S390X_REG_A9 = 58
UC_S390X_REG_A10 = 59
UC_S390X_REG_A11 = 60
UC_S390X_REG_A12 = 61
UC_S390X_REG_A13 = 62
UC_S390X_REG_A14 = 63
UC_S390X_REG_A15 = 64
UC_S390X_REG_PC = 65
UC_S390X_REG_PSWM = 66
UC_S390X_REG_ENDING = 67
# Alias registers

View File

@ -1,5 +1,41 @@
# For Unicorn Engine. AUTO-GENERATED FILE, DO NOT EDIT [sparc_const.py]
# SPARC32 CPU
UC_CPU_SPARC32_FUJITSU_MB86904 = 0
UC_CPU_SPARC32_FUJITSU_MB86907 = 1
UC_CPU_SPARC32_TI_MICROSPARC_I = 2
UC_CPU_SPARC32_TI_MICROSPARC_II = 3
UC_CPU_SPARC32_TI_MICROSPARC_IIEP = 4
UC_CPU_SPARC32_TI_SUPERSPARC_40 = 5
UC_CPU_SPARC32_TI_SUPERSPARC_50 = 6
UC_CPU_SPARC32_TI_SUPERSPARC_51 = 7
UC_CPU_SPARC32_TI_SUPERSPARC_60 = 8
UC_CPU_SPARC32_TI_SUPERSPARC_61 = 9
UC_CPU_SPARC32_TI_SUPERSPARC_II = 10
UC_CPU_SPARC32_LEON2 = 11
UC_CPU_SPARC32_LEON3 = 12
# SPARC64 CPU
UC_CPU_SPARC64_FUJITSU = 0
UC_CPU_SPARC64_FUJITSU_III = 1
UC_CPU_SPARC64_FUJITSU_IV = 2
UC_CPU_SPARC64_FUJITSU_V = 3
UC_CPU_SPARC64_TI_ULTRASPARC_I = 4
UC_CPU_SPARC64_TI_ULTRASPARC_II = 5
UC_CPU_SPARC64_TI_ULTRASPARC_III = 6
UC_CPU_SPARC64_TI_ULTRASPARC_IIE = 7
UC_CPU_SPARC64_SUN_ULTRASPARC_III = 8
UC_CPU_SPARC64_SUN_ULTRASPARC_III_CU = 9
UC_CPU_SPARC64_SUN_ULTRASPARC_IIII = 10
UC_CPU_SPARC64_SUN_ULTRASPARC_IV = 11
UC_CPU_SPARC64_SUN_ULTRASPARC_IV_PLUS = 12
UC_CPU_SPARC64_SUN_ULTRASPARC_IIII_PLUS = 13
UC_CPU_SPARC64_SUN_ULTRASPARC_T1 = 14
UC_CPU_SPARC64_SUN_ULTRASPARC_T2 = 15
UC_CPU_SPARC64_NEC_ULTRASPARC_I = 16
# SPARC registers
UC_SPARC_REG_INVALID = 0

View File

@ -9,6 +9,7 @@ import inspect
import os.path
import sys
import weakref
import functools
from . import x86_const, arm64_const, unicorn_const as uc
@ -61,7 +62,6 @@ def _load_lib(path):
_load_win_support(path)
lib_file = os.path.join(path, _lib.get(sys.platform, 'libunicorn.so'))
#print('Trying to load shared library', lib_file)
dll = ctypes.cdll.LoadLibrary(lib_file)
#print('SUCCESS')
return dll
@ -101,10 +101,15 @@ __version__ = "%u.%u.%u" % (uc.UC_VERSION_MAJOR, uc.UC_VERSION_MINOR, uc.UC_VERS
# setup all the function prototype
def _setup_prototype(lib, fname, restype, *argtypes):
getattr(lib, fname).restype = restype
getattr(lib, fname).argtypes = argtypes
try:
getattr(lib, fname).restype = restype
getattr(lib, fname).argtypes = argtypes
except AttributeError:
raise ImportError("ERROR: Fail to setup some function prototypes. Make sure you have cleaned your unicorn1 installation.")
ucerr = ctypes.c_int
uc_mode = ctypes.c_int
uc_arch = ctypes.c_int
uc_engine = ctypes.c_void_p
uc_context = ctypes.c_void_p
uc_hook_h = ctypes.c_size_t
@ -116,6 +121,13 @@ class _uc_mem_region(ctypes.Structure):
("perms", ctypes.c_uint32),
]
class uc_tb(ctypes.Structure):
""""TranslationBlock"""
_fields_ = [
("pc", ctypes.c_uint64),
("icount", ctypes.c_uint16),
("size", ctypes.c_uint16)
]
_setup_prototype(_uc, "uc_version", ctypes.c_uint, ctypes.POINTER(ctypes.c_int), ctypes.POINTER(ctypes.c_int))
_setup_prototype(_uc, "uc_arch_supported", ctypes.c_bool, ctypes.c_int)
@ -130,6 +142,7 @@ _setup_prototype(_uc, "uc_mem_write", ucerr, uc_engine, ctypes.c_uint64, ctypes.
_setup_prototype(_uc, "uc_emu_start", ucerr, uc_engine, ctypes.c_uint64, ctypes.c_uint64, ctypes.c_uint64, ctypes.c_size_t)
_setup_prototype(_uc, "uc_emu_stop", ucerr, uc_engine)
_setup_prototype(_uc, "uc_hook_del", ucerr, uc_engine, uc_hook_h)
_setup_prototype(_uc, "uc_mmio_map", ucerr, uc_engine, ctypes.c_uint64, ctypes.c_size_t, ctypes.c_void_p, ctypes.c_void_p, ctypes.c_void_p, ctypes.c_void_p)
_setup_prototype(_uc, "uc_mem_map", ucerr, uc_engine, ctypes.c_uint64, ctypes.c_size_t, ctypes.c_uint32)
_setup_prototype(_uc, "uc_mem_map_ptr", ucerr, uc_engine, ctypes.c_uint64, ctypes.c_size_t, ctypes.c_uint32, ctypes.c_void_p)
_setup_prototype(_uc, "uc_mem_unmap", ucerr, uc_engine, ctypes.c_uint64, ctypes.c_size_t)
@ -140,12 +153,13 @@ _setup_prototype(_uc, "uc_free", ucerr, ctypes.c_void_p)
_setup_prototype(_uc, "uc_context_save", ucerr, uc_engine, uc_context)
_setup_prototype(_uc, "uc_context_restore", ucerr, uc_engine, uc_context)
_setup_prototype(_uc, "uc_context_size", ctypes.c_size_t, uc_engine)
_setup_prototype(_uc, "uc_context_reg_read", ucerr, uc_context, ctypes.c_int, ctypes.c_void_p)
_setup_prototype(_uc, "uc_context_reg_write", ucerr, uc_context, ctypes.c_int, ctypes.c_void_p)
_setup_prototype(_uc, "uc_context_free", ucerr, uc_context)
_setup_prototype(_uc, "uc_mem_regions", ucerr, uc_engine, ctypes.POINTER(ctypes.POINTER(_uc_mem_region)), ctypes.POINTER(ctypes.c_uint32))
# uc_hook_add is special due to variable number of arguments
_uc.uc_hook_add = _uc.uc_hook_add
_uc.uc_hook_add.restype = ucerr
# https://bugs.python.org/issue42880
_setup_prototype(_uc, "uc_hook_add", ucerr, uc_engine, ctypes.POINTER(uc_hook_h), ctypes.c_int, ctypes.c_void_p, ctypes.c_void_p, ctypes.c_uint64, ctypes.c_uint64)
_setup_prototype(_uc, "uc_ctl", ucerr, uc_engine, ctypes.c_int)
UC_HOOK_CODE_CB = ctypes.CFUNCTYPE(None, uc_engine, ctypes.c_uint64, ctypes.c_size_t, ctypes.c_void_p)
UC_HOOK_INSN_INVALID_CB = ctypes.CFUNCTYPE(ctypes.c_bool, uc_engine, ctypes.c_void_p)
@ -168,7 +182,18 @@ UC_HOOK_INSN_OUT_CB = ctypes.CFUNCTYPE(
ctypes.c_int, ctypes.c_uint32, ctypes.c_void_p
)
UC_HOOK_INSN_SYSCALL_CB = ctypes.CFUNCTYPE(None, uc_engine, ctypes.c_void_p)
UC_MMIO_READ_CB = ctypes.CFUNCTYPE(
ctypes.c_uint64, uc_engine, ctypes.c_uint64, ctypes.c_int, ctypes.c_void_p
)
UC_MMIO_WRITE_CB = ctypes.CFUNCTYPE(
None, uc_engine, ctypes.c_uint64, ctypes.c_int, ctypes.c_uint64, ctypes.c_void_p
)
UC_HOOK_EDGE_GEN_CB = ctypes.CFUNCTYPE(
None, uc_engine, ctypes.POINTER(uc_tb), ctypes.POINTER(uc_tb), ctypes.c_void_p
)
UC_HOOK_TCG_OPCODE_CB = ctypes.CFUNCTYPE(
None, uc_engine, ctypes.c_uint64, ctypes.c_uint64, ctypes.c_uint64, ctypes.c_void_p
)
# access to error code via @errno of UcError
class UcError(Exception):
@ -199,6 +224,103 @@ def version_bind():
def uc_arch_supported(query):
return _uc.uc_arch_supported(query)
# uc_reg_read/write and uc_context_reg_read/write.
def reg_read(reg_read_func, arch, reg_id, opt=None):
if arch == uc.UC_ARCH_X86:
if reg_id in [x86_const.UC_X86_REG_IDTR, x86_const.UC_X86_REG_GDTR, x86_const.UC_X86_REG_LDTR, x86_const.UC_X86_REG_TR]:
reg = uc_x86_mmr()
status = reg_read_func(reg_id, ctypes.byref(reg))
if status != uc.UC_ERR_OK:
raise UcError(status)
return reg.selector, reg.base, reg.limit, reg.flags
if reg_id in range(x86_const.UC_X86_REG_FP0, x86_const.UC_X86_REG_FP0+8):
reg = uc_x86_float80()
status = reg_read_func(reg_id, ctypes.byref(reg))
if status != uc.UC_ERR_OK:
raise UcError(status)
return reg.mantissa, reg.exponent
if reg_id in range(x86_const.UC_X86_REG_XMM0, x86_const.UC_X86_REG_XMM0+8):
reg = uc_x86_xmm()
status = reg_read_func(reg_id, ctypes.byref(reg))
if status != uc.UC_ERR_OK:
raise UcError(status)
return reg.low_qword | (reg.high_qword << 64)
if reg_id in range(x86_const.UC_X86_REG_YMM0, x86_const.UC_X86_REG_YMM0+16):
reg = uc_x86_ymm()
status = reg_read_func(reg_id, ctypes.byref(reg))
if status != uc.UC_ERR_OK:
raise UcError(status)
return reg.first_qword | (reg.second_qword << 64) | (reg.third_qword << 128) | (reg.fourth_qword << 192)
if reg_id is x86_const.UC_X86_REG_MSR:
if opt is None:
raise UcError(uc.UC_ERR_ARG)
reg = uc_x86_msr()
reg.rid = opt
status = reg_read_func(reg_id, ctypes.byref(reg))
if status != uc.UC_ERR_OK:
raise UcError(status)
return reg.value
if arch == uc.UC_ARCH_ARM64:
if reg_id in range(arm64_const.UC_ARM64_REG_Q0, arm64_const.UC_ARM64_REG_Q31+1) or range(arm64_const.UC_ARM64_REG_V0, arm64_const.UC_ARM64_REG_V31+1):
reg = uc_arm64_neon128()
status = reg_read_func(reg_id, ctypes.byref(reg))
if status != uc.UC_ERR_OK:
raise UcError(status)
return reg.low_qword | (reg.high_qword << 64)
# read to 64bit number to be safe
reg = ctypes.c_uint64(0)
status = reg_read_func(reg_id, ctypes.byref(reg))
if status != uc.UC_ERR_OK:
raise UcError(status)
return reg.value
def reg_write(reg_write_func, arch, reg_id, value):
reg = None
if arch == uc.UC_ARCH_X86:
if reg_id in [x86_const.UC_X86_REG_IDTR, x86_const.UC_X86_REG_GDTR, x86_const.UC_X86_REG_LDTR, x86_const.UC_X86_REG_TR]:
assert isinstance(value, tuple) and len(value) == 4
reg = uc_x86_mmr()
reg.selector = value[0]
reg.base = value[1]
reg.limit = value[2]
reg.flags = value[3]
if reg_id in range(x86_const.UC_X86_REG_FP0, x86_const.UC_X86_REG_FP0+8):
reg = uc_x86_float80()
reg.mantissa = value[0]
reg.exponent = value[1]
if reg_id in range(x86_const.UC_X86_REG_XMM0, x86_const.UC_X86_REG_XMM0+8):
reg = uc_x86_xmm()
reg.low_qword = value & 0xffffffffffffffff
reg.high_qword = value >> 64
if reg_id in range(x86_const.UC_X86_REG_YMM0, x86_const.UC_X86_REG_YMM0+16):
reg = uc_x86_ymm()
reg.first_qword = value & 0xffffffffffffffff
reg.second_qword = (value >> 64) & 0xffffffffffffffff
reg.third_qword = (value >> 128) & 0xffffffffffffffff
reg.fourth_qword = value >> 192
if reg_id is x86_const.UC_X86_REG_MSR:
reg = uc_x86_msr()
reg.rid = value[0]
reg.value = value[1]
if arch == uc.UC_ARCH_ARM64:
if reg_id in range(arm64_const.UC_ARM64_REG_Q0, arm64_const.UC_ARM64_REG_Q31+1) or range(arm64_const.UC_ARM64_REG_V0, arm64_const.UC_ARM64_REG_V31+1):
reg = uc_arm64_neon128()
reg.low_qword = value & 0xffffffffffffffff
reg.high_qword = value >> 64
if reg is None:
# convert to 64bit number to be safe
reg = ctypes.c_uint64(value)
status = reg_write_func(reg_id, ctypes.byref(reg))
if status != uc.UC_ERR_OK:
raise UcError(status)
return
def _catch_hook_exception(func):
@wraps(func)
@ -306,6 +428,8 @@ class Uc(object):
def __init__(self, arch, mode):
# verify version compatibility with the core before doing anything
(major, minor, _combined) = uc_version()
# print("core version =", uc_version())
# print("binding version =", uc.UC_API_MAJOR, uc.UC_API_MINOR)
if major != uc.UC_API_MAJOR or minor != uc.UC_API_MINOR:
self._uch = None
# our binding version is different from the core's API version
@ -319,7 +443,7 @@ class Uc(object):
raise UcError(status)
# internal mapping table to save callback & userdata
self._callbacks = {}
self._ctype_cbs = {}
self._ctype_cbs = []
self._callback_count = 0
self._cleanup.register(self)
self._hook_exception = None # The exception raised in a hook
@ -336,6 +460,7 @@ class Uc(object):
# emulate from @begin, and stop when reaching address @until
def emu_start(self, begin, until, timeout=0, count=0):
self._hook_exception = None
status = _uc.uc_emu_start(self._uch, begin, until, timeout, count)
if status != uc.UC_ERR_OK:
raise UcError(status)
@ -351,100 +476,11 @@ class Uc(object):
# return the value of a register
def reg_read(self, reg_id, opt=None):
if self._arch == uc.UC_ARCH_X86:
if reg_id in [x86_const.UC_X86_REG_IDTR, x86_const.UC_X86_REG_GDTR, x86_const.UC_X86_REG_LDTR, x86_const.UC_X86_REG_TR]:
reg = uc_x86_mmr()
status = _uc.uc_reg_read(self._uch, reg_id, ctypes.byref(reg))
if status != uc.UC_ERR_OK:
raise UcError(status)
return reg.selector, reg.base, reg.limit, reg.flags
if reg_id in range(x86_const.UC_X86_REG_FP0, x86_const.UC_X86_REG_FP0+8):
reg = uc_x86_float80()
status = _uc.uc_reg_read(self._uch, reg_id, ctypes.byref(reg))
if status != uc.UC_ERR_OK:
raise UcError(status)
return reg.mantissa, reg.exponent
if reg_id in range(x86_const.UC_X86_REG_XMM0, x86_const.UC_X86_REG_XMM0+8):
reg = uc_x86_xmm()
status = _uc.uc_reg_read(self._uch, reg_id, ctypes.byref(reg))
if status != uc.UC_ERR_OK:
raise UcError(status)
return reg.low_qword | (reg.high_qword << 64)
if reg_id in range(x86_const.UC_X86_REG_YMM0, x86_const.UC_X86_REG_YMM0+16):
reg = uc_x86_ymm()
status = _uc.uc_reg_read(self._uch, reg_id, ctypes.byref(reg))
if status != uc.UC_ERR_OK:
raise UcError(status)
return reg.first_qword | (reg.second_qword << 64) | (reg.third_qword << 128) | (reg.fourth_qword << 192)
if reg_id is x86_const.UC_X86_REG_MSR:
if opt is None:
raise UcError(uc.UC_ERR_ARG)
reg = uc_x86_msr()
reg.rid = opt
status = _uc.uc_reg_read(self._uch, reg_id, ctypes.byref(reg))
if status != uc.UC_ERR_OK:
raise UcError(status)
return reg.value
if self._arch == uc.UC_ARCH_ARM64:
if reg_id in range(arm64_const.UC_ARM64_REG_Q0, arm64_const.UC_ARM64_REG_Q31+1) or range(arm64_const.UC_ARM64_REG_V0, arm64_const.UC_ARM64_REG_V31+1):
reg = uc_arm64_neon128()
status = _uc.uc_reg_read(self._uch, reg_id, ctypes.byref(reg))
if status != uc.UC_ERR_OK:
raise UcError(status)
return reg.low_qword | (reg.high_qword << 64)
# read to 64bit number to be safe
reg = ctypes.c_uint64(0)
status = _uc.uc_reg_read(self._uch, reg_id, ctypes.byref(reg))
if status != uc.UC_ERR_OK:
raise UcError(status)
return reg.value
return reg_read(functools.partial(_uc.uc_reg_read, self._uch), self._arch, reg_id, opt)
# write to a register
def reg_write(self, reg_id, value):
reg = None
if self._arch == uc.UC_ARCH_X86:
if reg_id in [x86_const.UC_X86_REG_IDTR, x86_const.UC_X86_REG_GDTR, x86_const.UC_X86_REG_LDTR, x86_const.UC_X86_REG_TR]:
assert isinstance(value, tuple) and len(value) == 4
reg = uc_x86_mmr()
reg.selector = value[0]
reg.base = value[1]
reg.limit = value[2]
reg.flags = value[3]
if reg_id in range(x86_const.UC_X86_REG_FP0, x86_const.UC_X86_REG_FP0+8):
reg = uc_x86_float80()
reg.mantissa = value[0]
reg.exponent = value[1]
if reg_id in range(x86_const.UC_X86_REG_XMM0, x86_const.UC_X86_REG_XMM0+8):
reg = uc_x86_xmm()
reg.low_qword = value & 0xffffffffffffffff
reg.high_qword = value >> 64
if reg_id in range(x86_const.UC_X86_REG_YMM0, x86_const.UC_X86_REG_YMM0+16):
reg = uc_x86_ymm()
reg.first_qword = value & 0xffffffffffffffff
reg.second_qword = (value >> 64) & 0xffffffffffffffff
reg.third_qword = (value >> 128) & 0xffffffffffffffff
reg.fourth_qword = value >> 192
if reg_id is x86_const.UC_X86_REG_MSR:
reg = uc_x86_msr()
reg.rid = value[0]
reg.value = value[1]
if self._arch == uc.UC_ARCH_ARM64:
if reg_id in range(arm64_const.UC_ARM64_REG_Q0, arm64_const.UC_ARM64_REG_Q31+1) or range(arm64_const.UC_ARM64_REG_V0, arm64_const.UC_ARM64_REG_V31+1):
reg = uc_arm64_neon128()
reg.low_qword = value & 0xffffffffffffffff
reg.high_qword = value >> 64
if reg is None:
# convert to 64bit number to be safe
reg = ctypes.c_uint64(value)
status = _uc.uc_reg_write(self._uch, reg_id, ctypes.byref(reg))
if status != uc.UC_ERR_OK:
raise UcError(status)
return reg_write(functools.partial(_uc.uc_reg_write, self._uch), self._arch, reg_id, value)
# read from MSR - X86 only
def msr_read(self, msr_id):
@ -468,6 +504,33 @@ class Uc(object):
if status != uc.UC_ERR_OK:
raise UcError(status)
def _mmio_map_read_cb(self, handle, offset, size, user_data):
(cb, data) = self._callbacks[user_data]
return cb(self, offset, size, data)
def _mmio_map_write_cb(self, handle, offset, size, value, user_data):
(cb, data) = self._callbacks[user_data]
cb(self, offset, size, value, data)
def mmio_map(self, address, size, read_cb, user_data_read, write_cb, user_data_write):
internal_read_cb = ctypes.cast(UC_MMIO_READ_CB(self._mmio_map_read_cb), UC_MMIO_READ_CB)
internal_write_cb = ctypes.cast(UC_MMIO_WRITE_CB(self._mmio_map_write_cb), UC_MMIO_WRITE_CB)
self._callback_count += 1
self._callbacks[self._callback_count] = (read_cb, user_data_read)
read_count = self._callback_count
self._callback_count += 1
self._callbacks[self._callback_count] = (write_cb, user_data_write)
write_count = self._callback_count
status = _uc.uc_mmio_map(self._uch, address, size, internal_read_cb, read_count, internal_write_cb, write_count)
if status != uc.UC_ERR_OK:
raise UcError(status)
# https://docs.python.org/3/library/ctypes.html#callback-functions
self._ctype_cbs.append(internal_read_cb)
self._ctype_cbs.append(internal_write_cb)
# map a range of memory
def mem_map(self, address, size, perms=uc.UC_PROT_ALL):
status = _uc.uc_mem_map(self._uch, address, size, perms)
@ -500,6 +563,16 @@ class Uc(object):
raise UcError(status)
return result.value
@_catch_hook_exception
def _hook_tcg_op_cb(self, handle, address, arg1, arg2, user_data):
(cb, data) = self._callbacks[user_data]
cb(self, address, arg1, arg2, user_data)
@_catch_hook_exception
def _hook_edge_gen_cb(self, handle, cur, prev, user_data):
(cb, data) = self._callbacks[user_data]
cb(self, cur.contents, prev.contents, user_data)
@_catch_hook_exception
def _hookcode_cb(self, handle, address, size, user_data):
# call user's callback with self object
@ -548,8 +621,86 @@ class Uc(object):
(cb, data) = self._callbacks[user_data]
cb(self, data)
def ctl(self, control, *args):
status = _uc.uc_ctl(self._uch, control, *args)
if status != uc.UC_ERR_OK:
raise UcError(status)
return status
def __ctl(self, ctl, nr, rw):
return ctl | (nr << 26) | (rw << 30)
def __ctl_r(self, ctl, nr):
return self.__ctl(ctl, nr, uc.UC_CTL_IO_READ)
def __ctl_w(self, ctl, nr):
return self.__ctl(ctl, nr, uc.UC_CTL_IO_WRITE)
def __ctl_rw(self, ctl, nr):
return self.__ctl(ctl, nr, uc.UC_CTL_IO_READ_WRITE)
def __ctl_r_1_arg(self, ctl, ctp):
arg = ctp()
self.ctl(self.__ctl_r(ctl, 1), ctypes.byref(arg))
return arg.value
def __ctl_w_1_arg(self, ctl, val, ctp):
arg = ctp(val)
self.ctl(self.__ctl_w(ctl, 1), arg)
def __ctl_rw_1_1_arg(self, ctl, val, ctp1, ctp2):
arg1 = ctp1(val)
arg2 = ctp2()
self.ctl(self.__ctl_rw(ctl, 2), arg1, ctypes.byref(arg2))
return arg2
def ctl_get_mode(self):
return self.__ctl_r_1_arg(uc.UC_CTL_UC_MODE, ctypes.c_int)
def ctl_get_page_size(self):
return self.__ctl_r_1_arg(uc.UC_CTL_UC_PAGE_SIZE, ctypes.c_uint32)
def ctl_set_page_size(self, val):
self.__ctl_w_1_arg(uc.UC_CTL_UC_PAGE_SIZE, val, ctypes.c_uint32)
def ctl_get_arch(self):
return self.__ctl_r_1_arg(uc.UC_CTL_UC_ARCH, ctypes.c_int)
def ctl_get_timeout(self):
return self.__ctl_r_1_arg(uc.UC_CTL_UC_TIMEOUT, ctypes.c_uint64)
def ctl_exits_enabled(self, val):
self.__ctl_w_1_arg(uc.UC_CTL_UC_USE_EXITS, val, ctypes.c_int)
def ctl_get_exits_cnt(self):
return self.__ctl_r_1_arg(uc.UC_CTL_UC_EXITS_CNT, ctypes.c_size_t)
def ctl_get_exits(self):
l = self.ctl_get_exits_cnt()
arr = (ctypes.c_uint64 * l)()
self.ctl(self.__ctl_r(uc.UC_CTL_UC_EXITS, 2), ctypes.cast(arr, ctypes.c_void_p), ctypes.c_size_t(l))
return [i for i in arr]
def ctl_set_exits(self, exits):
arr = (ctypes.c_uint64 * len(exits))()
for idx, exit in enumerate(exits):
arr[idx] = exit
self.ctl(self.__ctl_w(uc.UC_CTL_UC_EXITS, 2), ctypes.cast(arr, ctypes.c_void_p), ctypes.c_size_t(len(exits)))
def ctl_get_cpu_model(self):
return self.__ctl_r_1_arg(uc.UC_CTL_CPU_MODEL, ctypes.c_int)
def ctl_set_cpu_model(self, val):
self.__ctl_w_1_arg(uc.UC_CTL_CPU_MODEL, val, ctypes.c_int)
def ctl_remove_cache(self, addr):
self.__ctl_w_1_arg(uc.UC_CTL_TB_REMOVE_CACHE, addr, ctypes.c_uint64)
def ctl_request_cache(self, addr):
return self.__ctl_rw_1_1_arg(uc.UC_CTL_TB_REQUEST_CACHE, addr, ctypes.c_uint64, uc_tb)
# add a hook
def hook_add(self, htype, callback, user_data=None, begin=1, end=0, arg1=0):
def hook_add(self, htype, callback, user_data=None, begin=1, end=0, arg1=0, arg2=0):
_h2 = uc_hook_h()
# save callback & user_data
@ -570,6 +721,15 @@ class Uc(object):
ctypes.cast(self._callback_count, ctypes.c_void_p),
ctypes.c_uint64(begin), ctypes.c_uint64(end), insn
)
elif htype == uc.UC_HOOK_TCG_OPCODE:
opcode = ctypes.c_int(arg1)
flags = ctypes.c_int(arg2)
status = _uc.uc_hook_add(
self._uch, ctypes.byref(_h2), htype, ctypes.cast(UC_HOOK_TCG_OPCODE_CB(self._hook_tcg_op_cb), UC_HOOK_TCG_OPCODE_CB),
ctypes.cast(self._callback_count, ctypes.c_void_p),
ctypes.c_uint64(begin), ctypes.c_uint64(end), opcode, flags
)
elif htype == uc.UC_HOOK_INTR:
cb = ctypes.cast(UC_HOOK_INTR_CB(self._hook_intr_cb), UC_HOOK_INTR_CB)
status = _uc.uc_hook_add(
@ -584,6 +744,13 @@ class Uc(object):
ctypes.cast(self._callback_count, ctypes.c_void_p),
ctypes.c_uint64(begin), ctypes.c_uint64(end)
)
elif htype == uc.UC_HOOK_EDGE_GENERATED:
cb = ctypes.cast(UC_HOOK_EDGE_GEN_CB(self._hook_edge_gen_cb), UC_HOOK_EDGE_GEN_CB)
status = _uc.uc_hook_add(
self._uch, ctypes.byref(_h2), htype, cb,
ctypes.cast(self._callback_count, ctypes.c_void_p),
ctypes.c_uint64(begin), ctypes.c_uint64(end)
)
else:
if htype in (uc.UC_HOOK_BLOCK, uc.UC_HOOK_CODE):
# set callback with wrapper, so it can be called
@ -615,7 +782,7 @@ class Uc(object):
)
# save the ctype function so gc will leave it alone.
self._ctype_cbs[self._callback_count] = cb
self._ctype_cbs.append(cb)
if status != uc.UC_ERR_OK:
raise UcError(status)
@ -631,7 +798,7 @@ class Uc(object):
h = 0
def context_save(self):
context = UcContext(self._uch)
context = UcContext(self._uch, self._arch, self._mode)
status = _uc.uc_context_save(self._uch, context.context)
if status != uc.UC_ERR_OK:
raise UcError(status)
@ -664,14 +831,16 @@ class Uc(object):
class UcContext:
def __init__(self, h):
def __init__(self, h, arch, mode):
self._context = uc_context()
self._size = _uc.uc_context_size(h)
self._to_free = True
status = _uc.uc_context_alloc(h, ctypes.byref(self._context))
if status != uc.UC_ERR_OK:
raise UcError(status)
self._arch = arch
self._mode = mode
@property
def context(self):
return self._context
@ -680,16 +849,34 @@ class UcContext:
def size(self):
return self._size
@property
def arch(self):
return self._arch
@property
def mode(self):
return self._mode
# return the value of a register
def reg_read(self, reg_id, opt=None):
return reg_read(functools.partial(_uc.uc_context_reg_read, self._context), self.arch, reg_id, opt)
# write to a register
def reg_write(self, reg_id, value):
return reg_write(functools.partial(_uc.uc_context_reg_write, self._context), self.arch, reg_id, value)
# Make UcContext picklable
def __getstate__(self):
return (bytes(self), self.size)
return (bytes(self), self.size, self.arch, self.mode)
def __setstate__(self, state):
self._size = state[1]
self._context = ctypes.cast(ctypes.create_string_buffer(state[0], self._size), uc_context)
# __init__ won'e be invoked, so we are safe to set it here.
self._to_free = False
self._arch = state[2]
self._mode = state[3]
def __bytes__(self):
return ctypes.string_at(self.context, self.size)
@ -708,6 +895,8 @@ def debug():
"sparc": uc.UC_ARCH_SPARC,
"m68k": uc.UC_ARCH_M68K,
"x86": uc.UC_ARCH_X86,
"riscv": uc.UC_ARCH_RISCV,
"ppc": uc.UC_ARCH_PPC,
}
all_archs = ""

View File

@ -1,11 +1,16 @@
# For Unicorn Engine. AUTO-GENERATED FILE, DO NOT EDIT [unicorn_const.py]
UC_API_MAJOR = 1
UC_API_MAJOR = 2
UC_API_MINOR = 0
UC_VERSION_MAJOR = 1
UC_API_PATCH = 0
UC_API_EXTRA = 5
UC_VERSION_MAJOR = 2
UC_VERSION_MINOR = 0
UC_VERSION_EXTRA = 3
UC_VERSION_PATCH = 0
UC_VERSION_EXTRA = 5
UC_SECOND_SCALE = 1000000
UC_MILISECOND_SCALE = 1000
UC_ARCH_ARM = 1
@ -15,7 +20,9 @@ UC_ARCH_X86 = 4
UC_ARCH_PPC = 5
UC_ARCH_SPARC = 6
UC_ARCH_M68K = 7
UC_ARCH_MAX = 8
UC_ARCH_RISCV = 8
UC_ARCH_S390X = 9
UC_ARCH_MAX = 10
UC_MODE_LITTLE_ENDIAN = 0
UC_MODE_BIG_ENDIAN = 1073741824
@ -27,7 +34,6 @@ UC_MODE_V8 = 64
UC_MODE_ARM926 = 128
UC_MODE_ARM946 = 256
UC_MODE_ARM1176 = 512
UC_MODE_ARMBE8 = 1024
UC_MODE_MICRO = 16
UC_MODE_MIPS3 = 32
UC_MODE_MIPS32R6 = 64
@ -42,6 +48,8 @@ UC_MODE_QPX = 16
UC_MODE_SPARC32 = 4
UC_MODE_SPARC64 = 8
UC_MODE_V9 = 16
UC_MODE_RISCV32 = 4
UC_MODE_RISCV64 = 8
UC_ERR_OK = 0
UC_ERR_NOMEM = 1
@ -75,6 +83,10 @@ UC_MEM_WRITE_PROT = 22
UC_MEM_READ_PROT = 23
UC_MEM_FETCH_PROT = 24
UC_MEM_READ_AFTER = 25
UC_TCG_OP_SUB = 0
UC_TCG_OP_FLAG_CMP = 1
UC_TCG_OP_FLAG_DIRECT = 2
UC_HOOK_INTR = 1
UC_HOOK_INSN = 2
UC_HOOK_CODE = 4
@ -90,6 +102,8 @@ UC_HOOK_MEM_WRITE = 2048
UC_HOOK_MEM_FETCH = 4096
UC_HOOK_MEM_READ_AFTER = 8192
UC_HOOK_INSN_INVALID = 16384
UC_HOOK_EDGE_GENERATED = 32768
UC_HOOK_TCG_OPCODE = 65536
UC_HOOK_MEM_UNMAPPED = 112
UC_HOOK_MEM_PROT = 896
UC_HOOK_MEM_READ_INVALID = 144
@ -102,6 +116,22 @@ UC_QUERY_PAGE_SIZE = 2
UC_QUERY_ARCH = 3
UC_QUERY_TIMEOUT = 4
UC_CTL_IO_NONE = 0
UC_CTL_IO_WRITE = 1
UC_CTL_IO_READ = 2
UC_CTL_IO_READ_WRITE = 3
UC_CTL_UC_MODE = 0
UC_CTL_UC_PAGE_SIZE = 1
UC_CTL_UC_ARCH = 2
UC_CTL_UC_TIMEOUT = 3
UC_CTL_UC_USE_EXITS = 4
UC_CTL_UC_EXITS_CNT = 5
UC_CTL_UC_EXITS = 6
UC_CTL_CPU_MODEL = 7
UC_CTL_TB_REQUEST_CACHE = 8
UC_CTL_TB_REMOVE_CACHE = 9
UC_PROT_NONE = 0
UC_PROT_READ = 1
UC_PROT_WRITE = 2

View File

@ -1,5 +1,46 @@
# For Unicorn Engine. AUTO-GENERATED FILE, DO NOT EDIT [x86_const.py]
# X86 CPU
UC_CPU_X86_QEMU64 = 0
UC_CPU_X86_PHENOM = 1
UC_CPU_X86_CORE2DUO = 2
UC_CPU_X86_KVM64 = 3
UC_CPU_X86_QEMU32 = 4
UC_CPU_X86_KVM32 = 5
UC_CPU_X86_COREDUO = 6
UC_CPU_X86_486 = 7
UC_CPU_X86_PENTIUM = 8
UC_CPU_X86_PENTIUM2 = 9
UC_CPU_X86_PENTIUM3 = 10
UC_CPU_X86_ATHLON = 11
UC_CPU_X86_N270 = 12
UC_CPU_X86_CONROE = 13
UC_CPU_X86_PENRYN = 14
UC_CPU_X86_NEHALEM = 15
UC_CPU_X86_WESTMERE = 16
UC_CPU_X86_SANDYBRIDGE = 17
UC_CPU_X86_IVYBRIDGE = 18
UC_CPU_X86_HASWELL = 19
UC_CPU_X86_BROADWELL = 20
UC_CPU_X86_SKYLAKE_CLIENT = 21
UC_CPU_X86_SKYLAKE_SERVER = 22
UC_CPU_X86_CASCADELAKE_SERVER = 23
UC_CPU_X86_COOPERLAKE = 24
UC_CPU_X86_ICELAKE_CLIENT = 25
UC_CPU_X86_ICELAKE_SERVER = 26
UC_CPU_X86_DENVERTON = 27
UC_CPU_X86_SNOWRIDGE = 28
UC_CPU_X86_KNIGHTSMILL = 29
UC_CPU_X86_OPTERON_G1 = 30
UC_CPU_X86_OPTERON_G2 = 31
UC_CPU_X86_OPTERON_G3 = 32
UC_CPU_X86_OPTERON_G4 = 33
UC_CPU_X86_OPTERON_G5 = 34
UC_CPU_X86_EPYC = 35
UC_CPU_X86_DHYANA = 36
UC_CPU_X86_EPYC_ROME = 37
# X86 registers
UC_X86_REG_INVALID = 0
@ -29,232 +70,219 @@ UC_X86_REG_EDI = 23
UC_X86_REG_EDX = 24
UC_X86_REG_EFLAGS = 25
UC_X86_REG_EIP = 26
UC_X86_REG_EIZ = 27
UC_X86_REG_ES = 28
UC_X86_REG_ESI = 29
UC_X86_REG_ESP = 30
UC_X86_REG_FPSW = 31
UC_X86_REG_FS = 32
UC_X86_REG_GS = 33
UC_X86_REG_IP = 34
UC_X86_REG_RAX = 35
UC_X86_REG_RBP = 36
UC_X86_REG_RBX = 37
UC_X86_REG_RCX = 38
UC_X86_REG_RDI = 39
UC_X86_REG_RDX = 40
UC_X86_REG_RIP = 41
UC_X86_REG_RIZ = 42
UC_X86_REG_RSI = 43
UC_X86_REG_RSP = 44
UC_X86_REG_SI = 45
UC_X86_REG_SIL = 46
UC_X86_REG_SP = 47
UC_X86_REG_SPL = 48
UC_X86_REG_SS = 49
UC_X86_REG_CR0 = 50
UC_X86_REG_CR1 = 51
UC_X86_REG_CR2 = 52
UC_X86_REG_CR3 = 53
UC_X86_REG_CR4 = 54
UC_X86_REG_CR5 = 55
UC_X86_REG_CR6 = 56
UC_X86_REG_CR7 = 57
UC_X86_REG_CR8 = 58
UC_X86_REG_CR9 = 59
UC_X86_REG_CR10 = 60
UC_X86_REG_CR11 = 61
UC_X86_REG_CR12 = 62
UC_X86_REG_CR13 = 63
UC_X86_REG_CR14 = 64
UC_X86_REG_CR15 = 65
UC_X86_REG_DR0 = 66
UC_X86_REG_DR1 = 67
UC_X86_REG_DR2 = 68
UC_X86_REG_DR3 = 69
UC_X86_REG_DR4 = 70
UC_X86_REG_DR5 = 71
UC_X86_REG_DR6 = 72
UC_X86_REG_DR7 = 73
UC_X86_REG_DR8 = 74
UC_X86_REG_DR9 = 75
UC_X86_REG_DR10 = 76
UC_X86_REG_DR11 = 77
UC_X86_REG_DR12 = 78
UC_X86_REG_DR13 = 79
UC_X86_REG_DR14 = 80
UC_X86_REG_DR15 = 81
UC_X86_REG_FP0 = 82
UC_X86_REG_FP1 = 83
UC_X86_REG_FP2 = 84
UC_X86_REG_FP3 = 85
UC_X86_REG_FP4 = 86
UC_X86_REG_FP5 = 87
UC_X86_REG_FP6 = 88
UC_X86_REG_FP7 = 89
UC_X86_REG_K0 = 90
UC_X86_REG_K1 = 91
UC_X86_REG_K2 = 92
UC_X86_REG_K3 = 93
UC_X86_REG_K4 = 94
UC_X86_REG_K5 = 95
UC_X86_REG_K6 = 96
UC_X86_REG_K7 = 97
UC_X86_REG_MM0 = 98
UC_X86_REG_MM1 = 99
UC_X86_REG_MM2 = 100
UC_X86_REG_MM3 = 101
UC_X86_REG_MM4 = 102
UC_X86_REG_MM5 = 103
UC_X86_REG_MM6 = 104
UC_X86_REG_MM7 = 105
UC_X86_REG_R8 = 106
UC_X86_REG_R9 = 107
UC_X86_REG_R10 = 108
UC_X86_REG_R11 = 109
UC_X86_REG_R12 = 110
UC_X86_REG_R13 = 111
UC_X86_REG_R14 = 112
UC_X86_REG_R15 = 113
UC_X86_REG_ST0 = 114
UC_X86_REG_ST1 = 115
UC_X86_REG_ST2 = 116
UC_X86_REG_ST3 = 117
UC_X86_REG_ST4 = 118
UC_X86_REG_ST5 = 119
UC_X86_REG_ST6 = 120
UC_X86_REG_ST7 = 121
UC_X86_REG_XMM0 = 122
UC_X86_REG_XMM1 = 123
UC_X86_REG_XMM2 = 124
UC_X86_REG_XMM3 = 125
UC_X86_REG_XMM4 = 126
UC_X86_REG_XMM5 = 127
UC_X86_REG_XMM6 = 128
UC_X86_REG_XMM7 = 129
UC_X86_REG_XMM8 = 130
UC_X86_REG_XMM9 = 131
UC_X86_REG_XMM10 = 132
UC_X86_REG_XMM11 = 133
UC_X86_REG_XMM12 = 134
UC_X86_REG_XMM13 = 135
UC_X86_REG_XMM14 = 136
UC_X86_REG_XMM15 = 137
UC_X86_REG_XMM16 = 138
UC_X86_REG_XMM17 = 139
UC_X86_REG_XMM18 = 140
UC_X86_REG_XMM19 = 141
UC_X86_REG_XMM20 = 142
UC_X86_REG_XMM21 = 143
UC_X86_REG_XMM22 = 144
UC_X86_REG_XMM23 = 145
UC_X86_REG_XMM24 = 146
UC_X86_REG_XMM25 = 147
UC_X86_REG_XMM26 = 148
UC_X86_REG_XMM27 = 149
UC_X86_REG_XMM28 = 150
UC_X86_REG_XMM29 = 151
UC_X86_REG_XMM30 = 152
UC_X86_REG_XMM31 = 153
UC_X86_REG_YMM0 = 154
UC_X86_REG_YMM1 = 155
UC_X86_REG_YMM2 = 156
UC_X86_REG_YMM3 = 157
UC_X86_REG_YMM4 = 158
UC_X86_REG_YMM5 = 159
UC_X86_REG_YMM6 = 160
UC_X86_REG_YMM7 = 161
UC_X86_REG_YMM8 = 162
UC_X86_REG_YMM9 = 163
UC_X86_REG_YMM10 = 164
UC_X86_REG_YMM11 = 165
UC_X86_REG_YMM12 = 166
UC_X86_REG_YMM13 = 167
UC_X86_REG_YMM14 = 168
UC_X86_REG_YMM15 = 169
UC_X86_REG_YMM16 = 170
UC_X86_REG_YMM17 = 171
UC_X86_REG_YMM18 = 172
UC_X86_REG_YMM19 = 173
UC_X86_REG_YMM20 = 174
UC_X86_REG_YMM21 = 175
UC_X86_REG_YMM22 = 176
UC_X86_REG_YMM23 = 177
UC_X86_REG_YMM24 = 178
UC_X86_REG_YMM25 = 179
UC_X86_REG_YMM26 = 180
UC_X86_REG_YMM27 = 181
UC_X86_REG_YMM28 = 182
UC_X86_REG_YMM29 = 183
UC_X86_REG_YMM30 = 184
UC_X86_REG_YMM31 = 185
UC_X86_REG_ZMM0 = 186
UC_X86_REG_ZMM1 = 187
UC_X86_REG_ZMM2 = 188
UC_X86_REG_ZMM3 = 189
UC_X86_REG_ZMM4 = 190
UC_X86_REG_ZMM5 = 191
UC_X86_REG_ZMM6 = 192
UC_X86_REG_ZMM7 = 193
UC_X86_REG_ZMM8 = 194
UC_X86_REG_ZMM9 = 195
UC_X86_REG_ZMM10 = 196
UC_X86_REG_ZMM11 = 197
UC_X86_REG_ZMM12 = 198
UC_X86_REG_ZMM13 = 199
UC_X86_REG_ZMM14 = 200
UC_X86_REG_ZMM15 = 201
UC_X86_REG_ZMM16 = 202
UC_X86_REG_ZMM17 = 203
UC_X86_REG_ZMM18 = 204
UC_X86_REG_ZMM19 = 205
UC_X86_REG_ZMM20 = 206
UC_X86_REG_ZMM21 = 207
UC_X86_REG_ZMM22 = 208
UC_X86_REG_ZMM23 = 209
UC_X86_REG_ZMM24 = 210
UC_X86_REG_ZMM25 = 211
UC_X86_REG_ZMM26 = 212
UC_X86_REG_ZMM27 = 213
UC_X86_REG_ZMM28 = 214
UC_X86_REG_ZMM29 = 215
UC_X86_REG_ZMM30 = 216
UC_X86_REG_ZMM31 = 217
UC_X86_REG_R8B = 218
UC_X86_REG_R9B = 219
UC_X86_REG_R10B = 220
UC_X86_REG_R11B = 221
UC_X86_REG_R12B = 222
UC_X86_REG_R13B = 223
UC_X86_REG_R14B = 224
UC_X86_REG_R15B = 225
UC_X86_REG_R8D = 226
UC_X86_REG_R9D = 227
UC_X86_REG_R10D = 228
UC_X86_REG_R11D = 229
UC_X86_REG_R12D = 230
UC_X86_REG_R13D = 231
UC_X86_REG_R14D = 232
UC_X86_REG_R15D = 233
UC_X86_REG_R8W = 234
UC_X86_REG_R9W = 235
UC_X86_REG_R10W = 236
UC_X86_REG_R11W = 237
UC_X86_REG_R12W = 238
UC_X86_REG_R13W = 239
UC_X86_REG_R14W = 240
UC_X86_REG_R15W = 241
UC_X86_REG_IDTR = 242
UC_X86_REG_GDTR = 243
UC_X86_REG_LDTR = 244
UC_X86_REG_TR = 245
UC_X86_REG_FPCW = 246
UC_X86_REG_FPTAG = 247
UC_X86_REG_MSR = 248
UC_X86_REG_MXCSR = 249
UC_X86_REG_FS_BASE = 250
UC_X86_REG_GS_BASE = 251
UC_X86_REG_ENDING = 252
UC_X86_REG_ES = 27
UC_X86_REG_ESI = 28
UC_X86_REG_ESP = 29
UC_X86_REG_FPSW = 30
UC_X86_REG_FS = 31
UC_X86_REG_GS = 32
UC_X86_REG_IP = 33
UC_X86_REG_RAX = 34
UC_X86_REG_RBP = 35
UC_X86_REG_RBX = 36
UC_X86_REG_RCX = 37
UC_X86_REG_RDI = 38
UC_X86_REG_RDX = 39
UC_X86_REG_RIP = 40
UC_X86_REG_RSI = 41
UC_X86_REG_RSP = 42
UC_X86_REG_SI = 43
UC_X86_REG_SIL = 44
UC_X86_REG_SP = 45
UC_X86_REG_SPL = 46
UC_X86_REG_SS = 47
UC_X86_REG_CR0 = 48
UC_X86_REG_CR1 = 49
UC_X86_REG_CR2 = 50
UC_X86_REG_CR3 = 51
UC_X86_REG_CR4 = 52
UC_X86_REG_CR8 = 53
UC_X86_REG_DR0 = 54
UC_X86_REG_DR1 = 55
UC_X86_REG_DR2 = 56
UC_X86_REG_DR3 = 57
UC_X86_REG_DR4 = 58
UC_X86_REG_DR5 = 59
UC_X86_REG_DR6 = 60
UC_X86_REG_DR7 = 61
UC_X86_REG_FP0 = 62
UC_X86_REG_FP1 = 63
UC_X86_REG_FP2 = 64
UC_X86_REG_FP3 = 65
UC_X86_REG_FP4 = 66
UC_X86_REG_FP5 = 67
UC_X86_REG_FP6 = 68
UC_X86_REG_FP7 = 69
UC_X86_REG_K0 = 70
UC_X86_REG_K1 = 71
UC_X86_REG_K2 = 72
UC_X86_REG_K3 = 73
UC_X86_REG_K4 = 74
UC_X86_REG_K5 = 75
UC_X86_REG_K6 = 76
UC_X86_REG_K7 = 77
UC_X86_REG_MM0 = 78
UC_X86_REG_MM1 = 79
UC_X86_REG_MM2 = 80
UC_X86_REG_MM3 = 81
UC_X86_REG_MM4 = 82
UC_X86_REG_MM5 = 83
UC_X86_REG_MM6 = 84
UC_X86_REG_MM7 = 85
UC_X86_REG_R8 = 86
UC_X86_REG_R9 = 87
UC_X86_REG_R10 = 88
UC_X86_REG_R11 = 89
UC_X86_REG_R12 = 90
UC_X86_REG_R13 = 91
UC_X86_REG_R14 = 92
UC_X86_REG_R15 = 93
UC_X86_REG_ST0 = 94
UC_X86_REG_ST1 = 95
UC_X86_REG_ST2 = 96
UC_X86_REG_ST3 = 97
UC_X86_REG_ST4 = 98
UC_X86_REG_ST5 = 99
UC_X86_REG_ST6 = 100
UC_X86_REG_ST7 = 101
UC_X86_REG_XMM0 = 102
UC_X86_REG_XMM1 = 103
UC_X86_REG_XMM2 = 104
UC_X86_REG_XMM3 = 105
UC_X86_REG_XMM4 = 106
UC_X86_REG_XMM5 = 107
UC_X86_REG_XMM6 = 108
UC_X86_REG_XMM7 = 109
UC_X86_REG_XMM8 = 110
UC_X86_REG_XMM9 = 111
UC_X86_REG_XMM10 = 112
UC_X86_REG_XMM11 = 113
UC_X86_REG_XMM12 = 114
UC_X86_REG_XMM13 = 115
UC_X86_REG_XMM14 = 116
UC_X86_REG_XMM15 = 117
UC_X86_REG_XMM16 = 118
UC_X86_REG_XMM17 = 119
UC_X86_REG_XMM18 = 120
UC_X86_REG_XMM19 = 121
UC_X86_REG_XMM20 = 122
UC_X86_REG_XMM21 = 123
UC_X86_REG_XMM22 = 124
UC_X86_REG_XMM23 = 125
UC_X86_REG_XMM24 = 126
UC_X86_REG_XMM25 = 127
UC_X86_REG_XMM26 = 128
UC_X86_REG_XMM27 = 129
UC_X86_REG_XMM28 = 130
UC_X86_REG_XMM29 = 131
UC_X86_REG_XMM30 = 132
UC_X86_REG_XMM31 = 133
UC_X86_REG_YMM0 = 134
UC_X86_REG_YMM1 = 135
UC_X86_REG_YMM2 = 136
UC_X86_REG_YMM3 = 137
UC_X86_REG_YMM4 = 138
UC_X86_REG_YMM5 = 139
UC_X86_REG_YMM6 = 140
UC_X86_REG_YMM7 = 141
UC_X86_REG_YMM8 = 142
UC_X86_REG_YMM9 = 143
UC_X86_REG_YMM10 = 144
UC_X86_REG_YMM11 = 145
UC_X86_REG_YMM12 = 146
UC_X86_REG_YMM13 = 147
UC_X86_REG_YMM14 = 148
UC_X86_REG_YMM15 = 149
UC_X86_REG_YMM16 = 150
UC_X86_REG_YMM17 = 151
UC_X86_REG_YMM18 = 152
UC_X86_REG_YMM19 = 153
UC_X86_REG_YMM20 = 154
UC_X86_REG_YMM21 = 155
UC_X86_REG_YMM22 = 156
UC_X86_REG_YMM23 = 157
UC_X86_REG_YMM24 = 158
UC_X86_REG_YMM25 = 159
UC_X86_REG_YMM26 = 160
UC_X86_REG_YMM27 = 161
UC_X86_REG_YMM28 = 162
UC_X86_REG_YMM29 = 163
UC_X86_REG_YMM30 = 164
UC_X86_REG_YMM31 = 165
UC_X86_REG_ZMM0 = 166
UC_X86_REG_ZMM1 = 167
UC_X86_REG_ZMM2 = 168
UC_X86_REG_ZMM3 = 169
UC_X86_REG_ZMM4 = 170
UC_X86_REG_ZMM5 = 171
UC_X86_REG_ZMM6 = 172
UC_X86_REG_ZMM7 = 173
UC_X86_REG_ZMM8 = 174
UC_X86_REG_ZMM9 = 175
UC_X86_REG_ZMM10 = 176
UC_X86_REG_ZMM11 = 177
UC_X86_REG_ZMM12 = 178
UC_X86_REG_ZMM13 = 179
UC_X86_REG_ZMM14 = 180
UC_X86_REG_ZMM15 = 181
UC_X86_REG_ZMM16 = 182
UC_X86_REG_ZMM17 = 183
UC_X86_REG_ZMM18 = 184
UC_X86_REG_ZMM19 = 185
UC_X86_REG_ZMM20 = 186
UC_X86_REG_ZMM21 = 187
UC_X86_REG_ZMM22 = 188
UC_X86_REG_ZMM23 = 189
UC_X86_REG_ZMM24 = 190
UC_X86_REG_ZMM25 = 191
UC_X86_REG_ZMM26 = 192
UC_X86_REG_ZMM27 = 193
UC_X86_REG_ZMM28 = 194
UC_X86_REG_ZMM29 = 195
UC_X86_REG_ZMM30 = 196
UC_X86_REG_ZMM31 = 197
UC_X86_REG_R8B = 198
UC_X86_REG_R9B = 199
UC_X86_REG_R10B = 200
UC_X86_REG_R11B = 201
UC_X86_REG_R12B = 202
UC_X86_REG_R13B = 203
UC_X86_REG_R14B = 204
UC_X86_REG_R15B = 205
UC_X86_REG_R8D = 206
UC_X86_REG_R9D = 207
UC_X86_REG_R10D = 208
UC_X86_REG_R11D = 209
UC_X86_REG_R12D = 210
UC_X86_REG_R13D = 211
UC_X86_REG_R14D = 212
UC_X86_REG_R15D = 213
UC_X86_REG_R8W = 214
UC_X86_REG_R9W = 215
UC_X86_REG_R10W = 216
UC_X86_REG_R11W = 217
UC_X86_REG_R12W = 218
UC_X86_REG_R13W = 219
UC_X86_REG_R14W = 220
UC_X86_REG_R15W = 221
UC_X86_REG_IDTR = 222
UC_X86_REG_GDTR = 223
UC_X86_REG_LDTR = 224
UC_X86_REG_TR = 225
UC_X86_REG_FPCW = 226
UC_X86_REG_FPTAG = 227
UC_X86_REG_MSR = 228
UC_X86_REG_MXCSR = 229
UC_X86_REG_FS_BASE = 230
UC_X86_REG_GS_BASE = 231
UC_X86_REG_FLAGS = 232
UC_X86_REG_RFLAGS = 233
UC_X86_REG_FIP = 234
UC_X86_REG_FCS = 235
UC_X86_REG_FDP = 236
UC_X86_REG_FDS = 237
UC_X86_REG_FOP = 238
UC_X86_REG_ENDING = 239
# X86 instructions

View File

@ -8,4 +8,4 @@ install: gen_const
cd unicorn_gem && gem install --local pkg/unicorn-engine-1.0.1.gem
gen_const:
cd .. && python const_generator.py ruby
cd .. && python3 const_generator.py ruby

View File

@ -2,6 +2,13 @@
module UnicornEngine
# ARM64 CPU
UC_CPU_AARCH64_A57 = 0
UC_CPU_AARCH64_A53 = 1
UC_CPU_AARCH64_A72 = 2
UC_CPU_AARCH64_MAX = 3
# ARM64 registers
UC_ARM64_REG_INVALID = 0

View File

@ -2,6 +2,43 @@
module UnicornEngine
# ARM CPU
UC_CPU_ARM_926 = 0
UC_CPU_ARM_946 = 1
UC_CPU_ARM_1026 = 2
UC_CPU_ARM_1136_R2 = 3
UC_CPU_ARM_1136 = 4
UC_CPU_ARM_1176 = 5
UC_CPU_ARM_11MPCORE = 6
UC_CPU_ARM_CORTEX_M0 = 7
UC_CPU_ARM_CORTEX_M3 = 8
UC_CPU_ARM_CORTEX_M4 = 9
UC_CPU_ARM_CORTEX_M7 = 10
UC_CPU_ARM_CORTEX_M33 = 11
UC_CPU_ARM_CORTEX_R5 = 12
UC_CPU_ARM_CORTEX_R5F = 13
UC_CPU_ARM_CORTEX_A7 = 14
UC_CPU_ARM_CORTEX_A8 = 15
UC_CPU_ARM_CORTEX_A9 = 16
UC_CPU_ARM_CORTEX_A15 = 17
UC_CPU_ARM_TI925T = 18
UC_CPU_ARM_SA1100 = 19
UC_CPU_ARM_SA1110 = 20
UC_CPU_ARM_PXA250 = 21
UC_CPU_ARM_PXA255 = 22
UC_CPU_ARM_PXA260 = 23
UC_CPU_ARM_PXA261 = 24
UC_CPU_ARM_PXA262 = 25
UC_CPU_ARM_PXA270 = 26
UC_CPU_ARM_PXA270A0 = 27
UC_CPU_ARM_PXA270A1 = 28
UC_CPU_ARM_PXA270B0 = 29
UC_CPU_ARM_PXA270B1 = 30
UC_CPU_ARM_PXA270C0 = 31
UC_CPU_ARM_PXA270C5 = 32
UC_CPU_ARM_MAX = 33
# ARM registers
UC_ARM_REG_INVALID = 0
@ -122,7 +159,28 @@ module UnicornEngine
UC_ARM_REG_MSP = 115
UC_ARM_REG_PSP = 116
UC_ARM_REG_CONTROL = 117
UC_ARM_REG_ENDING = 118
UC_ARM_REG_IAPSR = 118
UC_ARM_REG_EAPSR = 119
UC_ARM_REG_XPSR = 120
UC_ARM_REG_EPSR = 121
UC_ARM_REG_IEPSR = 122
UC_ARM_REG_PRIMASK = 123
UC_ARM_REG_BASEPRI = 124
UC_ARM_REG_BASEPRI_MAX = 125
UC_ARM_REG_FAULTMASK = 126
UC_ARM_REG_APSR_NZCVQ = 127
UC_ARM_REG_APSR_G = 128
UC_ARM_REG_APSR_NZCVQG = 129
UC_ARM_REG_IAPSR_NZCVQ = 130
UC_ARM_REG_IAPSR_G = 131
UC_ARM_REG_IAPSR_NZCVQG = 132
UC_ARM_REG_EAPSR_NZCVQ = 133
UC_ARM_REG_EAPSR_G = 134
UC_ARM_REG_EAPSR_NZCVQG = 135
UC_ARM_REG_XPSR_NZCVQ = 136
UC_ARM_REG_XPSR_G = 137
UC_ARM_REG_XPSR_NZCVQG = 138
UC_ARM_REG_ENDING = 139
# alias registers
UC_ARM_REG_R13 = 12

View File

@ -2,6 +2,18 @@
module UnicornEngine
# M68K CPU
UC_CPU_M68K_M5206 = 0
UC_CPU_M68K_M68000 = 1
UC_CPU_M68K_M68020 = 2
UC_CPU_M68K_M68030 = 3
UC_CPU_M68K_M68040 = 4
UC_CPU_M68K_M68060 = 5
UC_CPU_M68K_M5208 = 6
UC_CPU_M68K_CFV4E = 7
UC_CPU_M68K_ANY = 8
# M68K registers
UC_M68K_REG_INVALID = 0

Some files were not shown because too many files have changed in this diff Show More