Revert "removed beaengine"

This reverts commit 9528d9beaa.
This commit is contained in:
Anthony Pesch 2016-04-07 23:43:56 -07:00
parent 7dbdcdc7a7
commit b0dbdf6e50
44 changed files with 29956 additions and 0 deletions

View File

@ -64,6 +64,13 @@ add_subdirectory(deps/sdl2-2.0.3 EXCLUDE_FROM_ALL)
list(APPEND REDREAM_INCLUDE_DIRS deps/sdl2-2.0.3/include)
list(APPEND REDREAM_LIBS SDL2main SDL2-static)
# beaengine
add_library(beaengine STATIC deps/beaengine-4.1/beaengineSources/BeaEngine.c)
target_include_directories(beaengine PUBLIC deps/beaengine-4.1/include)
list(APPEND REDREAM_DEFS BEA_ENGINE_STATIC)
list(APPEND REDREAM_INCLUDE_DIRS deps/beaengine-4.1/include)
list(APPEND REDREAM_LIBS beaengine)
# eigen
list(APPEND REDREAM_DEFS EIGEN_DEFAULT_TO_ROW_MAJOR)
list(APPEND REDREAM_INCLUDE_DIRS deps/eigen-3.2.1)

384
deps/beaengine-4.1/CMakeLists.txt vendored Executable file
View File

@ -0,0 +1,384 @@
project (BeaEngine)
cmake_minimum_required (VERSION 2.6)
set (CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
#set (CMAKE_VERBOSE_MAKEFILE ON)
option (optHAS_OPTIMIZED "Turn Optimizations ON" OFF)
option (optHAS_SYMBOLS "Build with debug Symbols" ON)
option (optBUILD_64BIT "Build 64 bits executable" OFF)
option (optBUILD_DLL "Build Shared Objects" OFF)
option (optBUILD_STDCALL "Build using stdcall" OFF)
option (optBUILD_LITE "Build without text disassembly" OFF)
if (optHAS_OPTIMIZED)
if (optHAS_SYMBOLS)
set (CMAKE_BUILD_TYPE relwithdebinfo)
else (optHAS_SYMBOLS)
set (CMAKE_BUILD_TYPE release)
endif (optHAS_SYMBOLS)
else (optHAS_OPTIMIZED)
if (optHAS_SYMBOLS)
set (CMAKE_BUILD_TYPE Debug)
else (optHAS_SYMBOLS)
set (CMAKE_BUILD_TYPE Debug)
endif (optHAS_SYMBOLS)
endif (optHAS_OPTIMIZED)
# determine BEA_COMPILER
if (NOT BEA_COMPILER)
if (${CMAKE_SYSTEM_NAME} STREQUAL Linux)
if (WATCOM)
set (BEA_COMPILER watcom)
else ()
set (BEA_COMPILER gnu)
endif ()
endif ()
if (${CMAKE_SYSTEM_NAME} STREQUAL FreeBSD)
set (BEA_COMPILER gnu)
endif ()
if (${CMAKE_SYSTEM_NAME} STREQUAL SunOS)
set (BEA_COMPILER suncc)
endif ()
if (${CMAKE_SYSTEM_NAME} STREQUAL Windows)
if (MINGW OR MSYS)
set (BEA_COMPILER gnu)
else ()
if (CYGWIN)
set (BEA_COMPILER gnu)
else ()
if (BORLAND)
set (BEA_COMPILER borland)
else ()
if (MSVC)
set (BEA_COMPILER msvc)
else ()
if (WATCOM)
set (BEA_COMPILER watcom)
endif ()
endif ()
endif ()
endif ()
endif ()
endif ()
endif ()
# =========================================
# gcc configuration
# =========================================
if (BEA_COMPILER STREQUAL gnu)
set (CMAKE_C_COMPILER gcc)
set (CMAKE_CXX_COMPILER g++)
set (BEA_WARNINGS -Wall -W -Wextra -Wconversion -Wno-long-long
-Wshadow -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings)
set (BEA_FLAGS -pedantic -ansi -pipe -fno-common -fshort-enums )
set (BEA_DEFINITIONS "")
if (optHAS_SYMBOLS)
list (APPEND BEA_FLAGS -g)
endif ()
if (optHAS_OPTIMIZED)
list (APPEND BEA_FLAGS -fomit-frame-pointer -O2)
endif ()
if (optBUILD_64BIT)
list (APPEND BEA_FLAGS -m64)
endif ()
if (optBUILD_STDCALL)
list (APPEND BEA_DEFINITIONS "-DBEA_USE_STDCALL")
endif ()
if (optBUILD_LITE)
list (APPEND BEA_DEFINITIONS "-DBEA_LIGHT_DISASSEMBLY")
endif ()
endif ()
# =========================================
# SunStudio configuration
# =========================================
if (BEA_COMPILER STREQUAL suncc)
set (CMAKE_C_COMPILER cc)
set (CMAKE_CXX_COMPILER CC)
list (APPEND BEA_FLAGS "-xmemalign=ab")
endif ()
# =========================================
# Visual Studio configuration
# =========================================
if (BEA_COMPILER STREQUAL msvc)
set (CMAKE_C_COMPILER cl)
set (CMAKE_CXX_COMPILER cl)
set (BEA_DEFINITIONS "/DBEA_LACKS_SNPRINTF /D_CRT_SECURE_NO_WARNINGS")
if (optBUILD_STDCALL)
set (BEA_DEFINITIONS "${BEA_DEFINITIONS} /DBEA_USE_STDCALL")
endif ()
if (optBUILD_LITE)
set (BEA_DEFINITIONS "${BEA_DEFINITIONS} /DBEA_LIGHT_DISASSEMBLY")
endif ()
if (MSVC60)
set (BEA_WARNINGS /W3)
else ()
if (NOT MSVC90)
set (BEA_WARNINGS /W3 /Wp64)
else ()
set (BEA_WARNINGS /W4)
endif ()
endif ()
if (optHAS_SYMBOLS)
list (APPEND BEA_FLAGS /ZI)
list (APPEND BEA_DEFINITIONS "/D_DEBUG=1")
endif ()
if (optHAS_OPTIMIZED)
list (APPEND BEA_FLAGS /O2)
list (APPEND BEA_DEFINITIONS "/DNDEBUG")
endif ()
# determine code generation model
if (optHAS_OPTIMIZED)
if (optBUILD_DLL)
list (APPEND BEA_FLAGS /MD)
else ()
list (APPEND BEA_FLAGS /MT)
endif ()
else ()
if (optBUILD_DLL)
list (APPEND BEA_FLAGS /MDd)
else ()
list (APPEND BEA_FLAGS /MTd)
endif ()
endif ()
endif ()
# =========================================
# Intel Compiler configuration
# =========================================
if (BEA_COMPILER STREQUAL intel)
set (CMAKE_C_COMPILER icc)
set (CMAKE_CXX_COMPILER icpc)
set (BEA_WARNINGS -Wall -Wcheck -Wp64 -wd981 -wd1419 -wd1418)
set (BEA_FLAGS -ansi -pipe)
set (BEA_DEFINITIONS "")
if (optHAS_SYMBOLS)
list (APPEND BEA_FLAGS -g)
endif ()
if (optHAS_OPTIMIZED)
list (APPEND BEA_FLAGS -fomit-frame-pointer -O3 -ip)
endif ()
if (optBUILD_64BIT)
list (APPEND BEA_FLAGS -m64)
endif ()
if (optBUILD_STDCALL)
list (APPEND BEA_DEFINITIONS "-DBEA_USE_STDCALL")
endif ()
if (optBUILD_LITE)
list (APPEND BEA_DEFINITIONS "-DBEA_LIGHT_DISASSEMBLY")
endif ()
endif ()
# =========================================
# Borland C configuration
# =========================================
if (BEA_COMPILER STREQUAL borland)
set (CMAKE_C_COMPILER bcc32)
set (CMAKE_CXX_COMPILER bcc32)
set (BEA_WARNINGS -w -wamb -wdef -wnod -wnak -wcln -wsig -wucp)
set (BEA_FLAGS -pc -p- -H- -b -d -Hu-)
set (BEA_DEFINITIONS "")
if (optHAS_SYMBOLS)
list (APPEND BEA_FLAGS -v -y -R)
endif ()
if (optHAS_OPTIMIZED)
list (APPEND BEA_FLAGS -O2)
endif ()
if (optBUILD_64BIT)
set (BEA_DEFINITIONS "-D_WIN64")
else ()
set (BEA_DEFINITIONS "-D_WIN32")
endif ()
if (optBUILD_STDCALL)
list (APPEND BEA_DEFINITIONS "-DBEA_USE_STDCALL")
endif ()
if (optBUILD_LITE)
list (APPEND BEA_DEFINITIONS "-DBEA_LIGHT_DISASSEMBLY")
endif ()
endif ()
# =========================================
# Watcom C configuration
# =========================================
if (BEA_COMPILER STREQUAL watcom)
set (CMAKE_C_COMPILER wcl386)
set (CMAKE_CXX_COMPILER wcl386)
set (BEA_DEFINITIONS "-DBEA_STL_CONTAINER_REQUIRES_DEFAULT_CTOR")
set (BEA_WARNINGS -w2 -wx )
set (BEA_FLAGS -q -fpi -fpi87 "-bt=nt" -zq -6r -mf)
if (optHAS_SYMBOLS)
list (APPEND BEA_FLAGS -db -d2 )
endif ()
if (optHAS_OPTIMIZED)
list (APPEND BEA_FLAGS -ox -s -ors )
endif ()
if (optBUILD_64BIT)
# list (APPEND BEA_FLAGS -m64)
endif ()
if (optBUILD_STDCALL)
set (BEA_DEFINITIONS "${BEA_DEFINITIONS} -DBEA_USE_STDCALL")
endif ()
if (optBUILD_LITE)
set (BEA_DEFINITIONS "${BEA_DEFINITIONS} -DBEA_LIGHT_DISASSEMBLY")
endif ()
set (CMAKE_EXE_LINKER_FLAGS "-l=nt")
set (CMAKE_SHARED_LINKER_FLAGS "-l=nt")
endif ()
# =========================================
# Pelles C configuration
# =========================================
if (BEA_COMPILER STREQUAL pelles)
set (CMAKE_C_COMPILER pocc)
#set (CMAKE_CXX_COMPILER pocc)
set (BEA_WARNINGS /W2)
set (BEA_FLAGS /Gm /Gn)
set (BEA_DEFINITIONS "")
if (optHAS_SYMBOLS)
list (APPEND BEA_FLAGS /Zi )
endif ()
if (optHAS_OPTIMIZED)
list (APPEND BEA_FLAGS /Ox )
endif ()
if (optBUILD_64BIT)
# list (APPEND BEA_FLAGS -m64)
endif ()
if (optBUILD_STDCALL)
list (APPEND BEA_DEFINITIONS "/DBEA_USE_STDCALL")
endif ()
if (optBUILD_LITE)
list (APPEND BEA_DEFINITIONS "/DBEA_LIGHT_DISASSEMBLY")
endif ()
endif ()
# ============================================
# construct compiler flags
# ============================================
set (myC_FLAGS "")
set (myCXX_FLAGS "")
foreach (flag ${BEA_FLAGS})
set (myC_FLAGS "${myC_FLAGS} ${flag}")
endforeach ()
foreach (flag ${BEA_WARNINGS})
set (myC_FLAGS "${myC_FLAGS} ${flag}")
endforeach ()
foreach (flag ${BEA_FLAGS})
set (myCXX_FLAGS "${myCXX_FLAGS} ${flag}")
endforeach ()
foreach (flag ${BEA_WARNINGS})
set (myCXX_FLAGS "${myCXX_FLAGS} ${flag}")
endforeach ()
# ================================================
# pass compiler flags to cmake
# ================================================
if (${CMAKE_BUILD_TYPE} STREQUAL RelWithDebInfo)
set (CMAKE_C_FLAGS_RELWITHDEBINFO ${myC_FLAGS})
set (CMAKE_CXX_FLAGS_RELWITHDEBINFO ${myCXX_FLAGS})
endif ()
if (${CMAKE_BUILD_TYPE} STREQUAL Release)
set (CMAKE_C_FLAGS_RELEASE ${myC_FLAGS})
set (CMAKE_CXX_FLAGS_RELEASE ${myCXX_FLAGS})
endif ()
if (${CMAKE_BUILD_TYPE} STREQUAL DebugFull)
set (CMAKE_C_FLAGS_DEBUGFULL ${myC_FLAGS})
set (CMAKE_CXX_FLAGS_DEBUGFULL ${myCXX_FLAGS})
endif ()
if (${CMAKE_BUILD_TYPE} STREQUAL Debug)
set (CMAKE_C_FLAGS_DEBUG ${myC_FLAGS})
set (CMAKE_CXX_FLAGS_DEBUG ${myCXX_FLAGS})
endif ()
set (BEA_INCLUDE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/include)
set (BEA_SRC_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/beaengineSources)
# ======================================
# set output dirs
# ======================================
set (myQualification "${CMAKE_SYSTEM_NAME}.${BEA_COMPILER}.${CMAKE_BUILD_TYPE}")
set (myLIB_OUTPUT "${CMAKE_SOURCE_DIR}/lib/${myQualification}" )
set (myBIN_OUTPUT "${CMAKE_SOURCE_DIR}/bin/${myQualification}")
set (myOBJ_OUTPUT obj)
if (optBUILD_64BIT)
set (myLIB_OUTPUT "${myLIB_OUTPUT}.64" )
set (myBIN_OUTPUT "${myBIN_OUTPUT}.64")
set (myOBJ_OUTPUT "${myOBJ_OUTPUT}.64")
endif ()
set (CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${myLIB_OUTPUT})
set (CMAKE_LIBRARY_OUTPUT_DIRECTORY ${myLIB_OUTPUT})
set (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${myBIN_OUTPUT})
FIND_PACKAGE (ZLIB)
set (build_modules
beaengineSources
#examples
#unittest
)
if (NOT ZLIB_FOUND)
set (ZLIB_INCLUDE_DIR unittest/thirdparty/zlib)
else ()
list (APPEND BEA_LIBS_PATH ${ZLIB_LIBRARIES})
endif ()
add_definitions (${BEA_DEFINITIONS})
include_directories (${BEA_SRC_ROOT} ${BEA_INCLUDE_PATH}
${CMAKE_SOURCE_DIR} ${ZLIB_INCLUDE_DIR})
link_directories (${BEA_LIBS_PATH})
set (BEA_TARGET "BeaEngine")
if (NOT optBUILD_DLL)
set (BEA_TARGET "${BEA_TARGET}_s")
endif ()
if (NOT optHAS_OPTIMIZED)
set (BEA_TARGET "${BEA_TARGET}_d")
endif ()
if (optBUILD_STDCALL)
set (BEA_TARGET "${BEA_TARGET}_stdcall")
endif ()
if (optBUILD_64BIT)
set (BEA_TARGET "${BEA_TARGET}_64")
endif ()
foreach (mdl ${build_modules})
set (MDL_SRC "${mdl}")
set (MDL_OBJ "${myOBJ_OUTPUT}/${myQualification}/${mdl}")
add_subdirectory (${MDL_SRC} ${MDL_OBJ})
endforeach ()

View File

@ -0,0 +1,56 @@
/*
* BeaEngine 4 - x86 & x86-64 disassembler library
*
* Copyright 2006-2010, BeatriX
* File coded by BeatriX
*
* This file is part of BeaEngine.
*
* BeaEngine is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* BeaEngine is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with BeaEngine. If not, see <http://www.gnu.org/licenses/>. */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "beaengine/BeaEngine.h"
#include "Includes/protos.h"
#include "Includes/internal_datas.h"
#include "Includes/instr_set/Data_opcode.h"
#include "Includes/instr_set/opcodes_A_M.c"
#include "Includes/instr_set/opcodes_N_Z.c"
#include "Includes/instr_set/opcodes_Grp1.c"
#include "Includes/instr_set/opcodes_Grp2.c"
#include "Includes/instr_set/opcodes_Grp3.c"
#include "Includes/instr_set/opcodes_Grp4.c"
#include "Includes/instr_set/opcodes_Grp5.c"
#include "Includes/instr_set/opcodes_Grp6.c"
#include "Includes/instr_set/opcodes_Grp7.c"
#include "Includes/instr_set/opcodes_Grp8.c"
#include "Includes/instr_set/opcodes_Grp9.c"
#include "Includes/instr_set/opcodes_Grp12.c"
#include "Includes/instr_set/opcodes_Grp13.c"
#include "Includes/instr_set/opcodes_Grp14.c"
#include "Includes/instr_set/opcodes_Grp15.c"
#include "Includes/instr_set/opcodes_Grp16.c"
#include "Includes/instr_set/opcodes_FPU.c"
#include "Includes/instr_set/opcodes_MMX.c"
#include "Includes/instr_set/opcodes_SSE.c"
#include "Includes/instr_set/opcodes_AES.c"
#include "Includes/instr_set/opcodes_CLMUL.c"
#include "Includes/instr_set/opcodes_prefixes.c"
#include "Includes/Routines_ModRM.c"
#include "Includes/Routines_Disasm.c"
#include "Includes/BeaEngineVersion.c"
void BeaEngine(void){return;}

Binary file not shown.

View File

@ -0,0 +1,9 @@
set (BEA_SOURCES BeaEngine.c)
if (optBUILD_DLL)
add_library (${BEA_TARGET} SHARED BeaEngine.c)
set_target_properties (${BEA_TARGET} PROPERTIES COMPILE_FLAGS "-DBUILD_BEA_ENGINE_DLL")
else ()
add_library (${BEA_TARGET} STATIC BeaEngine.c)
set_target_properties (${BEA_TARGET} PROPERTIES COMPILE_FLAGS "-DBEA_ENGINE_STATIC")
endif ()

View File

@ -0,0 +1,165 @@
GNU LESSER GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
This version of the GNU Lesser General Public License incorporates
the terms and conditions of version 3 of the GNU General Public
License, supplemented by the additional permissions listed below.
0. Additional Definitions.
As used herein, "this License" refers to version 3 of the GNU Lesser
General Public License, and the "GNU GPL" refers to version 3 of the GNU
General Public License.
"The Library" refers to a covered work governed by this License,
other than an Application or a Combined Work as defined below.
An "Application" is any work that makes use of an interface provided
by the Library, but which is not otherwise based on the Library.
Defining a subclass of a class defined by the Library is deemed a mode
of using an interface provided by the Library.
A "Combined Work" is a work produced by combining or linking an
Application with the Library. The particular version of the Library
with which the Combined Work was made is also called the "Linked
Version".
The "Minimal Corresponding Source" for a Combined Work means the
Corresponding Source for the Combined Work, excluding any source code
for portions of the Combined Work that, considered in isolation, are
based on the Application, and not on the Linked Version.
The "Corresponding Application Code" for a Combined Work means the
object code and/or source code for the Application, including any data
and utility programs needed for reproducing the Combined Work from the
Application, but excluding the System Libraries of the Combined Work.
1. Exception to Section 3 of the GNU GPL.
You may convey a covered work under sections 3 and 4 of this License
without being bound by section 3 of the GNU GPL.
2. Conveying Modified Versions.
If you modify a copy of the Library, and, in your modifications, a
facility refers to a function or data to be supplied by an Application
that uses the facility (other than as an argument passed when the
facility is invoked), then you may convey a copy of the modified
version:
a) under this License, provided that you make a good faith effort to
ensure that, in the event an Application does not supply the
function or data, the facility still operates, and performs
whatever part of its purpose remains meaningful, or
b) under the GNU GPL, with none of the additional permissions of
this License applicable to that copy.
3. Object Code Incorporating Material from Library Header Files.
The object code form of an Application may incorporate material from
a header file that is part of the Library. You may convey such object
code under terms of your choice, provided that, if the incorporated
material is not limited to numerical parameters, data structure
layouts and accessors, or small macros, inline functions and templates
(ten or fewer lines in length), you do both of the following:
a) Give prominent notice with each copy of the object code that the
Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the object code with a copy of the GNU GPL and this license
document.
4. Combined Works.
You may convey a Combined Work under terms of your choice that,
taken together, effectively do not restrict modification of the
portions of the Library contained in the Combined Work and reverse
engineering for debugging such modifications, if you also do each of
the following:
a) Give prominent notice with each copy of the Combined Work that
the Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the Combined Work with a copy of the GNU GPL and this license
document.
c) For a Combined Work that displays copyright notices during
execution, include the copyright notice for the Library among
these notices, as well as a reference directing the user to the
copies of the GNU GPL and this license document.
d) Do one of the following:
0) Convey the Minimal Corresponding Source under the terms of this
License, and the Corresponding Application Code in a form
suitable for, and under terms that permit, the user to
recombine or relink the Application with a modified version of
the Linked Version to produce a modified Combined Work, in the
manner specified by section 6 of the GNU GPL for conveying
Corresponding Source.
1) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (a) uses at run time
a copy of the Library already present on the user's computer
system, and (b) will operate properly with a modified version
of the Library that is interface-compatible with the Linked
Version.
e) Provide Installation Information, but only if you would otherwise
be required to provide such information under section 6 of the
GNU GPL, and only to the extent that such information is
necessary to install and execute a modified version of the
Combined Work produced by recombining or relinking the
Application with a modified version of the Linked Version. (If
you use option 4d0, the Installation Information must accompany
the Minimal Corresponding Source and Corresponding Application
Code. If you use option 4d1, you must provide the Installation
Information in the manner specified by section 6 of the GNU GPL
for conveying Corresponding Source.)
5. Combined Libraries.
You may place library facilities that are a work based on the
Library side by side in a single library together with other library
facilities that are not Applications and are not covered by this
License, and convey such a combined library under terms of your
choice, if you do both of the following:
a) Accompany the combined library with a copy of the same work based
on the Library, uncombined with any other library facilities,
conveyed under the terms of this License.
b) Give prominent notice with the combined library that part of it
is a work based on the Library, and explaining where to find the
accompanying uncombined form of the same work.
6. Revised Versions of the GNU Lesser General Public License.
The Free Software Foundation may publish revised and/or new versions
of the GNU Lesser General Public License from time to time. Such new
versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the
Library as you received it specifies that a certain numbered version
of the GNU Lesser General Public License "or any later version"
applies to it, you have the option of following the terms and
conditions either of that published version or of any later version
published by the Free Software Foundation. If the Library as you
received it does not specify a version number of the GNU Lesser
General Public License, you may choose any version of the GNU Lesser
General Public License ever published by the Free Software Foundation.
If the Library as you received it specifies that a proxy can decide
whether future versions of the GNU Lesser General Public License shall
apply, that proxy's public statement of acceptance of any version is
permanent authorization for you to choose that version for the
Library.

View File

@ -0,0 +1,674 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.

View File

@ -0,0 +1,23 @@
/* Copyright 2006-2010, BeatriX
* File coded by BeatriX
*
* This file is part of BeaEngine.
*
* BeaEngine is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* BeaEngine is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with BeaEngine. If not, see <http://www.gnu.org/licenses/>. */
const__ char* __bea_callspec__ BeaEngineVersion(void) {
return "4.1";
}
const__ char* __bea_callspec__ BeaEngineRevision(void) {
return "175";
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,174 @@
/* Copyright 2006-2009, BeatriX
* File coded by BeatriX
*
* This file is part of BeaEngine.
*
* BeaEngine is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* BeaEngine is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with BeaEngine. If not, see <http://www.gnu.org/licenses/>. */
/* =============================================================================== */
/* */
/* */
/* 1 BYTE_OPCODE MAP */
/* */
/* */
/* =============================================================================== */
void (__bea_callspec__ * opcode_map1[])(PDISASM) = {
add_EbGb , add_EvGv , add_GbEb , add_GvEv , add_ALIb , add_eAX_Iv, push_es , pop_es , or_EbGb , or_EvGv , or_GbEb , or_GvEv , or_ALIb , or_eAX_Iv , push_cs , Esc_2byte ,
adc_EbGb , adc_EvGv , adc_GbEb , adc_GvEv , adc_ALIb , adc_eAX_Iv, push_ss , pop_ss , sbb_EbGb , sbb_EvGv , sbb_GbEb , sbb_GvEv , sbb_ALIb , sbb_eAX_Iv, push_ds , pop_ds ,
and_EbGb , and_EvGv , and_GbEb , and_GvEv , and_ALIb , and_eAX_Iv, PrefSEGES , daa_ , sub_EbGb , sub_EvGv , sub_GbEb , sub_GvEv , sub_ALIb , sub_eAX_Iv, PrefSEGCS , das_ ,
xor_EbGb , xor_EvGv , xor_GbEb , xor_GvEv , xor_ALIb , xor_eAX_Iv, PrefSEGSS , aaa_ , cmp_EbGb , cmp_EvGv , cmp_GbEb , cmp_GvEv , cmp_ALIb , cmp_eAX_Iv, PrefSEGDS , aas_ ,
inc_eax , inc_ecx , inc_edx , inc_ebx , inc_esp , inc_ebp , inc_esi , inc_edi , dec_eax , dec_ecx , dec_edx , dec_ebx , dec_esp , dec_ebp , dec_esi , dec_edi ,
push_eax , push_ecx , push_edx , push_ebx , push_esp , push_ebp , push_esi , push_edi , pop_eax , pop_ecx , pop_edx , pop_ebx , pop_esp , pop_ebp , pop_esi , pop_edi ,
pushad_ , popad_ , bound_ , arpl_ , PrefSEGFS , PrefSEGGS , PrefOpSize, PrefAdSize, push_Iv ,imul_GvEvIv, push_Ib ,imul_GvEvIb, insb_ , ins_ , outsb_ , outsw_ ,
jo_ , jno_ , jc_ , jnc_ , je_ , jne_ , jbe_ , jnbe_ , js_ , jns_ , jp_ , jnp_ , jl_ , jnl_ , jle_ , jnle_ ,
G1_EbIb , G1_EvIv , G1_EbIb2 , G1_EvIb , test_EbGb , test_EvGv , xchg_EbGb , xchg_EvGv , mov_EbGb , mov_EvGv , mov_GbEb , mov_GvEv , mov_EwSreg, lea_GvM , mov_SregEw, pop_Ev ,
nop_ , xchg_ecx , xchg_edx , xchg_ebx , xchg_esp , xchg_ebp , xchg_esi , xchg_edi , cwde_ , cdq_ , callf_ , wait_ , pushfd_ , popfd_ , sahf_ , lahf_ ,
mov_ALOb , mov_eAXOv , mov_ObAL , mov_OveAX , movs_ , movsw_ , cmpsb_ , cmps_ , test_ALIb ,test_eAX_Iv, stos_ , stosw_ , lodsb_ , lodsw_ , scasb_ , scas_ ,
mov_ALIb , mov_CLIb , mov_DLIb , mov_BLIb , mov_AHIb , mov_CHIb , mov_DHIb , mov_BHIb , mov_EAX , mov_ECX , mov_EDX , mov_EBX , mov_ESP , mov_EBP , mov_ESI , mov_EDI ,
G2_EbIb , G2_EvIb , retn_ , ret_ , les_GvM , lds_GvM , mov_EbIb , mov_EvIv , enter_ , leave_ , retf_Iw , retf_ , int3_ , int_ , into_ , iret_ ,
G2_Eb1 , G2_Ev1 , G2_EbCL , G2_EvCL , aam_ , aad_ , salc_ , xlat_ , D8_ , D9_ , DA_ , DB_ , DC_ , DD_ , DE_ , DF_ ,
loopne_ , loope_ , loop_ , jecxz_ , in_ALIb , in_eAX_Ib , out_IbAL , out_Ib_eAX, call_ , jmp_near , jmp_far , jmp_short , in_ALDX , in_eAX , out_DXAL , out_DXeAX ,
PrefLock , int1_ , PrefREPNE , PrefREPE , hlt_ , cmc_ , G3_Eb , G3_Ev , clc_ , stc_ , cli_ , sti_ , cld_ , std_ , G4_Eb , G5_Ev ,
};
/* =============================================================================== */
/* */
/* */
/* 2 BYTE_OPCODE MAP --> 0F xx */
/* */
/* */
/* =============================================================================== */
void (__bea_callspec__ *opcode_map2[])(PDISASM) = {
G6_ , G7_ , lar_GvEw , lsl_GvEw , FailDecode, syscall_ , clts_ , sysret_ , invd_ , wbinvd_ , FailDecode, ud2_ , FailDecode, nop_Ev , femms_ , FailDecode,
movups_VW , movups_WV , movlps_VM , movlps_MV , unpcklps_ , unpckhps_ , movhps_VM , movhps_MV , G16_ , hint_nop , hint_nop , hint_nop , hint_nop , hint_nop , hint_nop , nop_Ev ,
mov_RdCd , mov_RdDd , mov_CdRd , mov_DdRd , FailDecode, FailDecode, FailDecode, FailDecode, movaps_VW , movaps_WV , cvtpi2ps_ , movntps_ , cvttps2pi_, cvtps2pi_ , ucomiss_VW, comiss_VW ,
wrmsr_ , rdtsc_ , rdmsr_ , rdpmc_ , sysenter_ , sysexit_ , FailDecode, FailDecode,Esc_tableA4, FailDecode,Esc_tableA5, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode,
cmovo_ , cmovno_ , cmovb_ , cmovnb_ , cmove_ , cmovne_ , cmovbe_ , cmovnbe_ , cmovs_ , cmovns_ , cmovp_ , cmovnp_ , cmovl_ , cmovnl_ , cmovle_ , cmovnle_ ,
movmskps_ , sqrtps_VW , rsqrtps_ , rcpps_ , andps_VW , andnps_VW , orps_VW , xorps_VW , addps_VW , mulps_VW , cvtps2pd_ , cvtdq2ps_ , subps_VW , minps_VW , divps_VW , maxps_VW ,
punpcklbw_, punpcklwd_, punpckldq_, packsswb_ , pcmpgtb_ , pcmpgtw_ , pcmpgtd_ , packuswb_ , punpckhbw_, punpckhwd_, punpckhdq_, packssdw_ ,punpcklqdq_,punpckhqdq_, movd_PE , movq_PQ ,
pshufw_ , G12_ , G13_ , G14_ , pcmpeqb_ , pcmpeqw_ , pcmpeqd_ , emms_ , vmread_ , vmwrite_ , FailDecode, FailDecode, haddpd_VW , hsubpd_VW , movd_EP , movq_QP ,
jo_near , jno_near , jc_near , jnc_near , je_near , jne_near , jbe_near , ja_near , js_near , jns_near , jp_near , jnp_near , jl_near , jnl_near , jle_near , jnle_near ,
seto_ , setno_ , setb_ , setnb_ , sete_ , setne_ , setbe_ , setnbe_ , sets_ , setns_ , setp_ , setnp_ , setnge_ , setge_ , setle_ , setnle_ ,
push_fs , pop_fs , cpuid_ , bt_EvGv ,shld_EvGvIb,shld_EvGvCL, FailDecode, FailDecode, push_gs , pop_gs , rsm_ , bts_EvGv ,shrd_EvGvIb,shrd_EvGvCL, G15_ , imul_GvEv ,
cmpx_EbGb , cmpx_EvGv , lss_Mp , btr_EvGv , lfs_Mp , lgs_Mp , movzx_GvEb, movzx_GvEw, popcnt_ , ud2_ , G8_EvIb , btc_EvGv , bsf_GvEv , bsr_GvEv , movsx_GvEb, movsx_GvEw,
xadd_EbGb , xadd_EvGv , cmpps_VW , movnti_ , pinsrw_ , pextrw_ , shufps_ , G9_ , bswap_eax , bswap_ecx , bswap_edx , bswap_ebx , bswap_esp , bswap_ebp , bswap_esi , bswap_edi ,
addsubpd_ , psrlw_ , psrld_ , psrlq_ , paddq_ , pmullw_ , movq_WV , pmovmskb_ , psubusb_ , psubusw_ , pminub_ , pand_ , paddusb_ , paddusw_ , pmaxub_ , pandn_ ,
pavgb_ , psraw_ , psrad_ , pavgw_ , pmulhuw_ , pmulhw_ , cvtpd2dq_ , movntq_ , psubsb_ , psubsw_ , pminsw_ , por_ , paddsb_ , paddsw_ , pmaxsw_ , pxor_ ,
lddqu_ , psllw_ , pslld_ , psllq_ , pmuludq_ , pmaddwd_ , psadbw_ , maskmovq_ , psubb_ , psubw_ , psubd_ , psubq_ , paddb_ , paddw_ , paddd_ , FailDecode,
};
/* =============================================================================== */
/* */
/* */
/* 3 BYTE_OPCODE MAP --> 0F 38 xx */
/* */
/* */
/* =============================================================================== */
void (__bea_callspec__ *opcode_map3[])(PDISASM) = {
pshufb_ , phaddw_ , phaddd_ , phaddsw_ , pmaddubsw_, phsubw_ , phsubd_ , phsubsw_ , psignb_ , psignw_ , psignd_ , pmulhrsw_ , FailDecode, FailDecode, FailDecode, FailDecode,
pblendvb_ , FailDecode, FailDecode, FailDecode, blendvps_ , blendvpd_ , FailDecode, ptest_ , FailDecode, FailDecode, FailDecode, FailDecode, pabsb_ , pabsw_ , pabsd_ , FailDecode,
pmovsxbw_ , pmovsxbd_ , pmovsxbq_ , pmovsxwd_ , pmovsxwq_ , pmovsxdq_ , FailDecode, FailDecode, pmuldq_ , pcmpeqq_ , movntdqa_ , packusdw_ , FailDecode, FailDecode, FailDecode, FailDecode,
pmovzxbw_ , pmovzxbd_ , pmovzxbq_ , pmovzxwd_ , pmovzxwq_ , pmovzxdq_ , FailDecode, pcmpgtq_ , pminsb_ , pminsd_ , pminuw_ , pminud_ , pmaxsb_ , pmaxsd_ , pmaxuw_ , pmaxud_ ,
pmulld_ ,phminposuw_, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode,
FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode,
FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode,
FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode,
FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode,
FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode,
FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode,
FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode,
FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode,
FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, aesimc , aesenc , aesenclast, aesdec , aesdeclast,
FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode,
crc32_GvEb, crc32_GvEv, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode,
};
/* =============================================================================== */
/* */
/* */
/* 3 UInt8_OPCODE MAP --> 0F 3A xx */
/* */
/* */
/* =============================================================================== */
void (__bea_callspec__ *opcode_map4[])(PDISASM) = {
FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, roundps_ , roundpd_ , roundss_ , roundsd_ , blendps_ , blendpd_ , pblendw_ , palignr_ ,
FailDecode, FailDecode, FailDecode, FailDecode, pextrb_ , pextrw2_ , pextrd_ , extractps_, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode,
pinsrb_ , insertps_ , pinsrd_ , FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode,
FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode,
dpps_ , dppd_ , mpsadbw_ , FailDecode, pclmulqdq_, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode,
FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode,
pcmpestrm_, pcmpestri_, pcmpistrm_, pcmpistri_, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode,
FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode,
FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode,
FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode,
FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode,
FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode,
FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode,
FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, aeskeygen ,
FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode,
FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode,
};
void (__bea_callspec__ *ModRM_0[])(ARGTYPE*, PDISASM) = {
Addr_EAX,
Addr_ECX,
Addr_EDX,
Addr_EBX,
Addr_SIB,
Addr_disp32,
Addr_ESI,
Addr_EDI,
};
void (__bea_callspec__ *ModRM_1[])(ARGTYPE*, PDISASM) = {
Addr_EAX_disp8,
Addr_ECX_disp8,
Addr_EDX_disp8,
Addr_EBX_disp8,
Addr_SIB_disp8,
Addr_EBP_disp8,
Addr_ESI_disp8,
Addr_EDI_disp8,
};
void (__bea_callspec__ *ModRM_2[])(ARGTYPE*, PDISASM) = {
Addr_EAX_disp32,
Addr_ECX_disp32,
Addr_EDX_disp32,
Addr_EBX_disp32,
Addr_SIB_disp32,
Addr_EBP_disp32,
Addr_ESI_disp32,
Addr_EDI_disp32,
};
void (__bea_callspec__ *ModRM_3[])(ARGTYPE*, PDISASM) = {
_rEAX,
_rECX,
_rEDX,
_rEBX,
_rESP,
_rEBP,
_rESI,
_rEDI,
};
size_t (__bea_callspec__ *SIB[])(ARGTYPE*, size_t, PDISASM) = {
SIB_0,
SIB_1,
SIB_2,
SIB_3,
};

View File

@ -0,0 +1,168 @@
/* Copyright 2006-2009, BeatriX
* File coded by BeatriX
*
* This file is part of BeaEngine.
*
* BeaEngine is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* BeaEngine is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with BeaEngine. If not, see <http://www.gnu.org/licenses/>. */
/* ====================================================================
* 0x 0f 38 db
* ==================================================================== */
void __bea_callspec__ aesimc(PDISASM pMyDisasm)
{
/* ========== 0x66 */
if (GV.OperandSize == 16) {
GV.OperandSize = GV.OriginalOperandSize;
(*pMyDisasm).Prefix.OperandSize = MandatoryPrefix;
GV.MemDecoration = Arg2dqword;
(*pMyDisasm).Instruction.Category = AES_INSTRUCTION;
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "aesimc ");
#endif
GV.SSE_ = 1;
GxEx(pMyDisasm);
GV.SSE_ = 0;
}
else {
FailDecode(pMyDisasm);
}
}
/* ====================================================================
* 0x 0f 38 dc
* ==================================================================== */
void __bea_callspec__ aesenc(PDISASM pMyDisasm)
{
/* ========== 0x66 */
if (GV.OperandSize == 16) {
GV.OperandSize = GV.OriginalOperandSize;
(*pMyDisasm).Prefix.OperandSize = MandatoryPrefix;
GV.MemDecoration = Arg2dqword;
(*pMyDisasm).Instruction.Category = AES_INSTRUCTION;
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "aesenc ");
#endif
GV.SSE_ = 1;
GxEx(pMyDisasm);
GV.SSE_ = 0;
}
else {
FailDecode(pMyDisasm);
}
}
/* ====================================================================
* 0x 0f 38 dd
* ==================================================================== */
void __bea_callspec__ aesenclast(PDISASM pMyDisasm)
{
/* ========== 0x66 */
if (GV.OperandSize == 16) {
GV.OperandSize = GV.OriginalOperandSize;
(*pMyDisasm).Prefix.OperandSize = MandatoryPrefix;
GV.MemDecoration = Arg2dqword;
(*pMyDisasm).Instruction.Category = AES_INSTRUCTION;
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "aesenclast ");
#endif
GV.SSE_ = 1;
GxEx(pMyDisasm);
GV.SSE_ = 0;
}
else {
FailDecode(pMyDisasm);
}
}
/* ====================================================================
* 0x 0f 38 de
* ==================================================================== */
void __bea_callspec__ aesdec(PDISASM pMyDisasm)
{
/* ========== 0x66 */
if (GV.OperandSize == 16) {
GV.OperandSize = GV.OriginalOperandSize;
(*pMyDisasm).Prefix.OperandSize = MandatoryPrefix;
GV.MemDecoration = Arg2dqword;
(*pMyDisasm).Instruction.Category = AES_INSTRUCTION;
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "aesdec ");
#endif
GV.SSE_ = 1;
GxEx(pMyDisasm);
GV.SSE_ = 0;
}
else {
FailDecode(pMyDisasm);
}
}
/* ====================================================================
* 0x 0f 38 df
* ==================================================================== */
void __bea_callspec__ aesdeclast(PDISASM pMyDisasm)
{
/* ========== 0x66 */
if (GV.OperandSize == 16) {
GV.OperandSize = GV.OriginalOperandSize;
(*pMyDisasm).Prefix.OperandSize = MandatoryPrefix;
GV.MemDecoration = Arg2dqword;
(*pMyDisasm).Instruction.Category = AES_INSTRUCTION;
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "aesdeclast ");
#endif
GV.SSE_ = 1;
GxEx(pMyDisasm);
GV.SSE_ = 0;
}
else {
FailDecode(pMyDisasm);
}
}
/* ====================================================================
* 0x 0f 3a df
* ==================================================================== */
void __bea_callspec__ aeskeygen(PDISASM pMyDisasm)
{
/* ========== 0x66 */
if (GV.OperandSize == 16) {
GV.OperandSize = GV.OriginalOperandSize;
(*pMyDisasm).Prefix.OperandSize = MandatoryPrefix;
GV.MemDecoration = Arg2dqword;
(*pMyDisasm).Instruction.Category = AES_INSTRUCTION;
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "aeskeygenassist ");
#endif
GV.ImmediatSize = 8;
GV.SSE_ = 1;
GxEx(pMyDisasm);
GV.SSE_ = 0;
GV.EIP_++;
if (!Security(0, pMyDisasm)) return;
GV.third_arg = 1;
(*pMyDisasm).Instruction.Immediat = *((UInt8*)(UIntPtr) (GV.EIP_- 1));
#ifndef BEA_LIGHT_DISASSEMBLY
(void) CopyFormattedNumber(pMyDisasm, (char*) (*pMyDisasm).Argument3.ArgMnemonic, "%.2X",(Int64) *((UInt8*)(UIntPtr) (GV.EIP_- 1)));
#endif
(*pMyDisasm).Argument3.ArgType = CONSTANT_TYPE+ABSOLUTE_;
(*pMyDisasm).Argument3.ArgSize = 8;
}
else {
FailDecode(pMyDisasm);
}
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,74 @@
/* Copyright 2006-2009, BeatriX
* File coded by BeatriX
*
* This file is part of BeaEngine.
*
* BeaEngine is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* BeaEngine is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with BeaEngine. If not, see <http://www.gnu.org/licenses/>. */
/* ====================================================================
* 0x 0f 3a 44
* ==================================================================== */
void __bea_callspec__ pclmulqdq_(PDISASM pMyDisasm)
{
/* ========== 0x66 */
if (GV.OperandSize == 16) {
(*pMyDisasm).Prefix.OperandSize = MandatoryPrefix;
GV.MemDecoration = Arg2dqword;
(*pMyDisasm).Instruction.Category = CLMUL_INSTRUCTION;
GV.ImmediatSize = 8;
GV.SSE_ = 1;
GxEx(pMyDisasm);
GV.SSE_ = 0;
GV.EIP_++;
if (!Security(0, pMyDisasm)) return;
(*pMyDisasm).Instruction.Immediat = *((UInt8*)(UIntPtr) (GV.EIP_- 1));
if ((*pMyDisasm).Instruction.Immediat == 0) {
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "pclmullqlqdq ");
#endif
}
else if ((*pMyDisasm).Instruction.Immediat == 0x01 ) {
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "pclmulhqlqdq ");
#endif
}
else if ((*pMyDisasm).Instruction.Immediat == 0x10 ) {
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "pclmullqhqdq ");
#endif
}
else if ((*pMyDisasm).Instruction.Immediat == 0x011 ) {
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "pclmulhqhqdq ");
#endif
}
else {
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "pclmulqdq ");
#endif
GV.third_arg = 1;
#ifndef BEA_LIGHT_DISASSEMBLY
(void) CopyFormattedNumber(pMyDisasm, (char*) (*pMyDisasm).Argument3.ArgMnemonic, "%.2X",(Int64) *((UInt8*)(UIntPtr) (GV.EIP_- 1)));
#endif
(*pMyDisasm).Argument3.ArgType = CONSTANT_TYPE+ABSOLUTE_;
(*pMyDisasm).Argument3.ArgSize = 8;
}
}
else {
FailDecode(pMyDisasm);
}
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,297 @@
/* Copyright 2006-2009, BeatriX
* File coded by BeatriX
*
* This file is part of BeaEngine.
*
* BeaEngine is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* BeaEngine is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with BeaEngine. If not, see <http://www.gnu.org/licenses/>. */
/* ====================================================================
* 80h
* ==================================================================== */
void __bea_callspec__ G1_EbIb(PDISASM pMyDisasm)
{
GV.REGOPCODE = ((*((UInt8*)(UIntPtr) (GV.EIP_+1))) >> 3) & 0x7;
EbIb(pMyDisasm);
if (GV.REGOPCODE == 0) {
if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) {
(*pMyDisasm).Prefix.LockPrefix = InUsePrefix;
}
(*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+ARITHMETIC_INSTRUCTION;
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "add ");
#endif
FillFlags(pMyDisasm, 5);
}
else if (GV.REGOPCODE == 1) {
if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) {
(*pMyDisasm).Prefix.LockPrefix = InUsePrefix;
}
(*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+LOGICAL_INSTRUCTION;
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "or ");
#endif
FillFlags(pMyDisasm, 74);
}
else if (GV.REGOPCODE == 2) {
if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) {
(*pMyDisasm).Prefix.LockPrefix = InUsePrefix;
}
(*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+ARITHMETIC_INSTRUCTION;
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "adc ");
#endif
FillFlags(pMyDisasm, 4);
}
else if (GV.REGOPCODE == 3) {
if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) {
(*pMyDisasm).Prefix.LockPrefix = InUsePrefix;
}
(*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+ARITHMETIC_INSTRUCTION;
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "sbb ");
#endif
FillFlags(pMyDisasm, 93);
}
else if (GV.REGOPCODE == 4) {
if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) {
(*pMyDisasm).Prefix.LockPrefix = InUsePrefix;
}
(*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+LOGICAL_INSTRUCTION;
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "and ");
#endif
FillFlags(pMyDisasm, 6);
}
else if (GV.REGOPCODE == 5) {
if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) {
(*pMyDisasm).Prefix.LockPrefix = InUsePrefix;
}
(*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+ARITHMETIC_INSTRUCTION;
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "sub ");
#endif
FillFlags(pMyDisasm, 103);
}
else if (GV.REGOPCODE == 6) {
if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) {
(*pMyDisasm).Prefix.LockPrefix = InUsePrefix;
}
(*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+LOGICAL_INSTRUCTION;
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "xor ");
#endif
FillFlags(pMyDisasm, 113);
}
else if (GV.REGOPCODE == 7) {
(*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+ARITHMETIC_INSTRUCTION;
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "cmp ");
#endif
FillFlags(pMyDisasm, 20);
(*pMyDisasm).Argument1.AccessMode = READ;
}
}
/* ====================================================================
* 82h
* ==================================================================== */
void __bea_callspec__ G1_EbIb2(PDISASM pMyDisasm)
{
if (GV.Architecture == 64) {
FailDecode(pMyDisasm);
}
else {
G1_EbIb(pMyDisasm);
}
}
/* ====================================================================
* 81h
* ==================================================================== */
void __bea_callspec__ G1_EvIv(PDISASM pMyDisasm)
{
GV.REGOPCODE = ((*((UInt8*)(UIntPtr) (GV.EIP_+1))) >> 3) & 0x7;
EvIv(pMyDisasm);
if (GV.REGOPCODE == 0) {
if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) {
(*pMyDisasm).Prefix.LockPrefix = InUsePrefix;
}
(*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+ARITHMETIC_INSTRUCTION;
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "add ");
#endif
FillFlags(pMyDisasm, 5);
}
else if (GV.REGOPCODE == 1) {
if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) {
(*pMyDisasm).Prefix.LockPrefix = InUsePrefix;
}
(*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+LOGICAL_INSTRUCTION;
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "or ");
#endif
FillFlags(pMyDisasm, 74);
}
else if (GV.REGOPCODE == 2) {
if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) {
(*pMyDisasm).Prefix.LockPrefix = InUsePrefix;
}
(*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+ARITHMETIC_INSTRUCTION;
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "adc ");
#endif
FillFlags(pMyDisasm, 4);
}
else if (GV.REGOPCODE == 3) {
if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) {
(*pMyDisasm).Prefix.LockPrefix = InUsePrefix;
}
(*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+ARITHMETIC_INSTRUCTION;
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "sbb ");
#endif
FillFlags(pMyDisasm, 93);
}
else if (GV.REGOPCODE == 4) {
if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) {
(*pMyDisasm).Prefix.LockPrefix = InUsePrefix;
}
(*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+LOGICAL_INSTRUCTION;
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "and ");
#endif
FillFlags(pMyDisasm, 6);
}
else if (GV.REGOPCODE == 5) {
if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) {
(*pMyDisasm).Prefix.LockPrefix = InUsePrefix;
}
(*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+ARITHMETIC_INSTRUCTION;
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "sub ");
#endif
FillFlags(pMyDisasm, 103);
}
else if (GV.REGOPCODE == 6) {
if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) {
(*pMyDisasm).Prefix.LockPrefix = InUsePrefix;
}
(*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+LOGICAL_INSTRUCTION;
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "xor ");
#endif
FillFlags(pMyDisasm, 113);
}
else if (GV.REGOPCODE == 7) {
(*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+ARITHMETIC_INSTRUCTION;
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "cmp ");
#endif
FillFlags(pMyDisasm, 20);
(*pMyDisasm).Argument1.AccessMode = READ;
}
}
/* ====================================================================
* 83h
* ==================================================================== */
void __bea_callspec__ G1_EvIb(PDISASM pMyDisasm)
{
GV.REGOPCODE = ((*((UInt8*)(UIntPtr) (GV.EIP_+1))) >> 3) & 0x7;
EvIb(pMyDisasm);
if (GV.REGOPCODE == 0) {
if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) {
(*pMyDisasm).Prefix.LockPrefix = InUsePrefix;
}
(*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+ARITHMETIC_INSTRUCTION;
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "add ");
#endif
FillFlags(pMyDisasm, 5);
}
else if (GV.REGOPCODE == 1) {
if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) {
(*pMyDisasm).Prefix.LockPrefix = InUsePrefix;
}
(*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+LOGICAL_INSTRUCTION;
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "or ");
#endif
FillFlags(pMyDisasm, 74);
}
else if (GV.REGOPCODE == 2) {
if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) {
(*pMyDisasm).Prefix.LockPrefix = InUsePrefix;
}
(*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+ARITHMETIC_INSTRUCTION;
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "adc ");
#endif
FillFlags(pMyDisasm, 4);
}
else if (GV.REGOPCODE == 3) {
if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) {
(*pMyDisasm).Prefix.LockPrefix = InUsePrefix;
}
(*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+ARITHMETIC_INSTRUCTION;
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "sbb ");
#endif
FillFlags(pMyDisasm, 93);
}
else if (GV.REGOPCODE == 4) {
if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) {
(*pMyDisasm).Prefix.LockPrefix = InUsePrefix;
}
(*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+LOGICAL_INSTRUCTION;
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "and ");
#endif
FillFlags(pMyDisasm, 6);
}
else if (GV.REGOPCODE == 5) {
if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) {
(*pMyDisasm).Prefix.LockPrefix = InUsePrefix;
}
(*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+ARITHMETIC_INSTRUCTION;
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "sub ");
#endif
FillFlags(pMyDisasm, 103);
}
else if (GV.REGOPCODE == 6) {
if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) {
(*pMyDisasm).Prefix.LockPrefix = InUsePrefix;
}
(*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+LOGICAL_INSTRUCTION;
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "xor ");
#endif
FillFlags(pMyDisasm, 113);
}
else if (GV.REGOPCODE == 7) {
(*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+ARITHMETIC_INSTRUCTION;
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "cmp ");
#endif
FillFlags(pMyDisasm, 20);
(*pMyDisasm).Argument1.AccessMode = READ;
}
}

View File

@ -0,0 +1,195 @@
/* Copyright 2006-2009, BeatriX
* File coded by BeatriX
*
* This file is part of BeaEngine.
*
* BeaEngine is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* BeaEngine is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with BeaEngine. If not, see <http://www.gnu.org/licenses/>. */
/* ====================================================================
*
* ==================================================================== */
void __bea_callspec__ G12_(PDISASM pMyDisasm)
{
long MyNumber;
GV.REGOPCODE = ((*((UInt8*)(UIntPtr) (GV.EIP_+1))) >> 3) & 0x7;
if (GV.REGOPCODE == 2) {
if (GV.OperandSize == 16) {
(*pMyDisasm).Instruction.Category = SSE_INSTRUCTION+SHIFT_ROTATE;
GV.MemDecoration = Arg1dqword;
GV.ImmediatSize = 8;
GV.SSE_ = 1;
MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm);
GV.SSE_ = 0;
if (GV.MOD_== 0x3) {
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "psrlw ");
#endif
}
else {
FailDecode(pMyDisasm);
}
GV.EIP_ += GV.DECALAGE_EIP+3;
if (!Security(0, pMyDisasm)) return;
MyNumber = *((UInt8*)(UIntPtr) (GV.EIP_-1));
#ifndef BEA_LIGHT_DISASSEMBLY
(void) CopyFormattedNumber(pMyDisasm, (char*) &(*pMyDisasm).Argument2.ArgMnemonic,"%.2X",(Int64) MyNumber);
#endif
(*pMyDisasm).Instruction.Immediat = MyNumber;
(*pMyDisasm).Argument2.ArgType = CONSTANT_TYPE+ABSOLUTE_;
(*pMyDisasm).Argument2.ArgSize = 8;
}
else {
(*pMyDisasm).Instruction.Category = MMX_INSTRUCTION+SHIFT_ROTATE;
GV.MemDecoration = Arg1qword;
GV.ImmediatSize = 8;
GV.MMX_ = 1;
MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm);
GV.MMX_ = 0;
if (GV.MOD_== 0x3) {
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "psrlw ");
#endif
}
else {
FailDecode(pMyDisasm);
}
GV.EIP_ += GV.DECALAGE_EIP+3;
if (!Security(0, pMyDisasm)) return;
MyNumber = *((UInt8*)(UIntPtr) (GV.EIP_-1));
#ifndef BEA_LIGHT_DISASSEMBLY
(void) CopyFormattedNumber(pMyDisasm, (char*) &(*pMyDisasm).Argument2.ArgMnemonic,"%.2X",(Int64) MyNumber);
#endif
(*pMyDisasm).Instruction.Immediat = MyNumber;
(*pMyDisasm).Argument2.ArgType = CONSTANT_TYPE+ABSOLUTE_;
(*pMyDisasm).Argument2.ArgSize = 8;
}
}
else if (GV.REGOPCODE == 4) {
if (GV.OperandSize == 16) {
(*pMyDisasm).Instruction.Category = SSE_INSTRUCTION+SHIFT_ROTATE;
GV.MemDecoration = Arg1dqword;
GV.ImmediatSize = 8;
GV.SSE_ = 1;
MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm);
GV.SSE_ = 0;
if (GV.MOD_== 0x3) {
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "psraw ");
#endif
}
else {
FailDecode(pMyDisasm);
}
GV.EIP_ += GV.DECALAGE_EIP+3;
if (!Security(0, pMyDisasm)) return;
MyNumber = *((UInt8*)(UIntPtr) (GV.EIP_-1));
#ifndef BEA_LIGHT_DISASSEMBLY
(void) CopyFormattedNumber(pMyDisasm, (char*) &(*pMyDisasm).Argument2.ArgMnemonic,"%.2X",(Int64) MyNumber);
#endif
(*pMyDisasm).Instruction.Immediat = MyNumber;
(*pMyDisasm).Argument2.ArgType = CONSTANT_TYPE+ABSOLUTE_;
(*pMyDisasm).Argument2.ArgSize = 8;
}
else {
(*pMyDisasm).Instruction.Category = MMX_INSTRUCTION+SHIFT_ROTATE;
GV.MemDecoration = Arg1qword;
GV.ImmediatSize = 8;
GV.MMX_ = 1;
MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm);
GV.MMX_ = 0;
if (GV.MOD_== 0x3) {
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "psraw ");
#endif
}
else {
FailDecode(pMyDisasm);
}
GV.EIP_ += GV.DECALAGE_EIP+3;
if (!Security(0, pMyDisasm)) return;
MyNumber = *((UInt8*)(UIntPtr) (GV.EIP_-1));
#ifndef BEA_LIGHT_DISASSEMBLY
(void) CopyFormattedNumber(pMyDisasm, (char*) &(*pMyDisasm).Argument2.ArgMnemonic,"%.2X",(Int64) MyNumber);
#endif
(*pMyDisasm).Instruction.Immediat = MyNumber;
(*pMyDisasm).Argument2.ArgType = CONSTANT_TYPE+ABSOLUTE_;
(*pMyDisasm).Argument2.ArgSize = 8;
}
}
else if (GV.REGOPCODE == 6) {
if (GV.OperandSize == 16) {
(*pMyDisasm).Instruction.Category = SSE_INSTRUCTION+SHIFT_ROTATE;
GV.MemDecoration = Arg1dqword;
GV.ImmediatSize = 8;
GV.SSE_ = 1;
MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm);
GV.SSE_ = 0;
if (GV.MOD_== 0x3) {
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "psllw ");
#endif
}
else {
FailDecode(pMyDisasm);
}
GV.EIP_ += GV.DECALAGE_EIP+3;
if (!Security(0, pMyDisasm)) return;
MyNumber = *((UInt8*)(UIntPtr) (GV.EIP_-1));
#ifndef BEA_LIGHT_DISASSEMBLY
(void) CopyFormattedNumber(pMyDisasm, (char*) &(*pMyDisasm).Argument2.ArgMnemonic,"%.2X",(Int64) MyNumber);
#endif
(*pMyDisasm).Instruction.Immediat = MyNumber;
(*pMyDisasm).Argument2.ArgType = CONSTANT_TYPE+ABSOLUTE_;
(*pMyDisasm).Argument2.ArgSize = 8;
}
else {
(*pMyDisasm).Instruction.Category = MMX_INSTRUCTION+SHIFT_ROTATE;
GV.MemDecoration = Arg1qword;
GV.ImmediatSize = 8;
GV.MMX_ = 1;
MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm);
GV.MMX_ = 0;
if (GV.MOD_== 0x3) {
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "psllw ");
#endif
}
else {
FailDecode(pMyDisasm);
}
GV.EIP_ += GV.DECALAGE_EIP+3;
if (!Security(0, pMyDisasm)) return;
MyNumber = *((UInt8*)(UIntPtr) (GV.EIP_-1));
#ifndef BEA_LIGHT_DISASSEMBLY
(void) CopyFormattedNumber(pMyDisasm, (char*) &(*pMyDisasm).Argument2.ArgMnemonic,"%.2X",(Int64) MyNumber);
#endif
(*pMyDisasm).Instruction.Immediat = MyNumber;
(*pMyDisasm).Argument2.ArgType = CONSTANT_TYPE+ABSOLUTE_;
(*pMyDisasm).Argument2.ArgSize = 8;
}
}
else {
FailDecode(pMyDisasm);
}
}

View File

@ -0,0 +1,194 @@
/* Copyright 2006-2009, BeatriX
* File coded by BeatriX
*
* This file is part of BeaEngine.
*
* BeaEngine is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* BeaEngine is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with BeaEngine. If not, see <http://www.gnu.org/licenses/>. */
/* ====================================================================
*
* ==================================================================== */
void __bea_callspec__ G13_(PDISASM pMyDisasm)
{
long MyNumber;
GV.REGOPCODE = ((*((UInt8*)(UIntPtr) (GV.EIP_+1))) >> 3) & 0x7;
if (GV.REGOPCODE == 2) {
if (GV.OperandSize == 16) {
(*pMyDisasm).Instruction.Category = SSE_INSTRUCTION+SHIFT_ROTATE;
GV.MemDecoration = Arg1dqword;
GV.ImmediatSize = 8;
GV.SSE_ = 1;
MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm);
GV.SSE_ = 0;
if (GV.MOD_== 0x3) {
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "psrld ");
#endif
}
else {
FailDecode(pMyDisasm);
}
GV.EIP_ += GV.DECALAGE_EIP+3;
if (!Security(0, pMyDisasm)) return;
MyNumber = *((UInt8*)(UIntPtr) (GV.EIP_-1));
#ifndef BEA_LIGHT_DISASSEMBLY
(void) CopyFormattedNumber(pMyDisasm, (char*) &(*pMyDisasm).Argument2.ArgMnemonic,"%.2X",(Int64) MyNumber);
#endif
(*pMyDisasm).Instruction.Immediat = MyNumber;
(*pMyDisasm).Argument2.ArgType = CONSTANT_TYPE+ABSOLUTE_;
(*pMyDisasm).Argument2.ArgSize = 8;
}
else {
(*pMyDisasm).Instruction.Category = MMX_INSTRUCTION+SHIFT_ROTATE;
GV.MemDecoration = Arg1qword;
GV.ImmediatSize = 8;
GV.MMX_ = 1;
MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm);
GV.MMX_ = 0;
if (GV.MOD_== 0x3) {
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "psrld ");
#endif
}
else {
FailDecode(pMyDisasm);
}
GV.EIP_ += GV.DECALAGE_EIP+3;
if (!Security(0, pMyDisasm)) return;
MyNumber = *((UInt8*)(UIntPtr) (GV.EIP_-1));
#ifndef BEA_LIGHT_DISASSEMBLY
(void) CopyFormattedNumber(pMyDisasm, (char*) &(*pMyDisasm).Argument2.ArgMnemonic,"%.2X",(Int64) MyNumber);
#endif
(*pMyDisasm).Instruction.Immediat = MyNumber;
(*pMyDisasm).Argument2.ArgType = CONSTANT_TYPE+ABSOLUTE_;
(*pMyDisasm).Argument2.ArgSize = 8;
}
}
else if (GV.REGOPCODE == 4) {
if (GV.OperandSize == 16) {
(*pMyDisasm).Instruction.Category = SSE_INSTRUCTION+SHIFT_ROTATE;
GV.MemDecoration = Arg1dqword;
GV.ImmediatSize = 8;
GV.SSE_ = 1;
MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm);
GV.SSE_ = 0;
if (GV.MOD_== 0x3) {
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "psrad ");
#endif
}
else {
FailDecode(pMyDisasm);
}
GV.EIP_ += GV.DECALAGE_EIP+3;
if (!Security(0, pMyDisasm)) return;
MyNumber = *((UInt8*)(UIntPtr) (GV.EIP_-1));
#ifndef BEA_LIGHT_DISASSEMBLY
(void) CopyFormattedNumber(pMyDisasm, (char*) &(*pMyDisasm).Argument2.ArgMnemonic,"%.2X",(Int64) MyNumber);
#endif
(*pMyDisasm).Instruction.Immediat = MyNumber;
(*pMyDisasm).Argument2.ArgType = CONSTANT_TYPE+ABSOLUTE_;
(*pMyDisasm).Argument2.ArgSize = 8;
}
else {
(*pMyDisasm).Instruction.Category = MMX_INSTRUCTION+SHIFT_ROTATE;
GV.MemDecoration = Arg1qword;
GV.ImmediatSize = 8;
GV.MMX_ = 1;
MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm);
GV.MMX_ = 0;
if (GV.MOD_== 0x3) {
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "psrad ");
#endif
}
else {
FailDecode(pMyDisasm);
}
GV.EIP_ += GV.DECALAGE_EIP+3;
if (!Security(0, pMyDisasm)) return;
MyNumber = *((UInt8*)(UIntPtr) (GV.EIP_-1));
#ifndef BEA_LIGHT_DISASSEMBLY
(void) CopyFormattedNumber(pMyDisasm, (char*) &(*pMyDisasm).Argument2.ArgMnemonic,"%.2X",(Int64) MyNumber);
#endif
(*pMyDisasm).Instruction.Immediat = MyNumber;
(*pMyDisasm).Argument2.ArgType = CONSTANT_TYPE+ABSOLUTE_;
(*pMyDisasm).Argument2.ArgSize = 8;
}
}
else if (GV.REGOPCODE == 6) {
if (GV.OperandSize == 16) {
(*pMyDisasm).Instruction.Category = SSE_INSTRUCTION+SHIFT_ROTATE;
GV.MemDecoration = Arg1dqword;
GV.ImmediatSize = 8;
GV.SSE_ = 1;
MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm);
GV.SSE_ = 0;
if (GV.MOD_== 0x3) {
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "pslld ");
#endif
}
else {
FailDecode(pMyDisasm);
}
GV.EIP_ += GV.DECALAGE_EIP+3;
if (!Security(0, pMyDisasm)) return;
MyNumber = *((UInt8*)(UIntPtr) (GV.EIP_-1));
#ifndef BEA_LIGHT_DISASSEMBLY
(void) CopyFormattedNumber(pMyDisasm, (char*) &(*pMyDisasm).Argument2.ArgMnemonic,"%.2X",(Int64) MyNumber);
#endif
(*pMyDisasm).Instruction.Immediat = MyNumber;
(*pMyDisasm).Argument2.ArgType = CONSTANT_TYPE+ABSOLUTE_;
(*pMyDisasm).Argument2.ArgSize = 8;
}
else {
(*pMyDisasm).Instruction.Category = MMX_INSTRUCTION+SHIFT_ROTATE;
GV.MemDecoration = Arg1qword;
GV.ImmediatSize = 8;
GV.MMX_ = 1;
MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm);
GV.MMX_ = 0;
if (GV.MOD_== 0x3) {
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "pslld ");
#endif
}
else {
FailDecode(pMyDisasm);
}
GV.EIP_ += GV.DECALAGE_EIP+3;
if (!Security(0, pMyDisasm)) return;
MyNumber = *((UInt8*)(UIntPtr) (GV.EIP_-1));
#ifndef BEA_LIGHT_DISASSEMBLY
(void) CopyFormattedNumber(pMyDisasm, (char*) &(*pMyDisasm).Argument2.ArgMnemonic,"%.2X",(Int64) MyNumber);
#endif
(*pMyDisasm).Instruction.Immediat = MyNumber;
(*pMyDisasm).Argument2.ArgType = CONSTANT_TYPE+ABSOLUTE_;
(*pMyDisasm).Argument2.ArgSize = 8;
}
}
else {
FailDecode(pMyDisasm);
}
}

View File

@ -0,0 +1,203 @@
/* Copyright 2006-2009, BeatriX
* File coded by BeatriX
*
* This file is part of BeaEngine.
*
* BeaEngine is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* BeaEngine is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with BeaEngine. If not, see <http://www.gnu.org/licenses/>. */
/* ====================================================================
*
* ==================================================================== */
void __bea_callspec__ G14_(PDISASM pMyDisasm)
{
long MyNumber;
GV.REGOPCODE = ((*((UInt8*)(UIntPtr) (GV.EIP_+1))) >> 3) & 0x7;
if (GV.REGOPCODE == 2) {
if (GV.OperandSize == 16) {
(*pMyDisasm).Instruction.Category = SSE_INSTRUCTION+SHIFT_ROTATE;
GV.MemDecoration = Arg1dqword;
GV.ImmediatSize = 8;
GV.SSE_ = 1;
MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm);
GV.SSE_ = 0;
if (GV.MOD_== 0x3) {
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "psrlq ");
#endif
}
else {
FailDecode(pMyDisasm);
}
GV.EIP_ += GV.DECALAGE_EIP+3;
if (!Security(0, pMyDisasm)) return;
MyNumber = *((UInt8*)(UIntPtr) (GV.EIP_-1));
#ifndef BEA_LIGHT_DISASSEMBLY
(void) CopyFormattedNumber(pMyDisasm, (char*) &(*pMyDisasm).Argument2.ArgMnemonic,"%.2X",(Int64) MyNumber);
#endif
(*pMyDisasm).Instruction.Immediat = MyNumber;
(*pMyDisasm).Argument2.ArgType = CONSTANT_TYPE+ABSOLUTE_;
(*pMyDisasm).Argument2.ArgSize = 8;
}
else {
(*pMyDisasm).Instruction.Category = MMX_INSTRUCTION+SHIFT_ROTATE;
GV.MemDecoration = Arg1qword;
GV.ImmediatSize = 8;
GV.MMX_ = 1;
MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm);
GV.MMX_ = 0;
if (GV.MOD_== 0x3) {
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "psrlq ");
#endif
}
else {
FailDecode(pMyDisasm);
}
GV.EIP_ += GV.DECALAGE_EIP+3;
if (!Security(0, pMyDisasm)) return;
MyNumber = *((UInt8*)(UIntPtr) (GV.EIP_-1));
#ifndef BEA_LIGHT_DISASSEMBLY
(void) CopyFormattedNumber(pMyDisasm, (char*) &(*pMyDisasm).Argument2.ArgMnemonic,"%.2X",(Int64) MyNumber);
#endif
(*pMyDisasm).Instruction.Immediat = MyNumber;
(*pMyDisasm).Argument2.ArgType = CONSTANT_TYPE+ABSOLUTE_;
(*pMyDisasm).Argument2.ArgSize = 8;
}
}
else if (GV.REGOPCODE == 3) {
if (GV.OperandSize == 16) {
(*pMyDisasm).Instruction.Category = SSE_INSTRUCTION+SHIFT_ROTATE;
GV.MemDecoration = Arg1dqword;
GV.ImmediatSize = 8;
GV.SSE_ = 1;
MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm);
GV.SSE_ = 0;
if (GV.MOD_== 0x3) {
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "psrldq ");
#endif
}
else {
FailDecode(pMyDisasm);
}
GV.EIP_ += GV.DECALAGE_EIP+3;
if (!Security(0, pMyDisasm)) return;
MyNumber = *((UInt8*)(UIntPtr) (GV.EIP_-1));
#ifndef BEA_LIGHT_DISASSEMBLY
(void) CopyFormattedNumber(pMyDisasm, (char*) &(*pMyDisasm).Argument2.ArgMnemonic,"%.2X",(Int64) MyNumber);
#endif
(*pMyDisasm).Instruction.Immediat = MyNumber;
(*pMyDisasm).Argument2.ArgType = CONSTANT_TYPE+ABSOLUTE_;
(*pMyDisasm).Argument2.ArgSize = 8;
}
else {
FailDecode(pMyDisasm);
}
}
else if (GV.REGOPCODE == 6) {
if (GV.OperandSize == 16) {
(*pMyDisasm).Instruction.Category = SSE_INSTRUCTION+SHIFT_ROTATE;
GV.MemDecoration = Arg1dqword;
GV.ImmediatSize = 8;
GV.SSE_ = 1;
MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm);
GV.SSE_ = 0;
if (GV.MOD_== 0x3) {
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "psllq ");
#endif
}
else {
FailDecode(pMyDisasm);
}
GV.EIP_ += GV.DECALAGE_EIP+3;
if (!Security(0, pMyDisasm)) return;
MyNumber = *((UInt8*)(UIntPtr) (GV.EIP_-1));
#ifndef BEA_LIGHT_DISASSEMBLY
(void) CopyFormattedNumber(pMyDisasm, (char*) &(*pMyDisasm).Argument2.ArgMnemonic,"%.2X",(Int64) MyNumber);
#endif
(*pMyDisasm).Instruction.Immediat = MyNumber;
(*pMyDisasm).Argument2.ArgType = CONSTANT_TYPE+ABSOLUTE_;
(*pMyDisasm).Argument2.ArgSize = 8;
}
else {
(*pMyDisasm).Instruction.Category = MMX_INSTRUCTION+SHIFT_ROTATE;
GV.MemDecoration = Arg1qword;
GV.ImmediatSize = 8;
GV.MMX_ = 1;
MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm);
GV.MMX_ = 0;
if (GV.MOD_== 0x3) {
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "psllq ");
#endif
}
else {
FailDecode(pMyDisasm);
}
GV.EIP_ += GV.DECALAGE_EIP+3;
if (!Security(0, pMyDisasm)) return;
MyNumber = *((UInt8*)(UIntPtr) (GV.EIP_-1));
#ifndef BEA_LIGHT_DISASSEMBLY
(void) CopyFormattedNumber(pMyDisasm, (char*) &(*pMyDisasm).Argument2.ArgMnemonic,"%.2X",(Int64) MyNumber);
#endif
(*pMyDisasm).Instruction.Immediat = MyNumber;
(*pMyDisasm).Argument2.ArgType = CONSTANT_TYPE+ABSOLUTE_;
(*pMyDisasm).Argument2.ArgSize = 8;
}
}
else if (GV.REGOPCODE == 7) {
if (GV.OperandSize == 16) {
(*pMyDisasm).Instruction.Category = SSE_INSTRUCTION+SHIFT_ROTATE;
GV.MemDecoration = Arg1dqword;
GV.ImmediatSize = 8;
GV.SSE_ = 1;
MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm);
GV.SSE_ = 0;
if (GV.MOD_== 0x3) {
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "pslldq ");
#endif
}
else {
FailDecode(pMyDisasm);
}
GV.EIP_ += GV.DECALAGE_EIP+3;
if (!Security(0, pMyDisasm)) return;
MyNumber = *((UInt8*)(UIntPtr) (GV.EIP_-1));
#ifndef BEA_LIGHT_DISASSEMBLY
(void) CopyFormattedNumber(pMyDisasm, (char*) &(*pMyDisasm).Argument2.ArgMnemonic,"%.2X",(Int64) MyNumber);
#endif
(*pMyDisasm).Instruction.Immediat = MyNumber;
(*pMyDisasm).Argument2.ArgType = CONSTANT_TYPE+ABSOLUTE_;
(*pMyDisasm).Argument2.ArgSize = 8;
}
else {
FailDecode(pMyDisasm);
}
}
else {
FailDecode(pMyDisasm);
}
}

View File

@ -0,0 +1,166 @@
/* Copyright 2006-2009, BeatriX
* File coded by BeatriX
*
* This file is part of BeaEngine.
*
* BeaEngine is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* BeaEngine is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with BeaEngine. If not, see <http://www.gnu.org/licenses/>. */
/* ====================================================================
*
* ==================================================================== */
void __bea_callspec__ G15_(PDISASM pMyDisasm)
{
GV.REGOPCODE = ((*((UInt8*)(UIntPtr) (GV.EIP_+1))) >> 3) & 0x7;
if (GV.REGOPCODE == 0) {
MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm);
if (GV.MOD_!= 0x3) {
GV.MemDecoration = Arg1multibytes;
(*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+STATE_MANAGEMENT;
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fxsave ");
#endif
(*pMyDisasm).Argument1.ArgSize = 512;
(*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+FPU_REG+MMX_REG+SSE_REG;
(*pMyDisasm).Argument2.ArgSize = 512;
}
else {
FailDecode(pMyDisasm);
}
}
else if (GV.REGOPCODE == 1) {
MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm);
if (GV.MOD_!= 0x3) {
GV.MemDecoration = Arg2multibytes;
(*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+STATE_MANAGEMENT;
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fxrstor ");
#endif
(*pMyDisasm).Argument2.ArgSize = 512;
(*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+MMX_REG+SSE_REG;
(*pMyDisasm).Argument1.ArgSize = 512;
}
else {
FailDecode(pMyDisasm);
}
}
else if (GV.REGOPCODE == 2) {
MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm);
if (GV.MOD_!= 0x3) {
GV.MemDecoration = Arg2dword;
(*pMyDisasm).Instruction.Category = SSE_INSTRUCTION+STATE_MANAGEMENT;
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "ldmxcsr ");
#endif
(*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+SPECIAL_REG+REG1;
(*pMyDisasm).Argument1.ArgSize = 32;
}
else {
FailDecode(pMyDisasm);
}
}
else if (GV.REGOPCODE == 3) {
MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm);
if (GV.MOD_!= 0x3) {
GV.MemDecoration = Arg1dword;
(*pMyDisasm).Instruction.Category = SSE_INSTRUCTION+STATE_MANAGEMENT;
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "stmxcsr ");
#endif
(*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+SPECIAL_REG+REG1;
(*pMyDisasm).Argument2.ArgSize = 32;
}
else {
FailDecode(pMyDisasm);
}
}
else if (GV.REGOPCODE == 4) {
MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm);
if (GV.MOD_!= 0x3) {
GV.MemDecoration = Arg1multibytes;
(*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+STATE_MANAGEMENT;
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "xsave ");
#endif
(*pMyDisasm).Argument1.ArgSize = 512;
(*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+FPU_REG+MMX_REG+SSE_REG;
(*pMyDisasm).Argument2.ArgSize = 512;
}
else {
FailDecode(pMyDisasm);
}
}
else if (GV.REGOPCODE == 5) {
GV.MOD_= ((*((UInt8*)(UIntPtr) (GV.EIP_+1))) >> 6) & 0x3;
if (GV.MOD_== 0x3) {
(*pMyDisasm).Instruction.Category = SSE2_INSTRUCTION+CACHEABILITY_CONTROL;
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "lfence ");
#endif
}
else {
MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm);
GV.MemDecoration = Arg2multibytes;
(*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+STATE_MANAGEMENT;
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "xrstor ");
#endif
(*pMyDisasm).Argument2.ArgSize = 512;
(*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+MMX_REG+SSE_REG;
(*pMyDisasm).Argument1.ArgSize = 512;
}
}
else if (GV.REGOPCODE == 6) {
GV.MOD_= ((*((UInt8*)(UIntPtr) (GV.EIP_+1))) >> 6) & 0x3;
if (GV.MOD_== 0x3) {
(*pMyDisasm).Instruction.Category = SSE2_INSTRUCTION+CACHEABILITY_CONTROL;
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "mfence ");
#endif
}
else {
FailDecode(pMyDisasm);
}
}
else if (GV.REGOPCODE == 7) {
GV.MOD_= ((*((UInt8*)(UIntPtr) (GV.EIP_+1))) >> 6) & 0x3;
if (GV.MOD_== 0x3) {
(*pMyDisasm).Instruction.Category = SSE2_INSTRUCTION+CACHEABILITY_CONTROL;
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "sfence ");
#endif
}
else {
GV.OperandSize = 8;
MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm);
GV.OperandSize = 32;
GV.MemDecoration = Arg2byte;
(*pMyDisasm).Instruction.Category = SSE2_INSTRUCTION+CACHEABILITY_CONTROL;
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "clflush ");
#endif
}
}
else {
FailDecode(pMyDisasm);
}
GV.EIP_+= GV.DECALAGE_EIP+2;
}

View File

@ -0,0 +1,85 @@
/* Copyright 2006-2009, BeatriX
* File coded by BeatriX
*
* This file is part of BeaEngine.
*
* BeaEngine is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* BeaEngine is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with BeaEngine. If not, see <http://www.gnu.org/licenses/>. */
/* ====================================================================
*
* ==================================================================== */
void __bea_callspec__ G16_(PDISASM pMyDisasm)
{
GV.REGOPCODE = ((*((UInt8*)(UIntPtr) (GV.EIP_+1))) >> 3) & 0x7;
if (GV.REGOPCODE == 0) {
MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm);
if (GV.MOD_!= 0x3) {
GV.MemDecoration = Arg2byte;
(*pMyDisasm).Instruction.Category = SSE_INSTRUCTION+CACHEABILITY_CONTROL;
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "prefetchNTA ");
#endif
}
else {
FailDecode(pMyDisasm);
}
}
else if (GV.REGOPCODE == 1) {
MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm);
if (GV.MOD_!= 0x3) {
GV.MemDecoration = Arg2byte;
(*pMyDisasm).Instruction.Category = SSE_INSTRUCTION+CACHEABILITY_CONTROL;
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "prefetchT0 ");
#endif
}
else {
FailDecode(pMyDisasm);
}
}
else if (GV.REGOPCODE == 2) {
MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm);
if (GV.MOD_!= 0x3) {
GV.MemDecoration = Arg2byte;
(*pMyDisasm).Instruction.Category = SSE_INSTRUCTION+CACHEABILITY_CONTROL;
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "prefetchT1 ");
#endif
}
else {
FailDecode(pMyDisasm);
}
}
else if (GV.REGOPCODE == 3) {
MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm);
if (GV.MOD_!= 0x3) {
GV.MemDecoration = Arg2byte;
(*pMyDisasm).Instruction.Category = SSE_INSTRUCTION+CACHEABILITY_CONTROL;
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "prefetchT2 ");
#endif
}
else {
FailDecode(pMyDisasm);
}
}
else {
FailDecode(pMyDisasm);
}
GV.EIP_+= GV.DECALAGE_EIP+2;
}

View File

@ -0,0 +1,461 @@
/* Copyright 2006-2009, BeatriX
* File coded by BeatriX
*
* This file is part of BeaEngine.
*
* BeaEngine is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* BeaEngine is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with BeaEngine. If not, see <http://www.gnu.org/licenses/>. */
/* ====================================================================
* 0c0h
* ==================================================================== */
void __bea_callspec__ G2_EbIb(PDISASM pMyDisasm)
{
GV.REGOPCODE = ((*((UInt8*)(UIntPtr) (GV.EIP_+1))) >> 3) & 0x7;
EbIb(pMyDisasm);
if (GV.REGOPCODE == 0) {
(*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+SHIFT_ROTATE;
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "rol ");
#endif
FillFlags(pMyDisasm, 88);
}
else if (GV.REGOPCODE == 1) {
(*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+SHIFT_ROTATE;
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "ror ");
#endif
FillFlags(pMyDisasm, 88);
}
else if (GV.REGOPCODE == 2) {
(*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+SHIFT_ROTATE;
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "rcl ");
#endif
FillFlags(pMyDisasm, 81);
}
else if (GV.REGOPCODE == 3) {
(*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+SHIFT_ROTATE;
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "rcr ");
#endif
FillFlags(pMyDisasm, 81);
}
else if (GV.REGOPCODE == 4) {
(*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+SHIFT_ROTATE;
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "shl ");
#endif
FillFlags(pMyDisasm, 92);
}
else if (GV.REGOPCODE == 5) {
(*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+SHIFT_ROTATE;
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "shr ");
#endif
FillFlags(pMyDisasm, 92);
}
else if (GV.REGOPCODE == 6) {
(*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+SHIFT_ROTATE;
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "sal ");
#endif
FillFlags(pMyDisasm, 92);
}
else if (GV.REGOPCODE == 7) {
(*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+SHIFT_ROTATE;
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "sar ");
#endif
FillFlags(pMyDisasm, 92);
}
}
/* ====================================================================
* 0c1h
* ==================================================================== */
void __bea_callspec__ G2_EvIb(PDISASM pMyDisasm)
{
GV.REGOPCODE = ((*((UInt8*)(UIntPtr) (GV.EIP_+1))) >> 3) & 0x7;
EvIb(pMyDisasm);
if (GV.REGOPCODE == 0) {
(*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+SHIFT_ROTATE;
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "rol ");
#endif
FillFlags(pMyDisasm, 88);
}
else if (GV.REGOPCODE == 1) {
(*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+SHIFT_ROTATE;
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "ror ");
#endif
FillFlags(pMyDisasm, 88);
}
else if (GV.REGOPCODE == 2) {
(*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+SHIFT_ROTATE;
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "rcl ");
#endif
FillFlags(pMyDisasm, 81);
}
else if (GV.REGOPCODE == 3) {
(*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+SHIFT_ROTATE;
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "rcr ");
#endif
FillFlags(pMyDisasm, 81);
}
else if (GV.REGOPCODE == 4) {
(*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+SHIFT_ROTATE;
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "shl ");
#endif
FillFlags(pMyDisasm, 92);
}
else if (GV.REGOPCODE == 5) {
(*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+SHIFT_ROTATE;
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "shr ");
#endif
FillFlags(pMyDisasm, 92);
}
else if (GV.REGOPCODE == 6) {
(*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+SHIFT_ROTATE;
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "sal ");
#endif
FillFlags(pMyDisasm, 92);
}
else if (GV.REGOPCODE == 7) {
(*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+SHIFT_ROTATE;
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "sar ");
#endif
FillFlags(pMyDisasm, 92);
}
}
/* ====================================================================
* 0d0h
* ==================================================================== */
void __bea_callspec__ G2_Eb1(PDISASM pMyDisasm)
{
GV.REGOPCODE = ((*((UInt8*)(UIntPtr) (GV.EIP_+1))) >> 3) & 0x7;
GV.MemDecoration = Arg1byte;
GV.OperandSize = 8;
MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm);
GV.OperandSize = 32;
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, "1 ");
#endif
(*pMyDisasm).Argument2.ArgType = CONSTANT_TYPE+ABSOLUTE_;
(*pMyDisasm).Argument2.ArgSize = 8;
(*pMyDisasm).Instruction.Immediat = 1;
if (GV.REGOPCODE == 0) {
(*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+SHIFT_ROTATE;
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "rol ");
#endif
FillFlags(pMyDisasm, 87);
}
else if (GV.REGOPCODE == 1) {
(*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+SHIFT_ROTATE;
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "ror ");
#endif
FillFlags(pMyDisasm, 87);
}
else if (GV.REGOPCODE == 2) {
(*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+SHIFT_ROTATE;
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "rcl ");
#endif
FillFlags(pMyDisasm, 80);
}
else if (GV.REGOPCODE == 3) {
(*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+SHIFT_ROTATE;
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "rcr ");
#endif
FillFlags(pMyDisasm, 80);
}
else if (GV.REGOPCODE == 4) {
(*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+SHIFT_ROTATE;
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "shl ");
#endif
FillFlags(pMyDisasm, 91);
}
else if (GV.REGOPCODE == 5) {
(*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+SHIFT_ROTATE;
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "shr ");
#endif
FillFlags(pMyDisasm, 91);
}
else if (GV.REGOPCODE == 6) {
(*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+SHIFT_ROTATE;
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "sal ");
#endif
FillFlags(pMyDisasm, 91);
}
else if (GV.REGOPCODE == 7) {
(*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+SHIFT_ROTATE;
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "sar ");
#endif
FillFlags(pMyDisasm, 91);
}
GV.EIP_ += GV.DECALAGE_EIP+2;
}
/* ====================================================================
* 0d1h
* ==================================================================== */
void __bea_callspec__ G2_Ev1(PDISASM pMyDisasm)
{
GV.REGOPCODE = ((*((UInt8*)(UIntPtr) (GV.EIP_+1))) >> 3) & 0x7;
if (GV.OperandSize == 64) {
GV.MemDecoration = Arg1qword;
}
else if (GV.OperandSize == 32) {
GV.MemDecoration = Arg1dword;
}
else {
GV.MemDecoration = Arg1word;
}
MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm);
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, "1 ");
#endif
(*pMyDisasm).Argument2.ArgType = CONSTANT_TYPE+ABSOLUTE_;
(*pMyDisasm).Argument2.ArgSize = 8;
(*pMyDisasm).Instruction.Immediat = 1;
if (GV.REGOPCODE == 0) {
(*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+SHIFT_ROTATE;
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "rol ");
#endif
FillFlags(pMyDisasm, 87);
}
else if (GV.REGOPCODE == 1) {
(*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+SHIFT_ROTATE;
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "ror ");
#endif
FillFlags(pMyDisasm, 87);
}
else if (GV.REGOPCODE == 2) {
(*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+SHIFT_ROTATE;
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "rcl ");
#endif
FillFlags(pMyDisasm, 80);
}
else if (GV.REGOPCODE == 3) {
(*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+SHIFT_ROTATE;
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "rcr ");
#endif
FillFlags(pMyDisasm, 80);
}
else if (GV.REGOPCODE == 4) {
(*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+SHIFT_ROTATE;
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "shl ");
#endif
FillFlags(pMyDisasm, 91);
}
else if (GV.REGOPCODE == 5) {
(*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+SHIFT_ROTATE;
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "shr ");
#endif
FillFlags(pMyDisasm, 91);
}
else if (GV.REGOPCODE == 6) {
(*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+SHIFT_ROTATE;
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "sal ");
#endif
FillFlags(pMyDisasm, 91);
}
else if (GV.REGOPCODE == 7) {
(*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+SHIFT_ROTATE;
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "sar ");
#endif
FillFlags(pMyDisasm, 91);
}
GV.EIP_ += GV.DECALAGE_EIP+2;
}
/* ====================================================================
* 0d2h
* ==================================================================== */
void __bea_callspec__ G2_EbCL(PDISASM pMyDisasm)
{
GV.REGOPCODE = ((*((UInt8*)(UIntPtr) (GV.EIP_+1))) >> 3) & 0x7;
GV.MemDecoration = Arg1byte;
GV.OperandSize = 8;
MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm);
GV.OperandSize = 32;
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, Registers8Bits[1]);
#endif
(*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+GENERAL_REG+REG1;
(*pMyDisasm).Argument2.ArgSize = 8;
if (GV.REGOPCODE == 0) {
(*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+SHIFT_ROTATE;
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "rol ");
#endif
FillFlags(pMyDisasm, 88);
}
else if (GV.REGOPCODE == 1) {
(*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+SHIFT_ROTATE;
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "ror ");
#endif
FillFlags(pMyDisasm, 88);
}
else if (GV.REGOPCODE == 2) {
(*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+SHIFT_ROTATE;
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "rcl ");
#endif
FillFlags(pMyDisasm, 81);
}
else if (GV.REGOPCODE == 3) {
(*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+SHIFT_ROTATE;
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "rcr ");
#endif
FillFlags(pMyDisasm, 81);
}
else if (GV.REGOPCODE == 4) {
(*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+SHIFT_ROTATE;
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "shl ");
#endif
FillFlags(pMyDisasm, 92);
}
else if (GV.REGOPCODE == 5) {
(*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+SHIFT_ROTATE;
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "shr ");
#endif
FillFlags(pMyDisasm, 92);
}
else if (GV.REGOPCODE == 6) {
(*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+SHIFT_ROTATE;
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "sal ");
#endif
FillFlags(pMyDisasm, 92);
}
else if (GV.REGOPCODE == 7) {
(*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+SHIFT_ROTATE;
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "sar ");
#endif
FillFlags(pMyDisasm, 92);
}
GV.EIP_ += GV.DECALAGE_EIP+2;
}
/* ====================================================================
* 0d3h
* ==================================================================== */
void __bea_callspec__ G2_EvCL(PDISASM pMyDisasm)
{
GV.REGOPCODE = ((*((UInt8*)(UIntPtr) (GV.EIP_+1))) >> 3) & 0x7;
if (GV.OperandSize == 64) {
GV.MemDecoration = Arg1qword;
}
else if (GV.OperandSize == 32) {
GV.MemDecoration = Arg1dword;
}
else {
GV.MemDecoration = Arg1word;
}
MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm);
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, Registers8Bits[1]);
#endif
(*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+GENERAL_REG+REG1;
(*pMyDisasm).Argument2.ArgSize = 8;
if (GV.REGOPCODE == 0) {
(*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+SHIFT_ROTATE;
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "rol ");
#endif
FillFlags(pMyDisasm, 88);
}
else if (GV.REGOPCODE == 1) {
(*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+SHIFT_ROTATE;
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "ror ");
#endif
FillFlags(pMyDisasm, 88);
}
else if (GV.REGOPCODE == 2) {
(*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+SHIFT_ROTATE;
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "rcl ");
#endif
FillFlags(pMyDisasm, 81);
}
else if (GV.REGOPCODE == 3) {
(*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+SHIFT_ROTATE;
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "rcr ");
#endif
FillFlags(pMyDisasm, 81);
}
else if (GV.REGOPCODE == 4) {
(*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+SHIFT_ROTATE;
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "shl ");
#endif
FillFlags(pMyDisasm, 92);
}
else if (GV.REGOPCODE == 5) {
(*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+SHIFT_ROTATE;
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "shr ");
#endif
FillFlags(pMyDisasm, 92);
}
else if (GV.REGOPCODE == 6) {
(*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+SHIFT_ROTATE;
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "sal ");
#endif
FillFlags(pMyDisasm, 92);
}
else if (GV.REGOPCODE == 7) {
(*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+SHIFT_ROTATE;
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "sar ");
#endif
FillFlags(pMyDisasm, 92);
}
GV.EIP_ += GV.DECALAGE_EIP+2;
}

View File

@ -0,0 +1,257 @@
/* Copyright 2006-2009, BeatriX
* File coded by BeatriX
*
* This file is part of BeaEngine.
*
* BeaEngine is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* BeaEngine is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with BeaEngine. If not, see <http://www.gnu.org/licenses/>. */
/* ====================================================================
* 0f6h
* ==================================================================== */
void __bea_callspec__ G3_Eb(PDISASM pMyDisasm)
{
GV.REGOPCODE = ((*((UInt8*)(UIntPtr) (GV.EIP_+1))) >> 3) & 0x7;
if (GV.REGOPCODE == 0) {
(*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+BIT_UInt8;
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "test ");
#endif
EbIb(pMyDisasm);
(*pMyDisasm).Argument1.AccessMode = READ;
FillFlags(pMyDisasm, 104);
}
else if (GV.REGOPCODE == 1) {
(*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+BIT_UInt8;
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "test ");
#endif
EbIb(pMyDisasm);
(*pMyDisasm).Argument1.AccessMode = READ;
FillFlags(pMyDisasm, 104);
}
else if (GV.REGOPCODE == 2) {
if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) {
(*pMyDisasm).Prefix.LockPrefix = InUsePrefix;
}
(*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+LOGICAL_INSTRUCTION;
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "not ");
#endif
Eb(pMyDisasm);
FillFlags(pMyDisasm, 73);
}
else if (GV.REGOPCODE == 3) {
(*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+ARITHMETIC_INSTRUCTION;
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "neg ");
#endif
Eb(pMyDisasm);
FillFlags(pMyDisasm, 71);
}
else if (GV.REGOPCODE == 4) {
(*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+ARITHMETIC_INSTRUCTION;
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "mul ");
#endif
GV.MemDecoration = Arg2byte;
GV.OperandSize = 8;
MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm);
GV.OperandSize = 32;
GV.EIP_ += GV.DECALAGE_EIP+2;
(*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+GENERAL_REG+REG0+REG2;
(*pMyDisasm).Argument1.ArgSize = 8;
(*pMyDisasm).Instruction.ImplicitModifiedRegs = REGISTER_TYPE+GENERAL_REG+REG0;
FillFlags(pMyDisasm, 70);
}
else if (GV.REGOPCODE == 5) {
(*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+ARITHMETIC_INSTRUCTION;
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "imul ");
#endif
GV.MemDecoration = Arg2byte;
GV.OperandSize = 8;
MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm);
GV.OperandSize = 32;
GV.EIP_ += GV.DECALAGE_EIP+2;
(*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+GENERAL_REG+REG0+REG2;
(*pMyDisasm).Argument1.ArgSize = 8;
FillFlags(pMyDisasm, 38);
}
else if (GV.REGOPCODE == 6) {
(*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+ARITHMETIC_INSTRUCTION;
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "div ");
#endif
GV.MemDecoration = Arg2byte;
GV.OperandSize = 8;
MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm);
GV.OperandSize = 32;
GV.EIP_ += GV.DECALAGE_EIP+2;
(*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+GENERAL_REG+REG0+REG2;
(*pMyDisasm).Argument1.ArgSize = 8;
FillFlags(pMyDisasm, 31);
}
else if (GV.REGOPCODE == 7) {
(*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+ARITHMETIC_INSTRUCTION;
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "idiv ");
#endif
GV.MemDecoration = Arg2byte;
GV.OperandSize = 8;
MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm);
GV.OperandSize = 32;
GV.EIP_ += GV.DECALAGE_EIP+2;
(*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+GENERAL_REG+REG0+REG2;
(*pMyDisasm).Argument1.ArgSize = 8;
(*pMyDisasm).Instruction.ImplicitModifiedRegs = REGISTER_TYPE+GENERAL_REG+REG0;
FillFlags(pMyDisasm, 37);
}
}
/* ====================================================================
* 0f7h
* ==================================================================== */
void __bea_callspec__ G3_Ev(PDISASM pMyDisasm)
{
GV.REGOPCODE = ((*((UInt8*)(UIntPtr) (GV.EIP_+1))) >> 3) & 0x7;
if (GV.REGOPCODE == 0) {
(*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+BIT_UInt8;
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "test ");
#endif
EvIv(pMyDisasm);
(*pMyDisasm).Argument1.AccessMode = READ;
FillFlags(pMyDisasm, 104);
}
else if (GV.REGOPCODE == 1) {
(*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+BIT_UInt8;
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "test ");
#endif
EvIv(pMyDisasm);
(*pMyDisasm).Argument1.AccessMode = READ;
FillFlags(pMyDisasm, 104);
}
else if (GV.REGOPCODE == 2) {
if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) {
(*pMyDisasm).Prefix.LockPrefix = InUsePrefix;
}
(*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+LOGICAL_INSTRUCTION;
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "not ");
#endif
Ev(pMyDisasm);
FillFlags(pMyDisasm, 73);
}
else if (GV.REGOPCODE == 3) {
(*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+ARITHMETIC_INSTRUCTION;
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "neg ");
#endif
Ev(pMyDisasm);
FillFlags(pMyDisasm, 71);
}
else if (GV.REGOPCODE == 4) {
(*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+ARITHMETIC_INSTRUCTION;
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "mul ");
#endif
if (GV.OperandSize == 64) {
GV.MemDecoration = Arg2qword;
(*pMyDisasm).Argument1.ArgSize = 64;
}
else if (GV.OperandSize == 32) {
GV.MemDecoration = Arg2dword;
(*pMyDisasm).Argument1.ArgSize = 32;
}
else {
GV.MemDecoration = Arg2word;
(*pMyDisasm).Argument1.ArgSize = 16;
}
MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm);
GV.EIP_ += GV.DECALAGE_EIP+2;
(*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+GENERAL_REG+REG0;
(*pMyDisasm).Instruction.ImplicitModifiedRegs = REGISTER_TYPE+GENERAL_REG+REG0+REG2;
FillFlags(pMyDisasm, 70);
}
else if (GV.REGOPCODE == 5) {
(*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+ARITHMETIC_INSTRUCTION;
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "imul ");
#endif
if (GV.OperandSize == 64) {
GV.MemDecoration = Arg2qword;
(*pMyDisasm).Argument1.ArgSize = 64;
}
else if (GV.OperandSize == 32) {
GV.MemDecoration = Arg2dword;
(*pMyDisasm).Argument1.ArgSize = 32;
}
else {
GV.MemDecoration = Arg2word;
(*pMyDisasm).Argument1.ArgSize = 16;
}
MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm);
GV.EIP_ += GV.DECALAGE_EIP+2;
(*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+GENERAL_REG+REG0;
(*pMyDisasm).Instruction.ImplicitModifiedRegs = REGISTER_TYPE+GENERAL_REG+REG0+REG2;
FillFlags(pMyDisasm, 38);
}
else if (GV.REGOPCODE == 6) {
(*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+ARITHMETIC_INSTRUCTION;
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "div ");
#endif
if (GV.OperandSize == 64) {
GV.MemDecoration = Arg2qword;
(*pMyDisasm).Argument1.ArgSize = 64;
}
else if (GV.OperandSize == 32) {
GV.MemDecoration = Arg2dword;
(*pMyDisasm).Argument1.ArgSize = 32;
}
else {
GV.MemDecoration = Arg2word;
(*pMyDisasm).Argument1.ArgSize = 16;
}
MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm);
GV.EIP_ += GV.DECALAGE_EIP+2;
(*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+GENERAL_REG+REG0+REG2;
(*pMyDisasm).Instruction.ImplicitModifiedRegs = REGISTER_TYPE+GENERAL_REG+REG0+REG2;
FillFlags(pMyDisasm, 31);
}
else if (GV.REGOPCODE == 7) {
(*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+ARITHMETIC_INSTRUCTION;
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "idiv ");
#endif
if (GV.OperandSize == 64) {
GV.MemDecoration = Arg2qword;
(*pMyDisasm).Argument1.ArgSize = 64;
}
else if (GV.OperandSize == 32) {
GV.MemDecoration = Arg2dword;
(*pMyDisasm).Argument1.ArgSize = 32;
}
else {
GV.MemDecoration = Arg2word;
(*pMyDisasm).Argument1.ArgSize = 16;
}
MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm);
GV.EIP_ += GV.DECALAGE_EIP+2;
(*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+GENERAL_REG+REG0+REG2;
(*pMyDisasm).Instruction.ImplicitModifiedRegs = REGISTER_TYPE+GENERAL_REG+REG0+REG2;
FillFlags(pMyDisasm, 37);
}
}

View File

@ -0,0 +1,51 @@
/* Copyright 2006-2009, BeatriX
* File coded by BeatriX
*
* This file is part of BeaEngine.
*
* BeaEngine is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* BeaEngine is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with BeaEngine. If not, see <http://www.gnu.org/licenses/>. */
/* ====================================================================
* 0feh
* ==================================================================== */
void __bea_callspec__ G4_Eb(PDISASM pMyDisasm)
{
GV.REGOPCODE = ((*((UInt8*)(UIntPtr) (GV.EIP_+1))) >> 3) & 0x7;
if (GV.REGOPCODE == 0) {
if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) {
(*pMyDisasm).Prefix.LockPrefix = InUsePrefix;
}
(*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+ARITHMETIC_INSTRUCTION;
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "inc ");
#endif
Eb(pMyDisasm);
FillFlags(pMyDisasm, 40);
}
else if (GV.REGOPCODE == 1) {
if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) {
(*pMyDisasm).Prefix.LockPrefix = InUsePrefix;
}
(*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+ARITHMETIC_INSTRUCTION;
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "dec ");
#endif
Eb(pMyDisasm);
FillFlags(pMyDisasm, 30);
}
else {
FailDecode(pMyDisasm);
}
}

View File

@ -0,0 +1,153 @@
/* Copyright 2006-2009, BeatriX
* File coded by BeatriX
*
* This file is part of BeaEngine.
*
* BeaEngine is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* BeaEngine is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with BeaEngine. If not, see <http://www.gnu.org/licenses/>. */
/* ====================================================================
* 0ffh
* ==================================================================== */
void __bea_callspec__ G5_Ev(PDISASM pMyDisasm)
{
GV.REGOPCODE = ((*((UInt8*)(UIntPtr) (GV.EIP_+1))) >> 3) & 0x7;
if (GV.REGOPCODE == 0) {
if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) {
(*pMyDisasm).Prefix.LockPrefix = InUsePrefix;
}
(*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+ARITHMETIC_INSTRUCTION;
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "inc ");
#endif
Ev(pMyDisasm);
FillFlags(pMyDisasm, 40);
}
else if (GV.REGOPCODE == 1) {
if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) {
(*pMyDisasm).Prefix.LockPrefix = InUsePrefix;
}
(*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+ARITHMETIC_INSTRUCTION;
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "dec ");
#endif
Ev(pMyDisasm);
FillFlags(pMyDisasm, 30);
}
else if (GV.REGOPCODE == 2) {
(*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+CONTROL_TRANSFER;
(*pMyDisasm).Instruction.BranchType = CallType;
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "call ");
#endif
if (GV.Architecture == 64) {
GV.OperandSize = 64;
}
if (GV.OperandSize == 64) {
GV.MemDecoration = Arg1qword;
}
else if (GV.OperandSize == 32) {
GV.MemDecoration = Arg1dword;
}
else {
GV.MemDecoration = Arg1word;
}
MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm);
GV.EIP_ += GV.DECALAGE_EIP+2;
(*pMyDisasm).Instruction.ImplicitModifiedRegs = GENERAL_REG+REG4;
}
else if (GV.REGOPCODE == 3) {
(*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+CONTROL_TRANSFER;
(*pMyDisasm).Instruction.BranchType = CallType;
if (GV.SYNTAX_ == ATSyntax) {
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "lcall ");
#endif
}
else {
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "call far ");
#endif
}
GV.MemDecoration = Arg1fword;
MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm);
GV.EIP_ += GV.DECALAGE_EIP+2;
(*pMyDisasm).Instruction.ImplicitModifiedRegs = GENERAL_REG+REG4;
}
else if (GV.REGOPCODE == 4) {
(*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+CONTROL_TRANSFER;
(*pMyDisasm).Instruction.BranchType = JmpType;
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "jmp ");
#endif
if (GV.Architecture == 64) {
GV.OperandSize = 64;
}
if (GV.OperandSize == 64) {
GV.MemDecoration = Arg1qword;
}
else if (GV.OperandSize == 32) {
GV.MemDecoration = Arg1dword;
}
else {
GV.MemDecoration = Arg1word;
}
MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm);
GV.EIP_ += GV.DECALAGE_EIP+2;
}
else if (GV.REGOPCODE == 5) {
(*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+CONTROL_TRANSFER;
(*pMyDisasm).Instruction.BranchType = JmpType;
if (GV.SYNTAX_ == ATSyntax) {
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "ljmp ");
#endif
}
else {
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "jmp far ");
#endif
}
GV.MemDecoration = Arg1fword;
MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm);
GV.EIP_ += GV.DECALAGE_EIP+2;
}
else if (GV.REGOPCODE == 6) {
(*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+DATA_TRANSFER;
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "push ");
#endif
if (GV.Architecture == 64) {
GV.OperandSize = 64;
}
if (GV.OperandSize == 64) {
GV.MemDecoration = Arg2qword;
}
else if (GV.OperandSize == 32) {
GV.MemDecoration = Arg2dword;
}
else {
GV.MemDecoration = Arg2word;
}
MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm);
GV.EIP_ += GV.DECALAGE_EIP+2;
(*pMyDisasm).Argument1.ArgType = MEMORY_TYPE;
(*pMyDisasm).Argument1.ArgSize = GV.OperandSize;
(*pMyDisasm).Argument1.Memory.BaseRegister = REG4;
(*pMyDisasm).Instruction.ImplicitModifiedRegs = GENERAL_REG+REG4;
}
else {
FailDecode(pMyDisasm);
}
}

View File

@ -0,0 +1,117 @@
/* Copyright 2006-2009, BeatriX
* File coded by BeatriX
*
* This file is part of BeaEngine.
*
* BeaEngine is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* BeaEngine is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with BeaEngine. If not, see <http://www.gnu.org/licenses/>. */
/* ====================================================================
* 0f00h
* ==================================================================== */
void __bea_callspec__ G6_(PDISASM pMyDisasm)
{
Int32 OperandSizeOld = 0;
(*pMyDisasm).Instruction.Category = SYSTEM_INSTRUCTION;
OperandSizeOld = GV.OperandSize;
GV.OperandSize = 16;
GV.REGOPCODE = ((*((UInt8*)(UIntPtr) (GV.EIP_+1))) >> 3) & 0x7;
GV.MOD_= ((*((UInt8*)(UIntPtr) (GV.EIP_+1))) >> 6) & 0x3;
if (GV.REGOPCODE == 0) {
if ((OperandSizeOld == 64) && (GV.MOD_== 0x3)) {
GV.OperandSize = OperandSizeOld;
}
else {
GV.MemDecoration = Arg1word;
}
MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm);
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "sldt ");
#endif
(*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+MEMORY_MANAGEMENT_REG+REG1;
(*pMyDisasm).Argument2.ArgSize = 32;
GV.OperandSize = OperandSizeOld;
GV.EIP_+= GV.DECALAGE_EIP+2;
}
else if (GV.REGOPCODE == 1) {
if ((OperandSizeOld == 64) && (GV.MOD_== 0x3)) {
GV.OperandSize = OperandSizeOld;
}
else {
GV.MemDecoration = Arg1word;
}
MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm);
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "str ");
#endif
(*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+MEMORY_MANAGEMENT_REG+REG3;
(*pMyDisasm).Argument2.ArgSize = 16;
GV.OperandSize = OperandSizeOld;
GV.EIP_+= GV.DECALAGE_EIP+2;
}
else if (GV.REGOPCODE == 2) {
GV.MemDecoration = Arg2word;
MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm);
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "lldt ");
#endif
(*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+MEMORY_MANAGEMENT_REG+REG1;
(*pMyDisasm).Argument1.ArgSize = 16;
GV.OperandSize = OperandSizeOld;
GV.EIP_+= GV.DECALAGE_EIP+2;
}
else if (GV.REGOPCODE == 3) {
GV.MemDecoration = Arg2word;
MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm);
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "ltr ");
#endif
(*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+MEMORY_MANAGEMENT_REG+REG3;
(*pMyDisasm).Argument1.ArgSize = 16;
GV.OperandSize = OperandSizeOld;
GV.EIP_+= GV.DECALAGE_EIP+2;
}
else if (GV.REGOPCODE == 4) {
GV.MemDecoration = Arg1word;
MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm);
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "verr ");
#endif
(*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+SPECIAL_REG+REG0;
(*pMyDisasm).Argument2.ArgSize = 16;
GV.OperandSize = OperandSizeOld;
GV.EIP_+= GV.DECALAGE_EIP+2;
}
else if (GV.REGOPCODE == 5) {
GV.MemDecoration = Arg1word;
MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm);
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "verw ");
#endif
(*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+SPECIAL_REG+REG0;
(*pMyDisasm).Argument2.ArgSize = 16;
GV.OperandSize = OperandSizeOld;
GV.EIP_+= GV.DECALAGE_EIP+2;
}
else if (GV.REGOPCODE == 6) {
FailDecode(pMyDisasm);
GV.OperandSize = OperandSizeOld;
}
else {
FailDecode(pMyDisasm);
GV.OperandSize = OperandSizeOld;
}
}

View File

@ -0,0 +1,278 @@
/* Copyright 2006-2009, BeatriX
* File coded by BeatriX
*
* This file is part of BeaEngine.
*
* BeaEngine is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* BeaEngine is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with BeaEngine. If not, see <http://www.gnu.org/licenses/>. */
/* ====================================================================
* 0f01h
* ==================================================================== */
void __bea_callspec__ G7_(PDISASM pMyDisasm)
{
(*pMyDisasm).Instruction.Category = SYSTEM_INSTRUCTION;
GV.REGOPCODE = ((*((UInt8*)(UIntPtr) (GV.EIP_+1))) >> 3) & 0x7;
GV.MOD_= ((*((UInt8*)(UIntPtr) (GV.EIP_+1))) >> 6) & 0x3;
GV.RM_ = (*((UInt8*)(UIntPtr) (GV.EIP_+1))) & 0x7;
if (GV.REGOPCODE == 0) {
if (GV.MOD_== 0x3) {
if (GV.RM_ == 0x1) {
(*pMyDisasm).Instruction.Category = VM_INSTRUCTION;
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "vmcall ");
#endif
GV.EIP_+= GV.DECALAGE_EIP+2;
}
else if (GV.RM_ == 0x2) {
(*pMyDisasm).Instruction.Category = VM_INSTRUCTION;
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "vmlaunch ");
#endif
GV.EIP_+= GV.DECALAGE_EIP+2;
}
else if (GV.RM_ == 0x3) {
(*pMyDisasm).Instruction.Category = VM_INSTRUCTION;
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "vmresume ");
#endif
GV.EIP_+= GV.DECALAGE_EIP+2;
}
else if (GV.RM_ == 0x4) {
(*pMyDisasm).Instruction.Category = VM_INSTRUCTION;
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "vmxoff ");
#endif
GV.EIP_+= GV.DECALAGE_EIP+2;
}
else {
FailDecode(pMyDisasm);
}
}
else {
GV.MemDecoration = Arg1fword;
MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm);
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "sgdt ");
#endif
(*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+MEMORY_MANAGEMENT_REG+REG0;
(*pMyDisasm).Argument2.ArgSize = 48;
GV.EIP_+= GV.DECALAGE_EIP+2;
}
}
else if (GV.REGOPCODE == 1) {
if (GV.MOD_== 0x3) {
if (GV.RM_ == 0x00) {
(*pMyDisasm).Instruction.Category = SSE3_INSTRUCTION+AGENT_SYNCHRONISATION;
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "monitor ");
#endif
GV.EIP_+= GV.DECALAGE_EIP+2;
}
else if (GV.RM_ == 0x01) {
(*pMyDisasm).Instruction.Category = SSE3_INSTRUCTION+AGENT_SYNCHRONISATION;
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "mwait ");
#endif
GV.EIP_+= GV.DECALAGE_EIP+2;
}
else {
FailDecode(pMyDisasm);
}
}
else {
GV.MemDecoration = Arg1fword;
MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm);
(*pMyDisasm).Instruction.Category = SYSTEM_INSTRUCTION;
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "sidt ");
#endif
(*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+MEMORY_MANAGEMENT_REG+REG2;
(*pMyDisasm).Argument2.ArgSize = 48;
GV.EIP_+= GV.DECALAGE_EIP+2;
}
}
else if (GV.REGOPCODE == 2) {
if (GV.MOD_== 0x3) {
if (GV.RM_ == 0x0) {
(*pMyDisasm).Instruction.Category = VM_INSTRUCTION;
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "xgetbv ");
#endif
GV.EIP_+= GV.DECALAGE_EIP+2;
}
else if (GV.RM_ == 0x1) {
(*pMyDisasm).Instruction.Category = VM_INSTRUCTION;
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "xsetbv ");
#endif
GV.EIP_+= GV.DECALAGE_EIP+2;
}
else {
FailDecode(pMyDisasm);
}
}
else {
GV.MemDecoration = Arg2fword;
MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm);
(*pMyDisasm).Instruction.Category = SYSTEM_INSTRUCTION;
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "lgdt ");
#endif
(*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+MEMORY_MANAGEMENT_REG+REG0;
(*pMyDisasm).Argument1.ArgSize = 48;
GV.EIP_+= GV.DECALAGE_EIP+2;
}
}
else if (GV.REGOPCODE == 3) {
if (GV.MOD_== 0x3) {
if (GV.RM_ == 0x0) {
(*pMyDisasm).Instruction.Category = VM_INSTRUCTION;
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "vmrun ");
#endif
GV.EIP_+= GV.DECALAGE_EIP+2;
}
else if (GV.RM_ == 0x1) {
(*pMyDisasm).Instruction.Category = VM_INSTRUCTION;
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "vmmcall ");
#endif
GV.EIP_+= GV.DECALAGE_EIP+2;
}
else if (GV.RM_ == 0x2) {
(*pMyDisasm).Instruction.Category = VM_INSTRUCTION;
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "vmload ");
#endif
GV.EIP_+= GV.DECALAGE_EIP+2;
}
else if (GV.RM_ == 0x3) {
(*pMyDisasm).Instruction.Category = VM_INSTRUCTION;
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "vmsave ");
#endif
GV.EIP_+= GV.DECALAGE_EIP+2;
}
else if (GV.RM_ == 0x4) {
(*pMyDisasm).Instruction.Category = VM_INSTRUCTION;
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "stgi ");
#endif
GV.EIP_+= GV.DECALAGE_EIP+2;
}
else if (GV.RM_ == 0x5) {
(*pMyDisasm).Instruction.Category = VM_INSTRUCTION;
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "clgi ");
#endif
GV.EIP_+= GV.DECALAGE_EIP+2;
}
else if (GV.RM_ == 0x6) {
(*pMyDisasm).Instruction.Category = VM_INSTRUCTION;
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "skinit ");
#endif
GV.EIP_+= GV.DECALAGE_EIP+2;
}
else if (GV.RM_ == 0x7) {
(*pMyDisasm).Instruction.Category = VM_INSTRUCTION;
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "invlpga ");
#endif
GV.EIP_+= GV.DECALAGE_EIP+2;
}
else {
FailDecode(pMyDisasm);
}
}
else {
GV.MemDecoration = Arg2fword;
MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm);
(*pMyDisasm).Instruction.Category = SYSTEM_INSTRUCTION;
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "lidt ");
#endif
(*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+MEMORY_MANAGEMENT_REG+REG2;
(*pMyDisasm).Argument1.ArgSize = 48;
GV.EIP_+= GV.DECALAGE_EIP+2;
}
}
else if (GV.REGOPCODE == 4) {
GV.MemDecoration = Arg2word;
MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm);
(*pMyDisasm).Instruction.Category = SYSTEM_INSTRUCTION;
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "smsw ");
#endif
(*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+CR_REG+REG0;
(*pMyDisasm).Argument1.ArgSize = 16;
GV.EIP_+= GV.DECALAGE_EIP+2;
}
else if (GV.REGOPCODE == 6) {
GV.MemDecoration = Arg1word;
MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm);
(*pMyDisasm).Instruction.Category = SYSTEM_INSTRUCTION;
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "lmsw ");
#endif
(*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+CR_REG+REG0;
(*pMyDisasm).Argument2.ArgSize = 16;
GV.EIP_+= GV.DECALAGE_EIP+2;
}
else if (GV.REGOPCODE == 7) {
if (GV.MOD_== 0x3) {
if (GV.Architecture == 64) {
if (GV.RM_ == 0x0) {
(*pMyDisasm).Instruction.Category = SYSTEM_INSTRUCTION;
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "swapgs ");
#endif
GV.EIP_+= GV.DECALAGE_EIP+2;
}
else {
FailDecode(pMyDisasm);
}
}
else {
if (GV.RM_ == 0x1) {
(*pMyDisasm).Instruction.Category = SYSTEM_INSTRUCTION;
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "rdtscp ");
#endif
GV.EIP_+= GV.DECALAGE_EIP+2;
}
else {
FailDecode(pMyDisasm);
}
}
}
else {
GV.MemDecoration = Arg2byte;
MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm);
(*pMyDisasm).Instruction.Category = SYSTEM_INSTRUCTION;
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "invlpg ");
#endif
GV.EIP_+= GV.DECALAGE_EIP+2;
}
}
else {
FailDecode(pMyDisasm);
}
}

View File

@ -0,0 +1,70 @@
/* Copyright 2006-2009, BeatriX
* File coded by BeatriX
*
* This file is part of BeaEngine.
*
* BeaEngine is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* BeaEngine is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with BeaEngine. If not, see <http://www.gnu.org/licenses/>. */
/* ====================================================================
* 0fbah
* ==================================================================== */
void __bea_callspec__ G8_EvIb(PDISASM pMyDisasm)
{
GV.REGOPCODE = ((*((UInt8*)(UIntPtr) (GV.EIP_+1))) >> 3) & 0x7;
EvIb(pMyDisasm);
if (GV.REGOPCODE == 4) {
(*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+BIT_UInt8;
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "bt ");
#endif
(*pMyDisasm).Argument1.AccessMode = READ;
FillFlags(pMyDisasm, 11);
}
else if (GV.REGOPCODE == 5) {
if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) {
(*pMyDisasm).Prefix.LockPrefix = InUsePrefix;
}
(*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+BIT_UInt8;
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "bts ");
#endif
(*pMyDisasm).Argument1.AccessMode = READ;
FillFlags(pMyDisasm, 11);
}
else if (GV.REGOPCODE == 6) {
if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) {
(*pMyDisasm).Prefix.LockPrefix = InUsePrefix;
}
(*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+BIT_UInt8;
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "btr ");
#endif
(*pMyDisasm).Argument1.AccessMode = READ;
FillFlags(pMyDisasm, 11);
}
else if (GV.REGOPCODE == 7) {
if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) {
(*pMyDisasm).Prefix.LockPrefix = InUsePrefix;
}
(*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+BIT_UInt8;
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "btc ");
#endif
(*pMyDisasm).Argument1.AccessMode = READ;
FillFlags(pMyDisasm, 11);
}
else {
FailDecode(pMyDisasm);
}
}

View File

@ -0,0 +1,84 @@
/* Copyright 2006-2009, BeatriX
* File coded by BeatriX
*
* This file is part of BeaEngine.
*
* BeaEngine is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* BeaEngine is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with BeaEngine. If not, see <http://www.gnu.org/licenses/>. */
/* ====================================================================
* 0fc7h
* ==================================================================== */
void __bea_callspec__ G9_(PDISASM pMyDisasm)
{
GV.REGOPCODE = ((*((UInt8*)(UIntPtr) (GV.EIP_+1))) >> 3) & 0x7;
GV.MemDecoration = Arg2qword;
MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm);
if (GV.REGOPCODE == 1) {
if (GV.REX.W_ == 1) {
GV.MemDecoration = Arg2dqword;
(*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+DATA_TRANSFER;
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "cmpxchg16b ");
#endif
(*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+GENERAL_REG+REG0+REG2;
(*pMyDisasm).Argument1.ArgSize = 128;
(*pMyDisasm).Argument1.AccessMode = READ;
FillFlags(pMyDisasm, 23);
GV.EIP_ += GV.DECALAGE_EIP+2;
}
else {
(*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+DATA_TRANSFER;
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "cmpxchg8b ");
#endif
(*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+GENERAL_REG+REG0+REG2;
(*pMyDisasm).Argument1.ArgSize = 64;
(*pMyDisasm).Argument1.AccessMode = READ;
FillFlags(pMyDisasm, 23);
GV.EIP_ += GV.DECALAGE_EIP+2;
}
}
else if (GV.REGOPCODE == 6) {
(*pMyDisasm).Instruction.Category = VM_INSTRUCTION;
if (GV.OperandSize == 16) {
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "vmclear ");
#endif
}
else if (GV.PrefRepe == 1) {
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "vmxon ");
#endif
}
else {
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "vmptrld ");
#endif
}
GV.EIP_ += GV.DECALAGE_EIP+2;
}
else if (GV.REGOPCODE == 7) {
(*pMyDisasm).Instruction.Category = VM_INSTRUCTION;
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "vmptrst ");
#endif
GV.EIP_ += GV.DECALAGE_EIP+2;
}
else {
FailDecode(pMyDisasm);
}
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,239 @@
/* Copyright 2006-2009, BeatriX
* File coded by BeatriX
*
* This file is part of BeaEngine.
*
* BeaEngine is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* BeaEngine is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with BeaEngine. If not, see <http://www.gnu.org/licenses/>. */
/* ====================================================================
* Legacy Prefix F0h-Group 1
* ==================================================================== */
void __bea_callspec__ PrefLock(PDISASM pMyDisasm)
{
if (!Security(0, pMyDisasm)) return;
(*pMyDisasm).Prefix.LockPrefix = InvalidPrefix;
GV.EIP_++;
(*pMyDisasm).Prefix.Number++;
GV.NB_PREFIX++;
(*pMyDisasm).Instruction.Opcode = *((UInt8*) (UIntPtr)GV.EIP_);
(void) opcode_map1[*((UInt8*) (UIntPtr)GV.EIP_)](pMyDisasm);
GV.OperandSize = 32;
}
/* ====================================================================
* Legacy Prefix F2h-Group 1
* ==================================================================== */
void __bea_callspec__ PrefREPNE(PDISASM pMyDisasm)
{
if (!Security(0, pMyDisasm)) return;
(*pMyDisasm).Prefix.RepnePrefix = SuperfluousPrefix;
GV.EIP_++;
(*pMyDisasm).Prefix.Number++;
GV.NB_PREFIX++;
GV.PrefRepne = 1;
(*pMyDisasm).Instruction.Opcode = *((UInt8*) (UIntPtr)GV.EIP_);
(void) opcode_map1[*((UInt8*) (UIntPtr)GV.EIP_)](pMyDisasm);
GV.PrefRepne = 0;
}
/* ====================================================================
* Legacy Prefix F3h-Group 1
* ==================================================================== */
void __bea_callspec__ PrefREPE(PDISASM pMyDisasm)
{
if (!Security(0, pMyDisasm)) return;
(*pMyDisasm).Prefix.RepPrefix = SuperfluousPrefix;
GV.EIP_++;
(*pMyDisasm).Prefix.Number++;
GV.NB_PREFIX++;
GV.PrefRepe = 1;
(*pMyDisasm).Instruction.Opcode = *((UInt8*) (UIntPtr)GV.EIP_);
(void) opcode_map1[*((UInt8*) (UIntPtr)GV.EIP_)](pMyDisasm);
GV.PrefRepe = 0;
}
/* ====================================================================
* Legacy Prefix 2Eh-Group 2
* ==================================================================== */
void __bea_callspec__ PrefSEGCS(PDISASM pMyDisasm)
{
if (!Security(0, pMyDisasm)) return;
(*pMyDisasm).Prefix.CSPrefix = InUsePrefix;
GV.EIP_++;
(*pMyDisasm).Prefix.Number++;
GV.NB_PREFIX++;
(*pMyDisasm).Instruction.Opcode = *((UInt8*) (UIntPtr)GV.EIP_);
(void) opcode_map1[*((UInt8*) (UIntPtr)GV.EIP_)](pMyDisasm);
}
/* ====================================================================
* Legacy Prefix 3Eh-Group 2
* ==================================================================== */
void __bea_callspec__ PrefSEGDS(PDISASM pMyDisasm)
{
if (!Security(0, pMyDisasm)) return;
(*pMyDisasm).Prefix.DSPrefix = InUsePrefix;
GV.EIP_++;
(*pMyDisasm).Prefix.Number++;
GV.NB_PREFIX++;
(*pMyDisasm).Instruction.Opcode = *((UInt8*) (UIntPtr)GV.EIP_);
(void) opcode_map1[*((UInt8*) (UIntPtr)GV.EIP_)](pMyDisasm);
}
/* ====================================================================
* Legacy Prefix 26h-Group 2
* ==================================================================== */
void __bea_callspec__ PrefSEGES(PDISASM pMyDisasm)
{
if (!Security(0, pMyDisasm)) return;
(*pMyDisasm).Prefix.ESPrefix = InUsePrefix;
GV.EIP_++;
(*pMyDisasm).Prefix.Number++;
GV.NB_PREFIX++;
(*pMyDisasm).Instruction.Opcode = *((UInt8*) (UIntPtr)GV.EIP_);
(void) opcode_map1[*((UInt8*) (UIntPtr)GV.EIP_)](pMyDisasm);
}
/* ====================================================================
* Legacy Prefix 64h-Group 2
* ==================================================================== */
void __bea_callspec__ PrefSEGFS(PDISASM pMyDisasm)
{
if (!Security(0, pMyDisasm)) return;
(*pMyDisasm).Prefix.FSPrefix = InUsePrefix;
GV.EIP_++;
(*pMyDisasm).Prefix.Number++;
GV.NB_PREFIX++;
GV.SEGMENTFS = 1;
(*pMyDisasm).Instruction.Opcode = *((UInt8*) (UIntPtr)GV.EIP_);
(void) opcode_map1[*((UInt8*) (UIntPtr)GV.EIP_)](pMyDisasm);
}
/* ====================================================================
* Legacy Prefix 65h-Group 2
* ==================================================================== */
void __bea_callspec__ PrefSEGGS(PDISASM pMyDisasm)
{
if (!Security(0, pMyDisasm)) return;
(*pMyDisasm).Prefix.GSPrefix = InUsePrefix;
GV.EIP_++;
(*pMyDisasm).Prefix.Number++;
GV.NB_PREFIX++;
(*pMyDisasm).Instruction.Opcode = *((UInt8*) (UIntPtr)GV.EIP_);
(void) opcode_map1[*((UInt8*) (UIntPtr)GV.EIP_)](pMyDisasm);
}
/* ====================================================================
* Legacy Prefix 36h-Group 2
* ==================================================================== */
void __bea_callspec__ PrefSEGSS(PDISASM pMyDisasm)
{
if (!Security(0, pMyDisasm)) return;
(*pMyDisasm).Prefix.SSPrefix = InUsePrefix;
GV.EIP_++;
(*pMyDisasm).Prefix.Number++;
GV.NB_PREFIX++;
(*pMyDisasm).Instruction.Opcode = *((UInt8*) (UIntPtr)GV.EIP_);
(void) opcode_map1[*((UInt8*) (UIntPtr)GV.EIP_)](pMyDisasm);
}
/* ====================================================================
* Legacy Prefix 66h-Group 3
* ==================================================================== */
void __bea_callspec__ PrefOpSize(PDISASM pMyDisasm)
{
if (!Security(0, pMyDisasm)) return;
(*pMyDisasm).Prefix.OperandSize = InUsePrefix;
GV.EIP_++;
(*pMyDisasm).Prefix.Number++;
GV.NB_PREFIX++;
GV.OriginalOperandSize = GV.OperandSize; /* if GV.OperandSize is used as a mandatory prefix, keep the real operandsize value */
if (GV.Architecture == 16) {
GV.OperandSize = 32;
}
else {
if (GV.OperandSize != 64) {
GV.OperandSize = 16;
}
}
(*pMyDisasm).Instruction.Opcode = *((UInt8*) (UIntPtr)GV.EIP_);
(void) opcode_map1[*((UInt8*) (UIntPtr)GV.EIP_)](pMyDisasm);
if (GV.Architecture == 16) {
GV.OperandSize = 16;
}
else {
GV.OperandSize = 32;
}
}
/* ====================================================================
* Legacy Prefix 67h-Group 4
* ==================================================================== */
void __bea_callspec__ PrefAdSize(PDISASM pMyDisasm)
{
if (!Security(0, pMyDisasm)) return;
(*pMyDisasm).Prefix.AddressSize = InUsePrefix;
GV.EIP_++;
(*pMyDisasm).Prefix.Number++;
GV.NB_PREFIX++;
if (GV.Architecture == 16) {
GV.AddressSize = GV.AddressSize << 1;
}
else {
GV.AddressSize = GV.AddressSize >> 1;
}
(*pMyDisasm).Instruction.Opcode = *((UInt8*) (UIntPtr)GV.EIP_);
(void) opcode_map1[*((UInt8*) (UIntPtr)GV.EIP_)](pMyDisasm);
if (GV.Architecture == 16) {
GV.AddressSize = GV.AddressSize >> 1;
}
else {
GV.AddressSize = GV.AddressSize << 1;
}
}
/* ====================================================================
* Escape Prefix 0Fh-two bytes opcodes
* ==================================================================== */
void __bea_callspec__ Esc_2byte(PDISASM pMyDisasm)
{
if (!Security(0, pMyDisasm)) return;
GV.EIP_++;
(*pMyDisasm).Instruction.Opcode = *((UInt8*) (UIntPtr)GV.EIP_)+0x0F00;
(void) opcode_map2[*((UInt8*) (UIntPtr)GV.EIP_)](pMyDisasm);
}
/* ====================================================================
* Escape Prefix 0F38h-three bytes opcodes
* ==================================================================== */
void __bea_callspec__ Esc_tableA4(PDISASM pMyDisasm)
{
if (!Security(0, pMyDisasm)) return;
GV.EIP_++;
(*pMyDisasm).Instruction.Opcode = *((UInt8*) (UIntPtr)GV.EIP_)+0x0F3800;
(void) opcode_map3[*((UInt8*) (UIntPtr)GV.EIP_)](pMyDisasm);
}
/* ====================================================================
* Escape Prefix 0F3Ah-three bytes opcodes
* ==================================================================== */
void __bea_callspec__ Esc_tableA5(PDISASM pMyDisasm)
{
if (!Security(0, pMyDisasm)) return;
GV.EIP_++;
(*pMyDisasm).Instruction.Opcode = *((UInt8*) (UIntPtr)GV.EIP_)+0x0F3A00;
(void) opcode_map4[*((UInt8*) (UIntPtr)GV.EIP_)](pMyDisasm);
}

View File

@ -0,0 +1,560 @@
/* Copyright 2006-2009, BeatriX
* File coded by BeatriX
*
* This file is part of BeaEngine.
*
* BeaEngine is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* BeaEngine is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with BeaEngine. If not, see <http://www.gnu.org/licenses/>. */
/* Define prefix GV aka GlobalVariable - used instead of global internal variables to make BeaEngine thread-safe */
#define GV (*pMyDisasm).Reserved_
/* Define constants to identify the position and type of decoration used in case of memory argument */
#define Arg1byte 1
#define Arg1word 2
#define Arg1dword 3
#define Arg1qword 4
#define Arg1multibytes 5
#define Arg1tbyte 6
#define Arg1fword 7
#define Arg1dqword 8
#define Arg2byte 101
#define Arg2word 102
#define Arg2dword 103
#define Arg2qword 104
#define Arg2multibytes 105
#define Arg2tbyte 106
#define Arg2fword 107
#define Arg2dqword 108
EFLStruct EFLAGS_TABLE[] = {
{UN_, UN_, UN_, MO_, UN_, MO_, 0 , 0 , 0 , 0 , 0, 0}, /* 0-AAA */
{UN_, MO_, MO_, UN_, MO_, UN_, 0 , 0 , 0 , 0 , 0, 0}, /* 1-AAD */
{UN_, MO_, MO_, UN_, MO_, UN_, 0 , 0 , 0 , 0 , 0, 0}, /* 2-AAM */
{UN_, UN_, UN_, MO_, UN_, MO_, 0 , 0 , 0 , 0 , 0, 0}, /* 3-AAS */
{MO_, MO_, MO_, MO_, MO_, MO_, 0 , 0 , 0 , 0 , 0, 0}, /* 4-ADC */
{MO_, MO_, MO_, MO_, MO_, MO_, 0 , 0 , 0 , 0 , 0, 0}, /* 5-ADD */
{RE_, MO_, MO_, UN_, MO_, RE_, 0 , 0 , 0 , 0 , 0, 0}, /* 6-AND */
{0 , 0 , MO_, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0, 0}, /* 7-ARPL */
{0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0, 0}, /* 8-BOUND */
{UN_, UN_, MO_, UN_, UN_, UN_, 0 , 0 , 0 , 0 , 0, 0}, /* 9-BSF/BSR */
{0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0, 0}, /* 10-BSWAP */
{UN_, UN_, UN_, UN_, UN_, MO_, 0 , 0 , 0 , 0 , 0, 0}, /* 11-BT/BTS/BTR/BTC */
{0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0, 0}, /* 12-CALL */
{0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0, 0}, /* 13-CBW */
{0 , 0 , 0 , 0 , 0 , RE_, 0 , 0 , 0 , 0 , 0, 0}, /* 14-CLC */
{0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , RE_, 0 , 0, 0}, /* 15-CLD */
{0 , 0 , 0 , 0 , 0 , 0 , 0 , RE_, 0 , 0 , 0, 0}, /* 16-CLI */
{0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0, 0}, /* 17-CLTS */
{0 , 0 , 0 , 0 , 0 , MO_, 0 , 0 , 0 , 0 , 0, 0}, /* 18-CMC */
{TE_, TE_, TE_, 0 , TE_, TE_, 0 , 0 , 0 , 0 , 0, 0}, /* 19-CMOVcc */
{MO_, MO_, MO_, MO_, MO_, MO_, 0 , 0 , 0 , 0 , 0, 0}, /* 20-CMP */
{MO_, MO_, MO_, MO_, MO_, MO_, 0 , 0 , 0 , 0 , 0, 0}, /* 21-CMPS */
{MO_, MO_, MO_, MO_, MO_, MO_, 0 , 0 , 0 , 0 , 0, 0}, /* 22-CMPXCHG */
{0 , 0 , MO_, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0, 0}, /* 23-CMPXCHGG8B */
{RE_, RE_, MO_, RE_, MO_, MO_, 0 , 0 , 0 , 0 , 0, 0}, /* 24-COMSID */
{RE_, RE_, MO_, RE_, MO_, MO_, 0 , 0 , 0 , 0 , 0, 0}, /* 25-COMISS */
{0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0, 0}, /* 26-CPUID */
{0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0, 0}, /* 27-CWD */
{UN_, MO_, MO_, MO_, MO_, MO_, 0 , 0 , 0 , 0 , 0, 0}, /* 28-DAA */
{UN_, MO_, MO_, MO_, MO_, MO_, 0 , 0 , 0 , 0 , 0, 0}, /* 29-DAS */
{MO_, MO_, MO_, MO_, MO_, MO_, 0 , 0 , 0 , 0 , 0, 0}, /* 30-DEC */
{UN_, UN_, UN_, UN_, UN_, UN_, 0 , 0 , 0 , 0 , 0, 0}, /* 31-DIV */
{0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0, 0}, /* 32-ENTER */
{0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0, 0}, /* 33-ESC */
{0 , 0 , TE_, 0 , TE_, TE_, 0 , 0 , 0 , 0 , 0, 0}, /* 34-FCMOV */
{0 , 0 , MO_, 0 , MO_, MO_, 0 , 0 , 0 , 0 , 0, 0}, /* 35-FCOMI FCOMIP FUCMI FUCMIP */
{0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0, 0}, /* 36-HLT */
{UN_, UN_, UN_, UN_, UN_, UN_, 0 , 0 , 0 , 0 , 0, 0}, /* 37-IDIV */
{MO_, UN_, UN_, UN_, UN_, MO_, 0 , 0 , 0 , 0 , 0, 0}, /* 38-IMUL */
{0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0, 0}, /* 39-IN */
{MO_, MO_, MO_, MO_, MO_, 0 , 0 , 0 , 0 , 0 , 0, 0}, /* 40-INC */
{0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , TE_, 0 , 0, 0}, /* 41-INS */
{0 , 0 , 0 , 0 , 0 , 0 , RE_, 0 , 0 , RE_, 0, 0}, /* 42-INT */
{TE_, 0 , 0 , 0 , 0 , 0 , RE_, 0 , 0 , RE_, 0, 0}, /* 43-INTO */
{0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0, 0}, /* 44-INVD */
{0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0, 0}, /* 45-INVLPG */
{RE_, RE_, MO_, RE_, MO_, MO_, 0 , 0 , 0 , 0 , 0, 0}, /* 46-UCOMSID */
{RE_, RE_, MO_, RE_, MO_, MO_, 0 , 0 , 0 , 0 , 0, 0}, /* 47-UCOMISS */
{PR_, PR_, PR_, PR_, PR_, PR_, PR_, PR_, PR_, TE_, 0, 0}, /* 48-IRET */
{TE_, TE_, TE_, 0 , TE_, TE_, 0 , 0 , 0 , 0 , 0, 0}, /* 49-Jcc */
{0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0, 0}, /* 50-JCXZ */
{0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0, 0}, /* 51-JMP */
{0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0, 0}, /* 52-LAHF */
{0 , 0 , MO_, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0, 0}, /* 53-LAR */
{0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0, 0}, /* 54-LDS LES LSS LFS LGS */
{0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0, 0}, /* 55-LEA */
{0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0, 0}, /* 56-LEAVE */
{0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0, 0}, /* 57-LGDT LIDT LLDT LMSW */
{0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0, 0}, /* 58-LOCK */
{0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , TE_, 0 , 0, 0}, /* 59-LODS */
{0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0, 0}, /* 60-LOOP */
{0 , 0 , TE_, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0, 0}, /* 61-LOOPE LOOPNE */
{0 , 0 , MO_, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0, 0}, /* 62-LSL */
{0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0, 0}, /* 63-LTR */
{0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0, 0}, /* 64-MONITOR */
{0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0, 0}, /* 65-MWAIT */
{0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0, 0}, /* 66-MOV */
{UN_, UN_, UN_, UN_, UN_, UN_, 0 , 0 , 0 , 0 , 0, 0}, /* 67-MOV control, debug, test */
{0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , TE_, 0 , 0, 0}, /* 68-MOVS */
{0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0, 0}, /* 69-MOVSX MOVZX */
{MO_, UN_, UN_, UN_, UN_, MO_, 0 , 0 , 0 , 0 , 0, 0}, /* 70-MUL */
{MO_, MO_, MO_, MO_, MO_, MO_, 0 , 0 , 0 , 0 , 0, 0}, /* 71-NEG */
{0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0, 0}, /* 72-NOP */
{0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0, 0}, /* 73-NOT */
{RE_, MO_, MO_, UN_, MO_, RE_, 0 , 0 , 0 , 0 , 0, 0}, /* 74-OR */
{0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0, 0}, /* 75-OUT */
{0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , TE_, 0 , 0, 0}, /* 76-OUTS */
{0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0, 0}, /* 77-POP POPA */
{PR_, PR_, PR_, PR_, PR_, PR_, PR_, PR_, PR_, PR_, 0, 0}, /* 78-POPF */
{0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0, 0}, /* 79-PUSH PUSHA PUSHF */
{MO_, 0 , 0 , 0 , 0 , MO_, 0 , 0 , 0 , 0 , 0, 0}, /* 80-RCL RCR 1 */
{UN_, 0 , 0 , 0 , 0 , MO_, 0 , 0 , 0 , 0 , 0, 0}, /* 81-RCL RCR */
{0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0, 0}, /* 82-RDMSR */
{0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0, 0}, /* 83-RDPMC */
{0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0, 0}, /* 84-RDTSC */
{0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0, 0}, /* 85-REP REPE REPNE */
{0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0, 0}, /* 86-RET */
{MO_, 0 , 0 , 0 , 0 , MO_, 0 , 0 , 0 , 0 , 0, 0}, /* 87-ROL ROR 1 */
{UN_, 0 , 0 , 0 , 0 , MO_, 0 , 0 , 0 , 0 , 0, 0}, /* 88-ROL ROR */
{MO_, MO_, MO_, MO_, MO_, MO_, MO_, MO_, MO_, MO_, MO_, 0}, /* 89-RSM */
{0 , PR_, PR_, PR_, PR_, PR_, 0 , 0 , 0 , 0 , 0, 0}, /* 90-SAHF */
{MO_, MO_, MO_, 0 , MO_, MO_, 0 , 0 , 0 , 0 , 0, 0}, /* 91-SAL SAR SHL SHR 1 */
{0 , MO_, MO_, 0 , MO_, MO_, 0 , 0 , 0 , 0 , 0, 0}, /* 92-SAL SAR SHL SHR */
{MO_, MO_, MO_, MO_, MO_, MO_, 0 , 0 , 0 , 0 , 0, 0}, /* 93-SBB */
{MO_, MO_, MO_, MO_, MO_, MO_, 0 , 0 , 0 , 0 , 0, 0}, /* 94-SCAS */
{TE_, TE_, TE_, 0 , TE_, TE_, 0 , 0 , 0 , 0 , 0, 0}, /* 95-SETcc */
{0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0, 0}, /* 96-SGDT SIDT SLDT SMSW */
{UN_, MO_, MO_, UN_, MO_, MO_, 0 , 0 , 0 , 0 , 0, 0}, /* 97-SHLD SHRD */
{0 , 0 , 0 , 0 , 0 , SE_, 0 , 0 , 0 , 0 , 0, 0}, /* 98-STC */
{0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , SE_, 0 , 0, 0}, /* 99-STD */
{0 , 0 , 0 , 0 , 0 , 0 , 0 , SE_, 0 , 0 , 0, 0}, /* 100-STI */
{0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0, 0}, /* 101-STOS */
{0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0, 0}, /* 102-STR */
{MO_, MO_, MO_, MO_, MO_, MO_, 0 , 0 , 0 , 0 , 0, 0}, /* 103-SUB */
{RE_, MO_, MO_, UN_, MO_, RE_, 0 , 0 , 0 , 0 , 0, 0}, /* 104-TEST */
{0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0, 0}, /* 105-UD2 */
{0 , 0 , MO_, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0, 0}, /* 106-VERR VERRW */
{0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0, 0}, /* 107-WAIT */
{0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0, 0}, /* 108-WBINVD */
{0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0, 0}, /* 109-WRMSR */
{MO_, MO_, MO_, MO_, MO_, MO_, 0 , 0 , 0 , 0 , 0, 0}, /* 110-XADD */
{0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0, 0}, /* 111-XCHG */
{0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0, 0}, /* 112-XLAT */
{RE_, MO_, MO_, UN_, MO_, RE_, 0 , 0 , 0 , 0 , 0, 0}, /* 113-XOR */
{RE_, RE_, MO_, RE_, RE_, RE_, 0 , 0 , 0 , 0 , 0, 0}, /* 114-POPCNT */
{TE_, TE_, TE_, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0, 0}, /*115 -jg jnle jng jle http://ref.x86asm.net/coder.html */
{TE_, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0, 0}, /*116 -jo jno http://ref.x86asm.net/coder.html */
{0 , 0 , 0 , 0 , 0 , TE_, 0 , 0 , 0 , 0 , 0, 0}, /*117 -jc jnc jb jnb jnae jae http://ref.x86asm.net/coder.html */
{0 , 0 , TE_, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0, 0}, /*118 -jz jnz je jne http://ref.x86asm.net/coder.html */
{0 , 0 , TE_, 0 , 0 , TE_, 0 , 0 , 0 , 0 , 0, 0}, /*119 -jbe jnbe jna ja http://ref.x86asm.net/coder.html */
{0 , TE_, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0, 0}, /* 120 - js jns http://ref.x86asm.net/coder.html */
{0 , 0 , 0 , 0 , TE_, 0 , 0 , 0 , 0 , 0 , 0, 0}, /* 121 - jp jpe jnp jpo http://ref.x86asm.net/coder.html */
{TE_, TE_, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0, 0} /* 122 - jl jnge jnl jge http://ref.x86asm.net/coder.html */
};
/* =====================================================
* To make a tabulation between mnemonic and first argument
* ===================================================== */
char space_tab[11][16] = {
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
};
/* =====================================================
* Segment registers
* ===================================================== */
char SegmentRegs[7][4] = {
"??:", /* +0 */
"es:", /* +1 */
"ds:", /* +2 */
"fs:", /* +3 */
"gs:", /* +4 */
"cs:", /* +5 */
"ss:", /* +6 */
};
/* =====================================================
* AT&T Suffixes
* ===================================================== */
char ATSuffixes[8][4] = {
"b ", /* GV.MemDecoration == 1 */
"w ", /* GV.MemDecoration == 2 */
"l ", /* GV.MemDecoration == 3 */
"q ", /* GV.MemDecoration == 4 */
" ", /* GV.MemDecoration == 5 (multibytes) */
"t ", /* GV.MemDecoration == 6 */
" ", /* GV.MemDecoration == 7 (fword) */
" ", /* GV.MemDecoration == 8 (dqword) */
};
/* =====================================================
* MASM Prefixes for MemoryType
* ===================================================== */
char MasmPrefixes[8][16] = {
"byte ptr ", /* GV.MemDecoration == 1 */
"word ptr ", /* GV.MemDecoration == 2 */
"dword ptr ", /* GV.MemDecoration == 3 */
"qword ptr ", /* GV.MemDecoration == 4 */
" ", /* GV.MemDecoration == 5 (multibytes) */
"tbyte ptr ", /* GV.MemDecoration == 6 */
"fword ptr ", /* GV.MemDecoration == 7 (fword) */
"dqword ptr ", /* GV.MemDecoration == 8 (dqword) */
};
/* =====================================================
* NASM Prefixes for MemoryType
* ===================================================== */
char NasmPrefixes[8][8] = {
"byte ", /* GV.MemDecoration == 1 */
"word ", /* GV.MemDecoration == 2 */
" ", /* GV.MemDecoration == 3 */
"qword ", /* GV.MemDecoration == 4 */
" ", /* GV.MemDecoration == 5 (multibytes) */
"tword ", /* GV.MemDecoration == 6 */
" ", /* GV.MemDecoration == 7 (fword) */
" ", /* GV.MemDecoration == 8 (dqword) */
};
/* =====================================================
* GOASM Prefixes for MemoryType
* ===================================================== */
char GoAsmPrefixes[8][4] = {
"b ", /* GV.MemDecoration == 1 */
"w ", /* GV.MemDecoration == 2 */
"d ", /* GV.MemDecoration == 3 */
"q ", /* GV.MemDecoration == 4 */
" ", /* GV.MemDecoration == 5 (multibytes) */
"t ", /* GV.MemDecoration == 6 */
" ", /* GV.MemDecoration == 7 (fword) */
" ", /* GV.MemDecoration == 8 (dqword) */
};
/* =====================================================
* Segment registers
* ===================================================== */
char RegistersSEG[16][8] = {
"es", /* +0 */
"cs", /* +1 */
"ss", /* +2 */
"ds", /* +3 */
"fs", /* +4 */
"gs", /* +5 */
"seg?",
"seg?",
"seg?",
"seg?",
"seg?",
"seg?",
"seg?",
"seg?",
"seg?",
"seg?",
};
/* =====================================================
* FPU Registers
* ===================================================== */
char RegistersFPU_Masm[8][8] = {
"st(0)", /* +0 */
"st(1)", /* +1 */
"st(2)", /* +2 */
"st(3)", /* +3 */
"st(4)", /* +4 */
"st(5)", /* +5 */
"st(6)", /* +6 */
"st(7)", /* +7 */
};
char RegistersFPU_Nasm[8][8] = {
"st0", /* +0 */
"st1", /* +1 */
"st2", /* +2 */
"st3", /* +3 */
"st4", /* +4 */
"st5", /* +5 */
"st6", /* +6 */
"st7", /* +7 */
};
/* =====================================================
* debug registers
* ===================================================== */
char RegistersDR[16][8] = {
"dr0", /* +0 */
"dr1", /* +1 */
"dr2", /* +2 */
"dr3", /* +3 */
"dr4", /* +4 */
"dr5", /* +5 */
"dr6", /* +6 */
"dr7", /* +7 */
"dr8", /* +8 */
"dr9", /* +9 */
"dr10", /* +10 */
"dr11", /* +11 */
"dr12", /* +12 */
"dr13", /* +13 */
"dr14", /* +14 */
"dr15", /* +15 */
};
/* =====================================================
* debug registers-AT&T syntax
* ===================================================== */
char RegistersDR_AT[16][8] = {
"db0", /* +0 */
"db1", /* +1 */
"db2", /* +2 */
"db3", /* +3 */
"db4", /* +4 */
"db5", /* +5 */
"db6", /* +6 */
"db7", /* +7 */
"db8", /* +8 */
"db9", /* +9 */
"db10", /* +10 */
"db11", /* +11 */
"db12", /* +12 */
"db13", /* +13 */
"db14", /* +14 */
"db15", /* +15 */
};
/* =====================================================
* control registers
* ===================================================== */
char RegistersCR[16][8] = {
"cr0", /* +0 */
"cr1", /* +1 */
"cr2", /* +2 */
"cr3", /* +3 */
"cr4", /* +4 */
"cr5", /* +5 */
"cr6", /* +6 */
"cr7", /* +7 */
"cr8", /* +8 */
"cr9", /* +9 */
"cr10", /* +10 */
"cr11", /* +11 */
"cr12", /* +12 */
"cr13", /* +13 */
"cr14", /* +14 */
"cr15", /* +15 */
};
/* =====================================================
* 64 bits registers
* ===================================================== */
char Registers64Bits[16][4] = {
"rax", /* +0 */
"rcx", /* +1 */
"rdx", /* +2 */
"rbx", /* +3 */
"rsp", /* +4 */
"rbp", /* +5 */
"rsi", /* +6 */
"rdi", /* +7 */
"r8", /* +8 */
"r9", /* +9 */
"r10", /* +10 */
"r11", /* +11 */
"r12", /* +12 */
"r13", /* +13 */
"r14", /* +14 */
"r15", /* +15 */
};
/* =====================================================
* 32 bits registers
* ===================================================== */
char Registers32Bits[16][8] = {
"eax",
"ecx",
"edx",
"ebx",
"esp",
"ebp",
"esi",
"edi",
"r8d",
"r9d",
"r10d",
"r11d",
"r12d",
"r13d",
"r14d",
"r15d",
};
/* =====================================================
* 16 bits registers
* ===================================================== */
char Registers16Bits[16][8] = {
"ax",
"cx",
"dx",
"bx",
"sp",
"bp",
"si",
"di",
"r8w",
"r9w",
"r10w",
"r11w",
"r12w",
"r13w",
"r14w",
"r15w",
};
/* =====================================================
* 8 bits registers
* ===================================================== */
char Registers8BitsLegacy[8][4] = {
"al",
"cl",
"dl",
"bl",
"ah",
"ch",
"dh",
"bh",
};
Int32 REGS8BITS[] = {
REG0,
REG1,
REG2,
REG3,
REG0,
REG1,
REG2,
REG3,
};
/* =====================================================
* 8 bits registers
* ===================================================== */
char Registers8Bits[16][8] = {
"al",
"cl",
"dl",
"bl",
"spl",
"bpl",
"sil",
"dil",
"r8L",
"r9L",
"r10L",
"r11L",
"r12L",
"r13L",
"r14L",
"r15L",
};
/* =====================================================
* MMX Registers
* ===================================================== */
char RegistersMMX[8][4] = {
"mm0",
"mm1",
"mm2",
"mm3",
"mm4",
"mm5",
"mm6",
"mm7",
};
/* =====================================================
* SSE Registers
* ===================================================== */
char RegistersSSE[16][8] = {
"xmm0",
"xmm1",
"xmm2",
"xmm3",
"xmm4",
"xmm5",
"xmm6",
"xmm7",
"xmm8", /* SSE3, SSSE3, SSE4 */
"xmm9", /* SSE3, SSSE3, SSE4 */
"xmm10", /* SSE3, SSSE3, SSE4 */
"xmm11", /* SSE3, SSSE3, SSE4 */
"xmm12", /* SSE3, SSSE3, SSE4 */
"xmm13", /* SSE3, SSSE3, SSE4 */
"xmm14", /* SSE3, SSSE3, SSE4 */
"xmm15", /* SSE3, SSSE3, SSE4 */
};
Int32 REGS[] = {
REG0, /* REG0 */
REG1, /* REG1 */
REG2, /* REG2 */
REG3, /* REG3 */
REG4, /* REG4 */
REG5, /* REG5 */
REG6, /* REG6 */
REG7, /* REG7 */
REG8, /* REG8 */
REG9, /* REG9 */
REG10, /* REG10 */
REG11, /* REG11 */
REG12, /* REG12 */
REG13, /* REG13 */
REG14, /* REG14 */
REG15, /* REG15 */
};
char BXSI_[] = "bx+si";
char BXDI_[] = "bx+di";
char BPSI_[] = "bp+si";
char BPDI_[] = "bp+di";

View File

@ -0,0 +1,705 @@
/* Copyright 2006-2009, BeatriX
* File coded by BeatriX
*
* This file is part of BeaEngine.
*
* BeaEngine is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* BeaEngine is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with BeaEngine. If not, see <http://www.gnu.org/licenses/>. */
/* ====================================== Routines_MODRM */
void __bea_callspec__ MOD_RM(ARGTYPE*, PDISASM);
void __bea_callspec__ Reg_Opcode(ARGTYPE*, PDISASM);
void __bea_callspec__ Addr_EAX(ARGTYPE*, PDISASM);
void __bea_callspec__ Addr_ECX(ARGTYPE*, PDISASM);
void __bea_callspec__ Addr_EDX(ARGTYPE*, PDISASM);
void __bea_callspec__ Addr_EBX(ARGTYPE*, PDISASM);
void __bea_callspec__ Addr_SIB(ARGTYPE*, PDISASM);
void __bea_callspec__ Addr_disp32(ARGTYPE*, PDISASM);
void __bea_callspec__ Addr_ESI(ARGTYPE*, PDISASM);
void __bea_callspec__ Addr_EDI(ARGTYPE*, PDISASM);
void __bea_callspec__ Addr_EAX_disp8(ARGTYPE*, PDISASM);
void __bea_callspec__ Addr_ECX_disp8(ARGTYPE*, PDISASM);
void __bea_callspec__ Addr_EDX_disp8(ARGTYPE*, PDISASM);
void __bea_callspec__ Addr_EBX_disp8(ARGTYPE*, PDISASM);
void __bea_callspec__ Addr_SIB_disp8(ARGTYPE*, PDISASM);
void __bea_callspec__ Addr_EBP_disp8(ARGTYPE*, PDISASM);
void __bea_callspec__ Addr_ESI_disp8(ARGTYPE*, PDISASM);
void __bea_callspec__ Addr_EDI_disp8(ARGTYPE*, PDISASM);
void __bea_callspec__ Addr_EAX_disp32(ARGTYPE*, PDISASM);
void __bea_callspec__ Addr_ECX_disp32(ARGTYPE*, PDISASM);
void __bea_callspec__ Addr_EDX_disp32(ARGTYPE*, PDISASM);
void __bea_callspec__ Addr_EBX_disp32(ARGTYPE*, PDISASM);
void __bea_callspec__ Addr_SIB_disp32(ARGTYPE*, PDISASM);
void __bea_callspec__ Addr_EBP_disp32(ARGTYPE*, PDISASM);
void __bea_callspec__ Addr_ESI_disp32(ARGTYPE*, PDISASM);
void __bea_callspec__ Addr_EDI_disp32(ARGTYPE*, PDISASM);
void __bea_callspec__ _rEAX(ARGTYPE*, PDISASM);
void __bea_callspec__ _rECX(ARGTYPE*, PDISASM);
void __bea_callspec__ _rEDX(ARGTYPE*, PDISASM);
void __bea_callspec__ _rEBX(ARGTYPE*, PDISASM);
void __bea_callspec__ _rESP(ARGTYPE*, PDISASM);
void __bea_callspec__ _rEBP(ARGTYPE*, PDISASM);
void __bea_callspec__ _rESI(ARGTYPE*, PDISASM);
void __bea_callspec__ _rEDI(ARGTYPE*, PDISASM);
size_t __bea_callspec__ SIB_0(ARGTYPE*, size_t, PDISASM);
size_t __bea_callspec__ SIB_1(ARGTYPE*, size_t, PDISASM);
size_t __bea_callspec__ SIB_2(ARGTYPE*, size_t, PDISASM);
size_t __bea_callspec__ SIB_3(ARGTYPE*, size_t, PDISASM);
/* ====================================== Routines_Disasm */
void __bea_callspec__ CompleteInstructionFields (PDISASM);
void __bea_callspec__ EbGb(PDISASM);
void __bea_callspec__ EvGv(PDISASM);
void __bea_callspec__ EvIb(PDISASM);
void __bea_callspec__ ExGx(PDISASM);
void __bea_callspec__ EvIv(PDISASM);
void __bea_callspec__ EbIb(PDISASM);
void __bea_callspec__ Eb(PDISASM);
void __bea_callspec__ Ev(PDISASM);
void __bea_callspec__ GvEv(PDISASM);
void __bea_callspec__ GvEb(PDISASM);
void __bea_callspec__ GxEx(PDISASM);
void __bea_callspec__ GvEw(PDISASM);
void __bea_callspec__ GbEb(PDISASM);
void __bea_callspec__ ALIb(PDISASM);
void __bea_callspec__ eAX_Iv(PDISASM);
int __bea_callspec__ AnalyzeOpcode (PDISASM);
int __bea_callspec__ Security(int, PDISASM);
void __bea_callspec__ CalculateRelativeAddress(UInt64 *, Int64, PDISASM);
size_t __bea_callspec__ CopyFormattedNumber(PDISASM, char*, const char*, Int64);
void __bea_callspec__ BuildCompleteInstruction(PDISASM);
void __bea_callspec__ BuildCompleteInstructionATSyntax(PDISASM);
int __bea_callspec__ InitVariables (PDISASM);
void __bea_callspec__ FillFlags(PDISASM, int);
void __bea_callspec__ FillSegmentsRegisters (PDISASM);
void __bea_callspec__ FixArgSizeForMemoryOperand (PDISASM);
void __bea_callspec__ FixREXPrefixes (PDISASM);
/* ====================================== opcodes_prefix */
void __bea_callspec__ PrefLock(PDISASM);
void __bea_callspec__ PrefREPNE(PDISASM);
void __bea_callspec__ PrefREPE(PDISASM);
void __bea_callspec__ PrefSEGCS(PDISASM);
void __bea_callspec__ PrefSEGDS(PDISASM);
void __bea_callspec__ PrefSEGES(PDISASM);
void __bea_callspec__ PrefSEGFS(PDISASM);
void __bea_callspec__ PrefSEGGS(PDISASM);
void __bea_callspec__ PrefSEGSS(PDISASM);
void __bea_callspec__ PrefOpSize(PDISASM);
void __bea_callspec__ PrefAdSize(PDISASM);
void __bea_callspec__ Esc_2byte(PDISASM);
void __bea_callspec__ Esc_tableA4(PDISASM);
void __bea_callspec__ Esc_tableA5(PDISASM);
/* ====================================== opcodes_A_M */
void __bea_callspec__ FailDecode(PDISASM);
void __bea_callspec__ aaa_(PDISASM);
void __bea_callspec__ aad_(PDISASM);
void __bea_callspec__ aas_(PDISASM);
void __bea_callspec__ aam_(PDISASM);
void __bea_callspec__ add_EbGb(PDISASM);
void __bea_callspec__ add_EvGv(PDISASM);
void __bea_callspec__ add_GbEb(PDISASM);
void __bea_callspec__ add_GvEv(PDISASM);
void __bea_callspec__ add_ALIb(PDISASM);
void __bea_callspec__ add_eAX_Iv(PDISASM);
void __bea_callspec__ adc_ALIb(PDISASM);
void __bea_callspec__ adc_eAX_Iv(PDISASM);
void __bea_callspec__ adc_EbGb(PDISASM);
void __bea_callspec__ adc_EvGv(PDISASM);
void __bea_callspec__ adc_GbEb(PDISASM);
void __bea_callspec__ adc_GvEv(PDISASM);
void __bea_callspec__ and_EbGb(PDISASM);
void __bea_callspec__ and_ALIb(PDISASM);
void __bea_callspec__ and_eAX_Iv(PDISASM);
void __bea_callspec__ and_EvGv(PDISASM);
void __bea_callspec__ and_GbEb(PDISASM);
void __bea_callspec__ and_GvEv(PDISASM);
void __bea_callspec__ arpl_(PDISASM);
void __bea_callspec__ bound_(PDISASM);
void __bea_callspec__ bswap_eax(PDISASM);
void __bea_callspec__ bswap_ebp(PDISASM);
void __bea_callspec__ bswap_ebx(PDISASM);
void __bea_callspec__ bswap_ecx(PDISASM);
void __bea_callspec__ bswap_edi(PDISASM);
void __bea_callspec__ bswap_edx(PDISASM);
void __bea_callspec__ bswap_esi(PDISASM);
void __bea_callspec__ bswap_esp(PDISASM);
void __bea_callspec__ bsf_GvEv(PDISASM);
void __bea_callspec__ bsr_GvEv(PDISASM);
void __bea_callspec__ btc_EvGv(PDISASM);
void __bea_callspec__ btr_EvGv(PDISASM);
void __bea_callspec__ bt_EvGv(PDISASM);
void __bea_callspec__ bts_EvGv(PDISASM);
void __bea_callspec__ callf_(PDISASM);
void __bea_callspec__ call_(PDISASM);
void __bea_callspec__ cdq_(PDISASM);
void __bea_callspec__ clts_(PDISASM);
void __bea_callspec__ cmc_(PDISASM);
void __bea_callspec__ cmovo_(PDISASM);
void __bea_callspec__ cmovno_(PDISASM);
void __bea_callspec__ cmovb_(PDISASM);
void __bea_callspec__ cmovnb_(PDISASM);
void __bea_callspec__ cmove_(PDISASM);
void __bea_callspec__ cmovne_(PDISASM);
void __bea_callspec__ cmovbe_(PDISASM);
void __bea_callspec__ cmovnbe_(PDISASM);
void __bea_callspec__ cmovs_(PDISASM);
void __bea_callspec__ cmovns_(PDISASM);
void __bea_callspec__ cmovp_(PDISASM);
void __bea_callspec__ cmovnp_(PDISASM);
void __bea_callspec__ cmovl_(PDISASM);
void __bea_callspec__ cmovnl_(PDISASM);
void __bea_callspec__ cmovle_(PDISASM);
void __bea_callspec__ cmovnle_(PDISASM);
void __bea_callspec__ cmpx_EbGb(PDISASM);
void __bea_callspec__ cmpx_EvGv(PDISASM);
void __bea_callspec__ cmp_EbGb(PDISASM);
void __bea_callspec__ cmp_EvGv(PDISASM);
void __bea_callspec__ cmp_GbEb(PDISASM);
void __bea_callspec__ cmp_GvEv(PDISASM);
void __bea_callspec__ cmp_ALIb(PDISASM);
void __bea_callspec__ cmp_eAX_Iv(PDISASM);
void __bea_callspec__ cmpsb_(PDISASM);
void __bea_callspec__ cmps_(PDISASM);
void __bea_callspec__ cwde_(PDISASM);
void __bea_callspec__ clc_(PDISASM);
void __bea_callspec__ cld_(PDISASM);
void __bea_callspec__ cli_(PDISASM);
void __bea_callspec__ cpuid_(PDISASM);
void __bea_callspec__ daa_(PDISASM);
void __bea_callspec__ das_(PDISASM);
void __bea_callspec__ dec_eax(PDISASM);
void __bea_callspec__ dec_ecx(PDISASM);
void __bea_callspec__ dec_edx(PDISASM);
void __bea_callspec__ dec_ebx(PDISASM);
void __bea_callspec__ dec_esp(PDISASM);
void __bea_callspec__ dec_ebp(PDISASM);
void __bea_callspec__ dec_esi(PDISASM);
void __bea_callspec__ dec_edi(PDISASM);
void __bea_callspec__ enter_(PDISASM);
void __bea_callspec__ femms_(PDISASM);
void __bea_callspec__ hlt_(PDISASM);
void __bea_callspec__ invd_(PDISASM);
void __bea_callspec__ inc_eax(PDISASM);
void __bea_callspec__ inc_ecx(PDISASM);
void __bea_callspec__ inc_edx(PDISASM);
void __bea_callspec__ inc_ebx(PDISASM);
void __bea_callspec__ inc_esp(PDISASM);
void __bea_callspec__ inc_ebp(PDISASM);
void __bea_callspec__ inc_esi(PDISASM);
void __bea_callspec__ inc_edi(PDISASM);
void __bea_callspec__ iret_(PDISASM);
void __bea_callspec__ in_ALDX(PDISASM);
void __bea_callspec__ in_ALIb(PDISASM);
void __bea_callspec__ in_eAX_Ib(PDISASM);
void __bea_callspec__ insb_(PDISASM);
void __bea_callspec__ ins_(PDISASM);
void __bea_callspec__ into_(PDISASM);
void __bea_callspec__ in_eAX(PDISASM);
void __bea_callspec__ int_(PDISASM);
void __bea_callspec__ int1_(PDISASM);
void __bea_callspec__ int3_(PDISASM);
void __bea_callspec__ imul_GvEvIv(PDISASM);
void __bea_callspec__ imul_GvEv(PDISASM);
void __bea_callspec__ imul_GvEvIb(PDISASM);
void __bea_callspec__ jo_(PDISASM);
void __bea_callspec__ jno_(PDISASM);
void __bea_callspec__ jc_(PDISASM);
void __bea_callspec__ jnc_(PDISASM);
void __bea_callspec__ je_(PDISASM);
void __bea_callspec__ jne_(PDISASM);
void __bea_callspec__ jbe_(PDISASM);
void __bea_callspec__ jnbe_(PDISASM);
void __bea_callspec__ js_(PDISASM);
void __bea_callspec__ jns_(PDISASM);
void __bea_callspec__ jp_(PDISASM);
void __bea_callspec__ jnp_(PDISASM);
void __bea_callspec__ jl_(PDISASM);
void __bea_callspec__ jnl_(PDISASM);
void __bea_callspec__ jle_(PDISASM);
void __bea_callspec__ jnle_(PDISASM);
void __bea_callspec__ jo_near(PDISASM);
void __bea_callspec__ jno_near(PDISASM);
void __bea_callspec__ jc_near(PDISASM);
void __bea_callspec__ jnc_near(PDISASM);
void __bea_callspec__ je_near(PDISASM);
void __bea_callspec__ jne_near(PDISASM);
void __bea_callspec__ jbe_near(PDISASM);
void __bea_callspec__ ja_near(PDISASM);
void __bea_callspec__ js_near(PDISASM);
void __bea_callspec__ jns_near(PDISASM);
void __bea_callspec__ jp_near(PDISASM);
void __bea_callspec__ jnp_near(PDISASM);
void __bea_callspec__ jl_near(PDISASM);
void __bea_callspec__ jnl_near(PDISASM);
void __bea_callspec__ jle_near(PDISASM);
void __bea_callspec__ jnle_near(PDISASM);
void __bea_callspec__ jecxz_(PDISASM);
void __bea_callspec__ jmp_near(PDISASM);
void __bea_callspec__ jmp_far(PDISASM);
void __bea_callspec__ jmp_short(PDISASM);
void __bea_callspec__ lahf_(PDISASM);
void __bea_callspec__ lar_GvEw(PDISASM);
void __bea_callspec__ lds_GvM(PDISASM);
void __bea_callspec__ leave_(PDISASM);
void __bea_callspec__ lea_GvM(PDISASM);
void __bea_callspec__ les_GvM(PDISASM);
void __bea_callspec__ lodsb_(PDISASM);
void __bea_callspec__ lodsw_(PDISASM);
void __bea_callspec__ loop_(PDISASM);
void __bea_callspec__ loope_(PDISASM);
void __bea_callspec__ loopne_(PDISASM);
void __bea_callspec__ lsl_GvEw(PDISASM);
void __bea_callspec__ lss_Mp(PDISASM);
void __bea_callspec__ lfs_Mp(PDISASM);
void __bea_callspec__ lgs_Mp(PDISASM);
void __bea_callspec__ mov_RdCd(PDISASM);
void __bea_callspec__ mov_RdDd(PDISASM);
void __bea_callspec__ mov_CdRd(PDISASM);
void __bea_callspec__ mov_DdRd(PDISASM);
void __bea_callspec__ mov_EbGb(PDISASM);
void __bea_callspec__ mov_EvGv(PDISASM);
void __bea_callspec__ mov_GbEb(PDISASM);
void __bea_callspec__ mov_GvEv(PDISASM);
void __bea_callspec__ mov_ALOb(PDISASM);
void __bea_callspec__ mov_eAXOv(PDISASM);
void __bea_callspec__ mov_ObAL(PDISASM);
void __bea_callspec__ mov_OveAX(PDISASM);
void __bea_callspec__ mov_ALIb(PDISASM);
void __bea_callspec__ mov_CLIb(PDISASM);
void __bea_callspec__ mov_DLIb(PDISASM);
void __bea_callspec__ mov_BLIb(PDISASM);
void __bea_callspec__ mov_AHIb(PDISASM);
void __bea_callspec__ mov_CHIb(PDISASM);
void __bea_callspec__ mov_DHIb(PDISASM);
void __bea_callspec__ mov_BHIb(PDISASM);
void __bea_callspec__ movs_(PDISASM);
void __bea_callspec__ movsw_(PDISASM);
void __bea_callspec__ movzx_GvEb(PDISASM);
void __bea_callspec__ movsx_GvEb(PDISASM);
void __bea_callspec__ movzx_GvEw(PDISASM);
void __bea_callspec__ movsx_GvEw(PDISASM);
void __bea_callspec__ mov_EAX(PDISASM);
void __bea_callspec__ mov_ECX(PDISASM);
void __bea_callspec__ mov_EDX(PDISASM);
void __bea_callspec__ mov_EBX(PDISASM);
void __bea_callspec__ mov_ESP(PDISASM);
void __bea_callspec__ mov_EBP(PDISASM);
void __bea_callspec__ mov_ESI(PDISASM);
void __bea_callspec__ mov_EDI(PDISASM);
void __bea_callspec__ mov_EbIb(PDISASM);
void __bea_callspec__ mov_EvIv(PDISASM);
void __bea_callspec__ mov_EwSreg(PDISASM);
void __bea_callspec__ mov_SregEw(PDISASM);
/* ====================================== opcodes_N_Z */
void __bea_callspec__ nop_(PDISASM);
void __bea_callspec__ nop_Ev(PDISASM);
void __bea_callspec__ hint_nop(PDISASM);
void __bea_callspec__ or_EbGb(PDISASM);
void __bea_callspec__ or_EvGv(PDISASM);
void __bea_callspec__ or_GbEb(PDISASM);
void __bea_callspec__ or_GvEv(PDISASM);
void __bea_callspec__ or_ALIb(PDISASM);
void __bea_callspec__ or_eAX_Iv(PDISASM);
void __bea_callspec__ outsb_(PDISASM);
void __bea_callspec__ outsw_(PDISASM);
void __bea_callspec__ out_IbAL(PDISASM);
void __bea_callspec__ out_Ib_eAX(PDISASM);
void __bea_callspec__ out_DXAL(PDISASM);
void __bea_callspec__ out_DXeAX(PDISASM);
void __bea_callspec__ pop_Ev(PDISASM);
void __bea_callspec__ pop_eax(PDISASM);
void __bea_callspec__ pop_ecx(PDISASM);
void __bea_callspec__ pop_edx(PDISASM);
void __bea_callspec__ pop_ebx(PDISASM);
void __bea_callspec__ pop_esp(PDISASM);
void __bea_callspec__ pop_ebp(PDISASM);
void __bea_callspec__ pop_esi(PDISASM);
void __bea_callspec__ pop_edi(PDISASM);
void __bea_callspec__ pop_ds(PDISASM);
void __bea_callspec__ pop_es(PDISASM);
void __bea_callspec__ pop_fs(PDISASM);
void __bea_callspec__ pop_gs(PDISASM);
void __bea_callspec__ pop_ss(PDISASM);
void __bea_callspec__ popfd_(PDISASM);
void __bea_callspec__ popad_(PDISASM);
void __bea_callspec__ push_eax(PDISASM);
void __bea_callspec__ push_ecx(PDISASM);
void __bea_callspec__ push_edx(PDISASM);
void __bea_callspec__ push_ebx(PDISASM);
void __bea_callspec__ push_esp(PDISASM);
void __bea_callspec__ push_ebp(PDISASM);
void __bea_callspec__ push_esi(PDISASM);
void __bea_callspec__ push_edi(PDISASM);
void __bea_callspec__ push_cs(PDISASM);
void __bea_callspec__ push_ds(PDISASM);
void __bea_callspec__ push_es(PDISASM);
void __bea_callspec__ push_fs(PDISASM);
void __bea_callspec__ push_gs(PDISASM);
void __bea_callspec__ push_ss(PDISASM);
void __bea_callspec__ pushfd_(PDISASM);
void __bea_callspec__ pushad_(PDISASM);
void __bea_callspec__ push_Iv(PDISASM);
void __bea_callspec__ push_Ib(PDISASM);
void __bea_callspec__ pushfd_(PDISASM);
void __bea_callspec__ pushad_(PDISASM);
void __bea_callspec__ retn_(PDISASM);
void __bea_callspec__ ret_(PDISASM);
void __bea_callspec__ retf_(PDISASM);
void __bea_callspec__ retf_Iw(PDISASM);
void __bea_callspec__ rdtsc_(PDISASM);
void __bea_callspec__ rdmsr_(PDISASM);
void __bea_callspec__ rdpmc_(PDISASM);
void __bea_callspec__ rsm_(PDISASM);
void __bea_callspec__ sysenter_(PDISASM);
void __bea_callspec__ sysexit_(PDISASM);
void __bea_callspec__ sahf_(PDISASM);
void __bea_callspec__ salc_(PDISASM);
void __bea_callspec__ scasb_(PDISASM);
void __bea_callspec__ scas_(PDISASM);
void __bea_callspec__ stc_(PDISASM);
void __bea_callspec__ sti_(PDISASM);
void __bea_callspec__ stos_(PDISASM);
void __bea_callspec__ stosw_(PDISASM);
void __bea_callspec__ syscall_(PDISASM);
void __bea_callspec__ sysret_(PDISASM);
void __bea_callspec__ sbb_EbGb(PDISASM);
void __bea_callspec__ sbb_EvGv(PDISASM);
void __bea_callspec__ sbb_GbEb(PDISASM);
void __bea_callspec__ sbb_GvEv(PDISASM);
void __bea_callspec__ sbb_ALIb(PDISASM);
void __bea_callspec__ sbb_eAX_Iv(PDISASM);
void __bea_callspec__ seto_(PDISASM);
void __bea_callspec__ setno_(PDISASM);
void __bea_callspec__ setb_(PDISASM);
void __bea_callspec__ setnb_(PDISASM);
void __bea_callspec__ sete_(PDISASM);
void __bea_callspec__ setne_(PDISASM);
void __bea_callspec__ setbe_(PDISASM);
void __bea_callspec__ setnbe_(PDISASM);
void __bea_callspec__ sets_(PDISASM);
void __bea_callspec__ setns_(PDISASM);
void __bea_callspec__ setp_(PDISASM);
void __bea_callspec__ setnp_(PDISASM);
void __bea_callspec__ setnge_(PDISASM);
void __bea_callspec__ setge_(PDISASM);
void __bea_callspec__ setle_(PDISASM);
void __bea_callspec__ setnle_(PDISASM);
void __bea_callspec__ shld_EvGvIb(PDISASM);
void __bea_callspec__ shld_EvGvCL(PDISASM);
void __bea_callspec__ shrd_EvGvIb(PDISASM);
void __bea_callspec__ shrd_EvGvCL(PDISASM);
void __bea_callspec__ std_(PDISASM);
void __bea_callspec__ sub_ALIb(PDISASM);
void __bea_callspec__ sub_eAX_Iv(PDISASM);
void __bea_callspec__ sub_EbGb(PDISASM);
void __bea_callspec__ sub_EvGv(PDISASM);
void __bea_callspec__ sub_GbEb(PDISASM);
void __bea_callspec__ sub_GvEv(PDISASM);
void __bea_callspec__ test_ALIb(PDISASM);
void __bea_callspec__ test_eAX_Iv(PDISASM);
void __bea_callspec__ test_EbGb(PDISASM);
void __bea_callspec__ test_EvGv(PDISASM);
void __bea_callspec__ test_GbEb(PDISASM);
void __bea_callspec__ test_GvEv(PDISASM);
void __bea_callspec__ ud2_(PDISASM);
void __bea_callspec__ vmread_(PDISASM);
void __bea_callspec__ vmwrite_(PDISASM);
void __bea_callspec__ wbinvd_(PDISASM);
void __bea_callspec__ wait_(PDISASM);
void __bea_callspec__ wrmsr_(PDISASM);
void __bea_callspec__ xadd_EbGb(PDISASM);
void __bea_callspec__ xadd_EvGv(PDISASM);
void __bea_callspec__ xchg_EbGb(PDISASM);
void __bea_callspec__ xchg_ebp(PDISASM);
void __bea_callspec__ xchg_ebx(PDISASM);
void __bea_callspec__ xchg_ecx(PDISASM);
void __bea_callspec__ xchg_edi(PDISASM);
void __bea_callspec__ xchg_edx(PDISASM);
void __bea_callspec__ xchg_esi(PDISASM);
void __bea_callspec__ xchg_esp(PDISASM);
void __bea_callspec__ xchg_EvGv(PDISASM);
void __bea_callspec__ xlat_(PDISASM);
void __bea_callspec__ xor_ALIb(PDISASM);
void __bea_callspec__ xor_eAX_Iv(PDISASM);
void __bea_callspec__ xor_EbGb(PDISASM);
void __bea_callspec__ xor_EvGv(PDISASM);
void __bea_callspec__ xor_GbEb(PDISASM);
void __bea_callspec__ xor_GvEv(PDISASM);
/* ====================================== opcodes_Grp1 */
void __bea_callspec__ G1_EbIb(PDISASM);
void __bea_callspec__ G1_EbIb2(PDISASM);
void __bea_callspec__ G1_EvIv(PDISASM);
void __bea_callspec__ G1_EvIb(PDISASM);
/* ====================================== opcodes_Grp2 */
void __bea_callspec__ G2_EbIb(PDISASM);
void __bea_callspec__ G2_EvIb(PDISASM);
void __bea_callspec__ G2_Ev1(PDISASM);
void __bea_callspec__ G2_Eb1(PDISASM);
void __bea_callspec__ G2_EbCL(PDISASM);
void __bea_callspec__ G2_EvCL(PDISASM);
/* ====================================== opcodes_Grp3 */
void __bea_callspec__ G3_Eb(PDISASM);
void __bea_callspec__ G3_Ev(PDISASM);
/* ====================================== opcodes_Grp4 */
void __bea_callspec__ G4_Eb(PDISASM);
/* ====================================== opcodes_Grp5 */
void __bea_callspec__ G5_Ev(PDISASM);
/* ====================================== opcodes_Grp6 */
void __bea_callspec__ G6_(PDISASM);
/* ====================================== opcodes_Grp7 */
void __bea_callspec__ G7_(PDISASM);
/* ====================================== opcodes_Grp8 */
void __bea_callspec__ G8_EvIb(PDISASM);
/* ====================================== opcodes_Grp9 */
void __bea_callspec__ G9_(PDISASM);
/* ====================================== opcodes_Grp12 */
void __bea_callspec__ G12_(PDISASM);
/* ====================================== opcodes_Grp13 */
void __bea_callspec__ G13_(PDISASM);
/* ====================================== opcodes_Grp14 */
void __bea_callspec__ G14_(PDISASM);
/* ====================================== opcodes_Grp15 */
void __bea_callspec__ G15_(PDISASM);
/* ====================================== opcodes_Grp16 */
void __bea_callspec__ G16_(PDISASM);
/* ====================================== opcodes_FPU */
void __bea_callspec__ D8_(PDISASM);
void __bea_callspec__ D9_(PDISASM);
void __bea_callspec__ DA_(PDISASM);
void __bea_callspec__ DB_(PDISASM);
void __bea_callspec__ DC_(PDISASM);
void __bea_callspec__ DD_(PDISASM);
void __bea_callspec__ DE_(PDISASM);
void __bea_callspec__ DF_(PDISASM);
/* ====================================== opcodes_MMX */
void __bea_callspec__ emms_(PDISASM);
void __bea_callspec__ movd_EP(PDISASM);
void __bea_callspec__ movd_PE(PDISASM);
void __bea_callspec__ movq_PQ(PDISASM);
void __bea_callspec__ movq_QP(PDISASM);
void __bea_callspec__ movq_WV(PDISASM);
void __bea_callspec__ pabsb_(PDISASM);
void __bea_callspec__ pabsd_(PDISASM);
void __bea_callspec__ pabsw_(PDISASM);
void __bea_callspec__ packssdw_(PDISASM);
void __bea_callspec__ packsswb_(PDISASM);
void __bea_callspec__ packuswb_(PDISASM);
void __bea_callspec__ paddb_(PDISASM);
void __bea_callspec__ paddd_(PDISASM);
void __bea_callspec__ paddsb_(PDISASM);
void __bea_callspec__ paddsw_(PDISASM);
void __bea_callspec__ paddusb_(PDISASM);
void __bea_callspec__ paddusw_(PDISASM);
void __bea_callspec__ paddw_(PDISASM);
void __bea_callspec__ pandn_(PDISASM);
void __bea_callspec__ pand_(PDISASM);
void __bea_callspec__ pcmpeqb_(PDISASM);
void __bea_callspec__ pcmpeqd_(PDISASM);
void __bea_callspec__ pcmpeqw_(PDISASM);
void __bea_callspec__ pcmpgtb_(PDISASM);
void __bea_callspec__ pcmpgtd_(PDISASM);
void __bea_callspec__ pcmpgtw_(PDISASM);
void __bea_callspec__ pmulhw_(PDISASM);
void __bea_callspec__ pmullw_(PDISASM);
void __bea_callspec__ pmaddwd_(PDISASM);
void __bea_callspec__ por_(PDISASM);
void __bea_callspec__ pslld_(PDISASM);
void __bea_callspec__ psllq_(PDISASM);
void __bea_callspec__ psllw_(PDISASM);
void __bea_callspec__ psrld_(PDISASM);
void __bea_callspec__ psrlq_(PDISASM);
void __bea_callspec__ psrlw_(PDISASM);
void __bea_callspec__ psrad_(PDISASM);
void __bea_callspec__ psraw_(PDISASM);
void __bea_callspec__ psubb_(PDISASM);
void __bea_callspec__ psubd_(PDISASM);
void __bea_callspec__ psubsb_(PDISASM);
void __bea_callspec__ psubsw_(PDISASM);
void __bea_callspec__ psubusb_(PDISASM);
void __bea_callspec__ psubusw_(PDISASM);
void __bea_callspec__ psubw_(PDISASM);
void __bea_callspec__ punpckhbw_(PDISASM);
void __bea_callspec__ punpckhdq_(PDISASM);
void __bea_callspec__ punpckhwd_(PDISASM);
void __bea_callspec__ punpcklbw_(PDISASM);
void __bea_callspec__ punpckldq_(PDISASM);
void __bea_callspec__ punpcklwd_(PDISASM);
void __bea_callspec__ pxor_(PDISASM);
/* ====================================== opcodes_SSE */
void __bea_callspec__ addps_VW(PDISASM);
void __bea_callspec__ addsubpd_(PDISASM);
void __bea_callspec__ andnps_VW(PDISASM);
void __bea_callspec__ andps_VW(PDISASM);
void __bea_callspec__ blendpd_(PDISASM);
void __bea_callspec__ blendps_(PDISASM);
void __bea_callspec__ blendvpd_(PDISASM);
void __bea_callspec__ blendvps_(PDISASM);
void __bea_callspec__ cmpps_VW(PDISASM);
void __bea_callspec__ crc32_GvEb(PDISASM);
void __bea_callspec__ crc32_GvEv(PDISASM);
void __bea_callspec__ comiss_VW(PDISASM);
void __bea_callspec__ cvtdq2ps_(PDISASM);
void __bea_callspec__ cvtpd2dq_(PDISASM);
void __bea_callspec__ cvtpi2ps_(PDISASM);
void __bea_callspec__ cvtps2pd_(PDISASM);
void __bea_callspec__ cvtps2pi_(PDISASM);
void __bea_callspec__ cvttps2pi_(PDISASM);
void __bea_callspec__ dppd_(PDISASM);
void __bea_callspec__ dpps_(PDISASM);
void __bea_callspec__ divps_VW(PDISASM);
void __bea_callspec__ extractps_(PDISASM);
void __bea_callspec__ haddpd_VW(PDISASM);
void __bea_callspec__ hsubpd_VW(PDISASM);
void __bea_callspec__ insertps_(PDISASM);
void __bea_callspec__ lddqu_(PDISASM);
void __bea_callspec__ maskmovq_(PDISASM);
void __bea_callspec__ maxps_VW(PDISASM);
void __bea_callspec__ minps_VW(PDISASM);
void __bea_callspec__ movaps_VW(PDISASM);
void __bea_callspec__ movaps_WV(PDISASM);
void __bea_callspec__ movhps_MV(PDISASM);
void __bea_callspec__ movhps_VM(PDISASM);
void __bea_callspec__ movlps_MV(PDISASM);
void __bea_callspec__ movlps_VM(PDISASM);
void __bea_callspec__ movmskps_(PDISASM);
void __bea_callspec__ movntdqa_(PDISASM);
void __bea_callspec__ movnti_(PDISASM);
void __bea_callspec__ movntps_(PDISASM);
void __bea_callspec__ movntq_(PDISASM);
void __bea_callspec__ movups_VW(PDISASM);
void __bea_callspec__ movups_WV(PDISASM);
void __bea_callspec__ mpsadbw_(PDISASM);
void __bea_callspec__ mulps_VW(PDISASM);
void __bea_callspec__ orps_VW(PDISASM);
void __bea_callspec__ packusdw_(PDISASM);
void __bea_callspec__ paddq_(PDISASM);
void __bea_callspec__ pavgb_(PDISASM);
void __bea_callspec__ pavgw_(PDISASM);
void __bea_callspec__ palignr_(PDISASM);
void __bea_callspec__ pblendvb_(PDISASM);
void __bea_callspec__ pblendw_(PDISASM);
void __bea_callspec__ pcmpeqq_(PDISASM);
void __bea_callspec__ pcmpestri_(PDISASM);
void __bea_callspec__ pcmpestrm_(PDISASM);
void __bea_callspec__ pcmpgtq_(PDISASM);
void __bea_callspec__ pcmpistri_(PDISASM);
void __bea_callspec__ pcmpistrm_(PDISASM);
void __bea_callspec__ pextrb_(PDISASM);
void __bea_callspec__ pextrd_(PDISASM);
void __bea_callspec__ pextrw2_(PDISASM);
void __bea_callspec__ pextrw_(PDISASM);
void __bea_callspec__ phaddd_(PDISASM);
void __bea_callspec__ phaddsw_(PDISASM);
void __bea_callspec__ phaddw_(PDISASM);
void __bea_callspec__ phminposuw_(PDISASM);
void __bea_callspec__ phsubd_(PDISASM);
void __bea_callspec__ phsubsw_(PDISASM);
void __bea_callspec__ phsubw_(PDISASM);
void __bea_callspec__ pinsrb_(PDISASM);
void __bea_callspec__ pinsrd_(PDISASM);
void __bea_callspec__ pinsrw_(PDISASM);
void __bea_callspec__ pmaxsb_(PDISASM);
void __bea_callspec__ pmaxsd_(PDISASM);
void __bea_callspec__ pmaxsw_(PDISASM);
void __bea_callspec__ pmaxub_(PDISASM);
void __bea_callspec__ pmaxud_(PDISASM);
void __bea_callspec__ pmaxuw_(PDISASM);
void __bea_callspec__ pminsb_(PDISASM);
void __bea_callspec__ pminsd_(PDISASM);
void __bea_callspec__ pminsw_(PDISASM);
void __bea_callspec__ pminub_(PDISASM);
void __bea_callspec__ pminud_(PDISASM);
void __bea_callspec__ pminuw_(PDISASM);
void __bea_callspec__ pmaddubsw_(PDISASM);
void __bea_callspec__ pmovmskb_(PDISASM);
void __bea_callspec__ pmovsxbd_(PDISASM);
void __bea_callspec__ pmovsxbq_(PDISASM);
void __bea_callspec__ pmovsxbw_(PDISASM);
void __bea_callspec__ pmovsxdq_(PDISASM);
void __bea_callspec__ pmovsxwd_(PDISASM);
void __bea_callspec__ pmovsxwq_(PDISASM);
void __bea_callspec__ pmovzxbd_(PDISASM);
void __bea_callspec__ pmovzxbq_(PDISASM);
void __bea_callspec__ pmovzxbw_(PDISASM);
void __bea_callspec__ pmovzxdq_(PDISASM);
void __bea_callspec__ pmovzxwd_(PDISASM);
void __bea_callspec__ pmovzxwq_(PDISASM);
void __bea_callspec__ pmuldq_(PDISASM);
void __bea_callspec__ pmulhrsw_(PDISASM);
void __bea_callspec__ pmulhuw_(PDISASM);
void __bea_callspec__ pmulhw_(PDISASM);
void __bea_callspec__ pmulld_(PDISASM);
void __bea_callspec__ pmullw_(PDISASM);
void __bea_callspec__ pmuludq_(PDISASM);
void __bea_callspec__ popcnt_(PDISASM);
void __bea_callspec__ psadbw_(PDISASM);
void __bea_callspec__ pshufb_(PDISASM);
void __bea_callspec__ pshufw_(PDISASM);
void __bea_callspec__ psignb_(PDISASM);
void __bea_callspec__ psignd_(PDISASM);
void __bea_callspec__ psignw_(PDISASM);
void __bea_callspec__ psubq_(PDISASM);
void __bea_callspec__ ptest_(PDISASM);
void __bea_callspec__ punpcklqdq_(PDISASM);
void __bea_callspec__ punpckhqdq_(PDISASM);
void __bea_callspec__ rcpps_(PDISASM);
void __bea_callspec__ roundpd_(PDISASM);
void __bea_callspec__ roundps_(PDISASM);
void __bea_callspec__ roundsd_(PDISASM);
void __bea_callspec__ roundss_(PDISASM);
void __bea_callspec__ rsqrtps_(PDISASM);
void __bea_callspec__ shufps_(PDISASM);
void __bea_callspec__ sqrtps_VW(PDISASM);
void __bea_callspec__ subps_VW(PDISASM);
void __bea_callspec__ ucomiss_VW(PDISASM);
void __bea_callspec__ unpckhps_(PDISASM);
void __bea_callspec__ unpcklps_(PDISASM);
void __bea_callspec__ xorps_VW(PDISASM);
/* ====================================== opcodes_AES */
void __bea_callspec__ aesimc(PDISASM);
void __bea_callspec__ aesdec(PDISASM);
void __bea_callspec__ aesdeclast(PDISASM);
void __bea_callspec__ aesenc(PDISASM);
void __bea_callspec__ aesenclast(PDISASM);
void __bea_callspec__ aeskeygen(PDISASM);
/* ====================================== opcodes_CLMUL */
void __bea_callspec__ pclmulqdq_(PDISASM);

View File

@ -0,0 +1,30 @@
; ========================================
;
; BeaEngine 4
;
; ========================================
1) LICENSE
==========
This software is distributed under the LGPL license.
See the COPYING and COPYING.LESSER files for more details.
2) ONLINE DOCUMENTATION
=======================
For online documentation, visit :
http://www.beaengine.org
3) AUTHOR, CONTRIBUTORS, BETA-TESTERS
==========================================
BeatriX - Author (France) : beaengine (at) gmail.com
Igor Gutnik - Developer (ported the project on linux)
Contributors :
andrewl, bax, William Pomian, Ange Albertini, Pyrae, Vincent Roy, Kharneth, Eedy, Neitsa, KumaT, Rafal Cyran, 29a metal, sessiondiy, Tim, vince, Igor Gutnik, ouadji, Helle, Baboon, pop9080, ktion23.

View File

@ -0,0 +1,362 @@
#ifndef _BEA_ENGINE_
#define _BEA_ENGINE_
#if defined(__cplusplus) && defined(__BORLANDC__)
namespace BeaEngine {
#endif
#include <beaengine/macros.h>
#include <beaengine/export.h>
#include <beaengine/basic_types.h>
#if !defined(BEA_ENGINE_STATIC)
#if defined(BUILD_BEA_ENGINE_DLL)
#define BEA_API bea__api_export__
#else
#define BEA_API bea__api_import__
#endif
#else
#define BEA_API
#endif
#define INSTRUCT_LENGTH 64
#pragma pack(1)
typedef struct {
UInt8 W_;
UInt8 R_;
UInt8 X_;
UInt8 B_;
UInt8 state;
} REX_Struct ;
#pragma pack()
#pragma pack(1)
typedef struct {
int Number;
int NbUndefined;
UInt8 LockPrefix;
UInt8 OperandSize;
UInt8 AddressSize;
UInt8 RepnePrefix;
UInt8 RepPrefix;
UInt8 FSPrefix;
UInt8 SSPrefix;
UInt8 GSPrefix;
UInt8 ESPrefix;
UInt8 CSPrefix;
UInt8 DSPrefix;
UInt8 BranchTaken;
UInt8 BranchNotTaken;
REX_Struct REX;
char alignment[2];
} PREFIXINFO ;
#pragma pack()
#pragma pack(1)
typedef struct {
UInt8 OF_;
UInt8 SF_;
UInt8 ZF_;
UInt8 AF_;
UInt8 PF_;
UInt8 CF_;
UInt8 TF_;
UInt8 IF_;
UInt8 DF_;
UInt8 NT_;
UInt8 RF_;
UInt8 alignment;
} EFLStruct ;
#pragma pack()
#pragma pack(4)
typedef struct {
Int32 BaseRegister;
Int32 IndexRegister;
Int32 Scale;
Int64 Displacement;
} MEMORYTYPE ;
#pragma pack()
#pragma pack(1)
typedef struct {
Int32 Category;
Int32 Opcode;
char Mnemonic[16];
Int32 BranchType;
EFLStruct Flags;
UInt64 AddrValue;
Int64 Immediat;
UInt32 ImplicitModifiedRegs;
} INSTRTYPE;
#pragma pack()
#pragma pack(1)
typedef struct {
char ArgMnemonic[64];
Int32 ArgType;
Int32 ArgSize;
Int32 ArgPosition;
UInt32 AccessMode;
MEMORYTYPE Memory;
UInt32 SegmentReg;
} ARGTYPE;
#pragma pack()
/* reserved structure used for thread-safety */
/* unusable by customer */
#pragma pack(1)
typedef struct {
UIntPtr EIP_;
UInt64 EIP_VA;
UIntPtr EIP_REAL;
Int32 OriginalOperandSize;
Int32 OperandSize;
Int32 MemDecoration;
Int32 AddressSize;
Int32 MOD_;
Int32 RM_;
Int32 INDEX_;
Int32 SCALE_;
Int32 BASE_;
Int32 MMX_;
Int32 SSE_;
Int32 CR_;
Int32 DR_;
Int32 SEG_;
Int32 REGOPCODE;
UInt32 DECALAGE_EIP;
Int32 FORMATNUMBER;
Int32 SYNTAX_;
UInt64 EndOfBlock;
Int32 RelativeAddress;
UInt32 Architecture;
Int32 ImmediatSize;
Int32 NB_PREFIX;
Int32 PrefRepe;
Int32 PrefRepne;
UInt32 SEGMENTREGS;
UInt32 SEGMENTFS;
Int32 third_arg;
Int32 TAB_;
Int32 ERROR_OPCODE;
REX_Struct REX;
Int32 OutOfBlock;
} InternalDatas;
#pragma pack()
/* ************** main structure ************ */
#pragma pack(1)
typedef struct _Disasm {
UIntPtr EIP;
UInt64 VirtualAddr;
UInt32 SecurityBlock;
char CompleteInstr[INSTRUCT_LENGTH];
UInt32 Archi;
UInt64 Options;
INSTRTYPE Instruction;
ARGTYPE Argument1;
ARGTYPE Argument2;
ARGTYPE Argument3;
PREFIXINFO Prefix;
InternalDatas Reserved_;
} DISASM, *PDISASM, *LPDISASM;
#pragma pack()
#define ESReg 1
#define DSReg 2
#define FSReg 3
#define GSReg 4
#define CSReg 5
#define SSReg 6
#define InvalidPrefix 4
#define SuperfluousPrefix 2
#define NotUsedPrefix 0
#define MandatoryPrefix 8
#define InUsePrefix 1
#define LowPosition 0
#define HighPosition 1
enum INSTRUCTION_TYPE
{
GENERAL_PURPOSE_INSTRUCTION = 0x10000,
FPU_INSTRUCTION = 0x20000,
MMX_INSTRUCTION = 0x40000,
SSE_INSTRUCTION = 0x80000,
SSE2_INSTRUCTION = 0x100000,
SSE3_INSTRUCTION = 0x200000,
SSSE3_INSTRUCTION = 0x400000,
SSE41_INSTRUCTION = 0x800000,
SSE42_INSTRUCTION = 0x1000000,
SYSTEM_INSTRUCTION = 0x2000000,
VM_INSTRUCTION = 0x4000000,
UNDOCUMENTED_INSTRUCTION = 0x8000000,
AMD_INSTRUCTION = 0x10000000,
ILLEGAL_INSTRUCTION = 0x20000000,
AES_INSTRUCTION = 0x40000000,
CLMUL_INSTRUCTION = (int)0x80000000,
DATA_TRANSFER = 0x1,
ARITHMETIC_INSTRUCTION,
LOGICAL_INSTRUCTION,
SHIFT_ROTATE,
BIT_UInt8,
CONTROL_TRANSFER,
STRING_INSTRUCTION,
InOutINSTRUCTION,
ENTER_LEAVE_INSTRUCTION,
FLAG_CONTROL_INSTRUCTION,
SEGMENT_REGISTER,
MISCELLANEOUS_INSTRUCTION,
COMPARISON_INSTRUCTION,
LOGARITHMIC_INSTRUCTION,
TRIGONOMETRIC_INSTRUCTION,
UNSUPPORTED_INSTRUCTION,
LOAD_CONSTANTS,
FPUCONTROL,
STATE_MANAGEMENT,
CONVERSION_INSTRUCTION,
SHUFFLE_UNPACK,
PACKED_SINGLE_PRECISION,
SIMD128bits,
SIMD64bits,
CACHEABILITY_CONTROL,
FP_INTEGER_CONVERSION,
SPECIALIZED_128bits,
SIMD_FP_PACKED,
SIMD_FP_HORIZONTAL ,
AGENT_SYNCHRONISATION,
PACKED_ALIGN_RIGHT ,
PACKED_SIGN,
PACKED_BLENDING_INSTRUCTION,
PACKED_TEST,
PACKED_MINMAX,
HORIZONTAL_SEARCH,
PACKED_EQUALITY,
STREAMING_LOAD,
INSERTION_EXTRACTION,
DOT_PRODUCT,
SAD_INSTRUCTION,
ACCELERATOR_INSTRUCTION, /* crc32, popcnt (sse4.2) */
ROUND_INSTRUCTION
};
enum EFLAGS_STATES
{
TE_ = 1,
MO_ = 2,
RE_ = 4,
SE_ = 8,
UN_ = 0x10,
PR_ = 0x20
};
enum BRANCH_TYPE
{
JO = 1,
JC = 2,
JE = 3,
JA = 4,
JS = 5,
JP = 6,
JL = 7,
JG = 8,
JB = 2, // JC == JB
JECXZ = 10,
JmpType = 11,
CallType = 12,
RetType = 13,
JNO = -1,
JNC = -2,
JNE = -3,
JNA = -4,
JNS = -5,
JNP = -6,
JNL = -7,
JNG = -8,
JNB = -2 // JNC == JNB
};
enum ARGUMENTS_TYPE
{
NO_ARGUMENT = 0x10000000,
REGISTER_TYPE = 0x20000000,
MEMORY_TYPE = 0x40000000,
CONSTANT_TYPE = (int)0x80000000,
MMX_REG = 0x10000,
GENERAL_REG = 0x20000,
FPU_REG = 0x40000,
SSE_REG = 0x80000,
CR_REG = 0x100000,
DR_REG = 0x200000,
SPECIAL_REG = 0x400000,
MEMORY_MANAGEMENT_REG = 0x800000,
SEGMENT_REG = 0x1000000,
RELATIVE_ = 0x4000000,
ABSOLUTE_ = 0x8000000,
READ = 0x1,
WRITE = 0x2,
REG0 = 0x1,
REG1 = 0x2,
REG2 = 0x4,
REG3 = 0x8,
REG4 = 0x10,
REG5 = 0x20,
REG6 = 0x40,
REG7 = 0x80,
REG8 = 0x100,
REG9 = 0x200,
REG10 = 0x400,
REG11 = 0x800,
REG12 = 0x1000,
REG13 = 0x2000,
REG14 = 0x4000,
REG15 = 0x8000
};
enum SPECIAL_INFO
{
UNKNOWN_OPCODE = -1,
OUT_OF_BLOCK = 0,
/* === mask = 0xff */
NoTabulation = 0x00000000,
Tabulation = 0x00000001,
/* === mask = 0xff00 */
MasmSyntax = 0x00000000,
GoAsmSyntax = 0x00000100,
NasmSyntax = 0x00000200,
ATSyntax = 0x00000400,
/* === mask = 0xff0000 */
PrefixedNumeral = 0x00010000,
SuffixedNumeral = 0x00000000,
/* === mask = 0xff000000 */
ShowSegmentRegs = 0x01000000
};
#ifdef __cplusplus
extern "C"
#endif
BEA_API int __bea_callspec__ Disasm (LPDISASM pDisAsm);
BEA_API const__ char* __bea_callspec__ BeaEngineVersion (void);
BEA_API const__ char* __bea_callspec__ BeaEngineRevision (void);
#if defined(__cplusplus) && defined(__BORLANDC__)
};
using namespace BeaEngine;
#endif
#endif

View File

@ -0,0 +1,272 @@
/**
* @file basic_types.h
* @author <igor.gutnik@gmail.com>
* @date Thu Dec 24 19:31:22 2009
*
* @brief Definitions of fixed-size integer types for various platforms
*
* This file is part of BeaEngine.
*
* BeaEngine is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* BeaEngine is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with BeaEngine. If not, see <http://www.gnu.org/licenses/>. */
#ifndef __BEA_BASIC_TYPES_HPP__
#define __BEA_BASIC_TYPES_HPP__
#include <stddef.h>
#if defined(__GNUC__) || defined (__INTEL_COMPILER) || defined(__LCC__) || defined(__POCC__)
#include <stdint.h>
#endif
#if defined(_MSC_VER) && !defined(__BORLANDC__)
/*
* Windows/Visual C++
*/
typedef signed char Int8;
typedef unsigned char UInt8;
typedef signed short Int16;
typedef unsigned short UInt16;
typedef signed int Int32;
typedef unsigned int UInt32;
typedef signed __int64 Int64;
typedef unsigned __int64 UInt64;
#if defined(_WIN64)
#define BEA_PTR_IS_64_BIT 1
typedef signed __int64 IntPtr;
typedef unsigned __int64 UIntPtr;
#else
typedef signed long IntPtr;
typedef size_t UIntPtr;
#endif
#define BEA_HAVE_INT64 1
#elif defined(__POCC__)
/*
* PellesC
*/
typedef signed char Int8;
typedef unsigned char UInt8;
typedef signed short Int16;
typedef unsigned short UInt16;
typedef signed int Int32;
typedef unsigned int UInt32;
typedef signed long long Int64;
typedef unsigned long long UInt64;
#if defined(_WIN64)
#define BEA_PTR_IS_64_BIT 1
typedef signed long long IntPtr;
typedef unsigned long long UIntPtr;
#else
typedef signed long IntPtr;
typedef size_t UIntPtr;
#endif
#define BEA_HAVE_INT64 1
#elif defined(__GNUC__) || defined(__LCC__)
/*
* Unix/GCC
*/
typedef signed char Int8;
typedef unsigned char UInt8;
typedef signed short Int16;
typedef unsigned short UInt16;
typedef signed int Int32;
typedef unsigned int UInt32;
typedef intptr_t IntPtr;
typedef uintptr_t UIntPtr;
#if defined(__LP64__)
#define BEA_PTR_IS_64_BIT 1
#define BEA_LONG_IS_64_BIT 1
typedef signed long Int64;
typedef unsigned long UInt64;
#else
#if defined (__INTEL_COMPILER) || defined (__ICC) || defined (_ICC)
typedef __int64 Int64;
typedef unsigned __int64 UInt64;
#else
typedef signed long long Int64;
typedef unsigned long long UInt64;
#endif
#endif
#define BEA_HAVE_INT64 1
#elif defined(__DECCXX)
/*
* Compaq C++
*/
typedef signed char Int8;
typedef unsigned char UInt8;
typedef signed short Int16;
typedef unsigned short UInt16;
typedef signed int Int32;
typedef unsigned int UInt32;
typedef signed __int64 Int64;
typedef unsigned __int64 UInt64;
#if defined(__VMS)
#if defined(__32BITS)
typedef signed long IntPtr;
typedef unsigned long UIntPtr;
#else
typedef Int64 IntPtr;
typedef UInt64 UIntPtr;
#define BEA_PTR_IS_64_BIT 1
#endif
#else
typedef signed long IntPtr;
typedef unsigned long UIntPtr;
#define BEA_PTR_IS_64_BIT 1
#define BEA_LONG_IS_64_BIT 1
#endif
#define BEA_HAVE_INT64 1
#elif defined(__HP_aCC)
/*
* HP Ansi C++
*/
typedef signed char Int8;
typedef unsigned char UInt8;
typedef signed short Int16;
typedef unsigned short UInt16;
typedef signed int Int32;
typedef unsigned int UInt32;
typedef signed long IntPtr;
typedef unsigned long UIntPtr;
#if defined(__LP64__)
#define BEA_PTR_IS_64_BIT 1
#define BEA_LONG_IS_64_BIT 1
typedef signed long Int64;
typedef unsigned long UInt64;
#else
typedef signed long long Int64;
typedef unsigned long long UInt64;
#endif
#define BEA_HAVE_INT64 1
#elif defined(__SUNPRO_CC) || defined(__SUNPRO_C)
/*
* SUN Forte C++
*/
typedef signed char Int8;
typedef unsigned char UInt8;
typedef signed short Int16;
typedef unsigned short UInt16;
typedef signed int Int32;
typedef unsigned int UInt32;
typedef signed long IntPtr;
typedef unsigned long UIntPtr;
#if defined(__sparcv9)
#define BEA_PTR_IS_64_BIT 1
#define BEA_LONG_IS_64_BIT 1
typedef signed long Int64;
typedef unsigned long UInt64;
#else
typedef signed long long Int64;
typedef unsigned long long UInt64;
#endif
#define BEA_HAVE_INT64 1
#elif defined(__IBMCPP__)
/*
* IBM XL C++
*/
typedef signed char Int8;
typedef unsigned char UInt8;
typedef signed short Int16;
typedef unsigned short UInt16;
typedef signed int Int32;
typedef unsigned int UInt32;
typedef signed long IntPtr;
typedef unsigned long UIntPtr;
#if defined(__64BIT__)
#define BEA_PTR_IS_64_BIT 1
#define BEA_LONG_IS_64_BIT 1
typedef signed long Int64;
typedef unsigned long UInt64;
#else
typedef signed long long Int64;
typedef unsigned long long UInt64;
#endif
#define BEA_HAVE_INT64 1
#elif defined(__BORLANDC__)
/*
* Borland C/C++
*/
typedef signed char Int8;
typedef unsigned char UInt8;
typedef signed short Int16;
typedef unsigned short UInt16;
typedef signed int Int32;
typedef unsigned int UInt32;
typedef unsigned __int64 Int64;
typedef signed __int64 UInt64;
typedef signed long IntPtr;
typedef unsigned long UIntPtr;
#define BEA_HAVE_INT64 1
#elif defined(__WATCOMC__)
/*
* Watcom C/C++
*/
typedef signed char Int8;
typedef unsigned char UInt8;
typedef signed short Int16;
typedef unsigned short UInt16;
typedef signed int Int32;
typedef unsigned int UInt32;
typedef unsigned __int64 Int64;
typedef signed __int64 UInt64;
#define BEA_HAVE_INT64 1
typedef size_t UIntPtr;
#elif defined(__sgi)
/*
* MIPSpro C++
*/
typedef signed char Int8;
typedef unsigned char UInt8;
typedef signed short Int16;
typedef unsigned short UInt16;
typedef signed int Int32;
typedef unsigned int UInt32;
typedef signed long IntPtr;
typedef unsigned long UIntPtr;
#if _MIPS_SZLONG == 64
#define BEA_PTR_IS_64_BIT 1
#define BEA_LONG_IS_64_BIT 1
typedef signed long Int64;
typedef unsigned long UInt64;
#else
typedef signed long long Int64;
typedef unsigned long long UInt64;
#endif
#define BEA_HAVE_INT64 1
#endif
#if defined(_MSC_VER) || defined(__BORLANDC__)
#define W64LIT(x) x##ui64
#else
#define W64LIT(x) x##ULL
#endif
#ifndef C_STATIC_ASSERT
#define C_STATIC_ASSERT(tag_name, x) \
typedef int cache_static_assert_ ## tag_name[(x) * 2-1]
#endif
C_STATIC_ASSERT(sizeof_Int8 , (sizeof(Int8) == 1));
C_STATIC_ASSERT(sizeof_UInt8, (sizeof(UInt8) == 1));
C_STATIC_ASSERT(sizeof_Int16 , (sizeof(Int16) == 2));
C_STATIC_ASSERT(sizeof_UInt16, (sizeof(UInt16) == 2));
C_STATIC_ASSERT(sizeof_Int32 , (sizeof(Int32) == 4));
C_STATIC_ASSERT(sizeof_UInt32, (sizeof(UInt32) == 4));
C_STATIC_ASSERT(sizeof_Int64 , (sizeof(Int64) == 8));
C_STATIC_ASSERT(sizeof_UInt64, (sizeof(UInt64) == 8));
#endif

173
deps/beaengine-4.1/include/beaengine/export.h vendored Executable file
View File

@ -0,0 +1,173 @@
/**
* @file export.h
* @author igor.gutnik@gmail.com
* @date Mon Sep 22 09:28:54 2008
*
* @brief This file sets things up for C dynamic library function definitions and
* static inlined functions
*
* This file is part of BeaEngine.
*
* BeaEngine is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* BeaEngine is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with BeaEngine. If not, see <http://www.gnu.org/licenses/>. */
#ifndef __BEA_EXPORT_H__
#define __BEA_EXPORT_H__
/* Set up for C function definitions, even when using C++ */
#ifdef __cplusplus
#define CPP_VISIBLE_BEGIN extern "C" {
#define CPP_VISIBLE_END }
#else
#define CPP_VISIBLE_BEGIN
#define CPP_VISIBLE_END
#endif
#if defined(_MSC_VER)
#pragma warning( disable: 4251 )
#endif
/* Some compilers use a special export keyword */
#ifndef bea__api_export__
# if defined(__BEOS__)
# if defined(__GNUC__)
# define bea__api_export__ __declspec(dllexport)
# else
# define bea__api_export__ __declspec(export)
# endif
# elif defined(_WIN32) || defined(_WIN64)
# ifdef __BORLANDC__
# define bea__api_export__ __declspec(dllexport)
# define bea__api_import__ __declspec(dllimport)
# elif defined(__WATCOMC__)
# define bea__api_export__ __declspec(dllexport)
# define bea__api_import__
# else
# define bea__api_export__ __declspec(dllexport)
# define bea__api_import__ __declspec(dllimport)
# endif
# elif defined(__OS2__)
# ifdef __WATCOMC__
# define bea__api_export__ __declspec(dllexport)
# define bea__api_import__
# else
# define bea__api_export__
# define bea__api_import__
# endif
# else
# if defined(_WIN32) && defined(__GNUC__) && __GNUC__ >= 4
# define bea__api_export__ __attribubea__ ((visibility("default")))
# define bea__api_import__ __attribubea__ ((visibility("default")))
# else
# define bea__api_export__
# define bea__api_import__
# endif
# endif
#endif
/* Use C calling convention by default*/
#ifndef __bea_callspec__
#if defined(BEA_USE_STDCALL)
#if defined(__WIN32__) || defined(WIN32) || defined(_WIN32) || defined(_WIN64)
#if defined(__BORLANDC__) || defined(__WATCOMC__) || defined(_MSC_VER) || defined(__MINGW32__) || defined(__POCC__)
#define __bea_callspec__ __stdcall
#else
#define __bea_callspec__
#endif
#else
#ifdef __OS2__
#define __bea_callspec__ _System
#else
#define __bea_callspec__
#endif
#endif
#else
#define __bea_callspec__
#endif
#endif
#ifdef __SYMBIAN32__
# ifndef EKA2
# undef bea__api_export__
# undef bea__api_import__
# define bea__api_export__
# define bea__api_import__
# elif !defined(__WINS__)
# undef bea__api_export__
# undef bea__api_import__
# define bea__api_export__ __declspec(dllexport)
# define bea__api_import__ __declspec(dllexport)
# endif /* !EKA2 */
#endif /* __SYMBIAN32__ */
#if defined(__GNUC__) && (__GNUC__ > 2)
#define BEA_EXPECT_CONDITIONAL(c) (__builtin_expect((c), 1))
#define BEA_UNEXPECT_CONDITIONAL(c) (__builtin_expect((c), 0))
#else
#define BEA_EXPECT_CONDITIONAL(c) (c)
#define BEA_UNEXPECT_CONDITIONAL(c) (c)
#endif
/* Set up compiler-specific options for inlining functions */
#ifndef BEA_HAS_INLINE
#if defined(__GNUC__) || defined(__POCC__) || defined(__WATCOMC__) || defined(__SUNPRO_C)
#define BEA_HAS_INLINE
#else
/* Add any special compiler-specific cases here */
#if defined(_MSC_VER) || defined(__BORLANDC__) || \
defined(__DMC__) || defined(__SC__) || \
defined(__WATCOMC__) || defined(__LCC__) || \
defined(__DECC) || defined(__EABI__)
#ifndef __inline__
#define __inline__ __inline
#endif
#define BEA_HAS_INLINE
#else
#if !defined(__MRC__) && !defined(_SGI_SOURCE)
#ifndef __inline__
#define __inline__ inline
#endif
#define BEA_HAS_INLINE
#endif /* Not a funky compiler */
#endif /* Visual C++ */
#endif /* GNU C */
#endif /* CACHE_HAS_INLINE */
/* If inlining isn't supported, remove "__inline__", turning static
inlined functions into static functions (resulting in code bloat
in all files which include the offending header files)
*/
#ifndef BEA_HAS_INLINE
#define __inline__
#endif
/* fix a bug with gcc under windows */
#if defined(__WIN32__) || defined(WIN32) || defined(_WIN32) || defined(_WIN64)
#if defined(__MINGW32__)
#define const__
#else
#define const__ const
#endif
#else
#define const__ const
#endif
#endif

41
deps/beaengine-4.1/include/beaengine/macros.h vendored Executable file
View File

@ -0,0 +1,41 @@
#ifndef __BEAENGINE_MACROS_H__
#define __BEAENGINE_MACROS_H__
/*
============================================================================
Compiler Silencing macros
Some compilers complain about parameters that are not used. This macro
should keep them quiet.
============================================================================
*/
# if defined (__GNUC__) && ((__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 2)))
# define BEA_UNUSED_ARG(a) (void) (a)
#elif defined (ghs) || defined (__GNUC__) || defined (__hpux) || defined (__sgi) || defined (__DECCXX) || defined (__rational__) || defined (__USLC__) || defined (BEA__RM544) || defined (__DCC__) || defined (__PGI) || defined (__TANDEM) || defined(__BORLANDC__)
/*
Some compilers complain about "statement with no effect" with (a).
This eliminates the warnings, and no code is generated for the null
conditional statement. Note, that may only be true if -O is enabled,
such as with GreenHills (ghs) 1.8.8.
*/
# define BEA_UNUSED_ARG(a) do {/* null */} while (&a == 0)
#elif defined (__DMC__)
#if defined(__cplusplus)
#define BEA_UNUSED_ID(identifier)
template <class T>
inline void BEA_UNUSED_ARG(const T& BEA_UNUSED_ID(t)) { }
#else
#define BEA_UNUSED_ARG(a)
#endif
#else /* ghs || __GNUC__ || ..... */
# define BEA_UNUSED_ARG(a) (a)
#endif /* ghs || __GNUC__ || ..... */
#if defined (_MSC_VER) || defined(__sgi) || defined (ghs) || defined (__DECCXX) || defined(__BORLANDC__) || defined (BEA_RM544) || defined (__USLC__) || defined (__DCC__) || defined (__PGI) || defined (__TANDEM) || (defined (__HP_aCC) && (__HP_aCC >= 60500))
# define BEA_NOTREACHED(a)
#else /* __sgi || ghs || ..... */
# define BEA_NOTREACHED(a) a
#endif /* __sgi || ghs || ..... */
#endif /* __BEAENGINE_MACROS_H__ */

28
deps/beaengine-4.1/makeStaticLib64.bat vendored Executable file
View File

@ -0,0 +1,28 @@
@echo off
set INCLUDE=C:\Program Files\PellesC\Include\;C:\Program Files\PellesC\Include\Win\;
set LIB=C:\Program Files\PellesC\Lib\;C:\Program Files\PellesC\Lib\Win64\;
set name=BeaEngine
echo ____________________________________
echo *
echo * COMPILATION with POCC.EXE (Pelles C)
echo *
echo ____________________________________
pocc /Tamd64-coff /Ze /W2 /DBEA_ENGINE_STATIC beaengineSources/%name%.c
echo ____________________________________
echo *
echo * CREATE LIB with POLIB.EXE (Pelles C)
echo *
echo ____________________________________
"C:\Program Files\PellesC\Bin\PoLib" /MACHINE:X64 /out:%name%64.lib beaengineSources/%name%.obj
pause

View File

@ -44,6 +44,7 @@ class Backend {
virtual BlockPointer AssembleBlock(ir::IRBuilder &builder,
int block_flags) = 0;
virtual void DumpBlock(BlockPointer block) = 0;
virtual bool HandleFastmemException(sys::Exception &ex) = 0;

View File

@ -1,5 +1,6 @@
#include <iomanip>
#include <sstream>
#include <beaengine/BeaEngine.h>
#include <xbyak/xbyak.h>
#include "core/memory.h"
#include "emu/profiler.h"
@ -146,6 +147,44 @@ BlockPointer X64Backend::AssembleBlock(ir::IRBuilder &builder,
return fn;
}
void X64Backend::DumpBlock(BlockPointer block) {
DISASM dsm;
memset(&dsm, 0, sizeof(dsm));
dsm.Archi = 64;
dsm.EIP = (uintptr_t)block;
dsm.SecurityBlock = 0;
dsm.Options = NasmSyntax | PrefixedNumeral;
while (true) {
int len = Disasm(&dsm);
if (len == OUT_OF_BLOCK) {
LOG_INFO("Disasm engine is not allowed to read more memory");
break;
} else if (len == UNKNOWN_OPCODE) {
LOG_INFO("Unknown opcode");
break;
}
// format instruction binary
static const int MAX_INSTR_LENGTH = 15;
std::stringstream instr;
for (int i = 0; i < MAX_INSTR_LENGTH; i++) {
uint32_t v =
i < len ? (uint32_t) * reinterpret_cast<uint8_t *>(dsm.EIP + i) : 0;
instr << std::hex << std::setw(2) << std::setfill('0') << v;
}
// print out binary / mnemonic
LOG_INFO("%s %s", instr.str().c_str(), dsm.CompleteInstr);
if (dsm.Instruction.BranchType == RetType) {
break;
}
dsm.EIP = dsm.EIP + len;
}
}
bool X64Backend::HandleFastmemException(Exception &ex) {
const uint8_t *data = reinterpret_cast<const uint8_t *>(ex.thread_state.rip);

View File

@ -30,6 +30,7 @@ class X64Backend : public Backend {
void Reset();
BlockPointer AssembleBlock(ir::IRBuilder &builder, int block_flags);
void DumpBlock(BlockPointer block);
bool HandleFastmemException(sys::Exception &ex);