类
VMProtect 中内置的脚本语言 LUA 是面向对象的:它在语法、思想和实现方面与 JavaScript 非常相似。脚本语言包括提供基本功能的标准类和提供对应用程序保护功能的访问的专用类。
类层次结构
Core
工程选项:
enum ProjectOption {
None,
Pack,
ImportProtection,
MemoryProtection,
ResourceProtection,
CheckDebugger,
CheckKernelDebugger,
CheckVirtualMachine,
StripFixups,
StripDebugInfo,
DebugMode
}
使用 VMProtect Core 的类:
class Core {
public:
string projectFileName(); // 返回工程的名称
void saveProject(); // 保存该工程
string inputFileName(); // 返回当前工程的源文件的名称
string outputFileName(); // 返回当前工程的输出文件的名称
void setOutputFileName(string name); // 设置当前工程的输出文件的名称
string watermarkName(); // 返回当前工程的水印名称
void setWatermarkName(string name); // 设置当前工程的水印名称
int options(); // 返回当前工程的 选项
void setOptions(int options); // 设置当前工程的选项
string vmSectionName(); // 返回当前工程的虚拟机分段名称
void setVMSectionName(); // 设置当前工程的虚拟机分段名称
Licenses licenses(); // 返回当前工程的授权列表
Files files(); // 返回当前工程的文件列表
Watermarks watermarks(); // 返回水印列表
PEFile/MacFile inputFile(); // 返回源文件
PEFile/MacFile outputFile(); // 返回输出文件
PEArchitecture/MacArchitecture inputArchitecture(); // 返回源架构
PEArchitecture/MacArchitecture outputArchitecture(); // 返回输出架构
};
Watermarks
一个使用 水印 列表的类:
class Watermarks {
public:
Watermark item(int index); // 返回一个给定索引的水印
int count(); // 返回列表中的水印数量
Watermark itemByName(string name); // 返回一个给定名称的水印
}
一个使用水印的类:
class Watermark {
public:
string name(); // 返回水印的名称
string value(); // 返回水印的值
bool blocked(); // 返回“已冻结”属性
void setBlocked(bool value); // 返回“已冻结”属性
}
Licenses
一个使用 授权 列表的类:
class Licenses {
public:
int keyLength(); // 返回密钥的长度
string publicExp(); // 返回公共指数
string privateExp(); // 返回私有指数
string modulus(); // 返回模数
License item(int index); // 返回一个给定索引的授权
int count(); // 返回列表中授权的数量
}
一个使用授权的类:
class License {
public:
string date(string format = "%c"); // 返回授权的日期
string customerName(); // 返回授权所有者的姓名
string customerEmail(); // 返回授权所有者的电子邮件
string orderRef(); // 返回购买授权的订单号
string comments(); // 返回对授权的评论
string serialNumber(); // 返回授权的序列号
bool blocked(); // 返回“已冻结”属性
void setBlocked(bool value); // 返回“已冻结”属性
}
Files
一个使用 文件 列表的类:
class Files {
public:
File item(int index); // 返回一个给定索引的文件
int count(); // 返回列表中文件的数量
}
一个使用 文件 的类:
class File {
public:
string name(); // 返回文件名
string fileName(); // 返回文件名
int options(); // 返回选项
void setName(string name); // 设置文件名
void setFileName(string name); // 设置文件的文件名
void setOptions(); // 设置选项
}
Folders
一个使用自定义文件夹的类:
class Folders {
public:
int count(); // 返回列表中文件夹的数量
Folder item(int index); // 返回一个给定索引的文件夹
Folder add(string name); // 添加一个新文件夹
void clear(); // 清除列表
};
一个使用自定义文件夹的类:
class Folder {
public:
int count(); // 返回子文件夹的数量
Folder item(int index); // 返回一个给定索引的子文件夹
Folder add(string name); // 添加一个新的子文件夹
string name(); // 返回文件夹的名称
void clear(); // 清除子文件夹列表
void destroy(); // 销毁该文件夹和所有子子文件夹
};
PE files
使用 PE 格式的常量:
enum PEFormat {
// 目录条目
IMAGE_DIRECTORY_ENTRY_EXPORT,
IMAGE_DIRECTORY_ENTRY_IMPORT,
IMAGE_DIRECTORY_ENTRY_RESOURCE,
IMAGE_DIRECTORY_ENTRY_EXCEPTION,
IMAGE_DIRECTORY_ENTRY_SECURITY,
IMAGE_DIRECTORY_ENTRY_BASERELOC,
IMAGE_DIRECTORY_ENTRY_DEBUG,
IMAGE_DIRECTORY_ENTRY_ARCHITECTURE,
IMAGE_DIRECTORY_ENTRY_TLS,
IMAGE_DIRECTORY_ENTRY_LOAD_CONFIG,
IMAGE_DIRECTORY_ENTRY_BOUND_IMPORT,
IMAGE_DIRECTORY_ENTRY_IAT,
IMAGE_DIRECTORY_ENTRY_DELAY_IMPORT,
IMAGE_DIRECTORY_ENTRY_COM_DESCRIPTOR,
// 章节特点
IMAGE_SCN_CNT_CODE,
IMAGE_SCN_CNT_INITIALIZED_DATA,
IMAGE_SCN_CNT_UNINITIALIZED_DATA,
IMAGE_SCN_MEM_DISCARDABLE,
IMAGE_SCN_MEM_NOT_CACHED,
IMAGE_SCN_MEM_NOT_PAGED,
IMAGE_SCN_MEM_SHARED,
IMAGE_SCN_MEM_EXECUTE,
IMAGE_SCN_MEM_READ,
IMAGE_SCN_MEM_WRITE,
// 资源类型
RT_CURSOR,
RT_BITMAP,
RT_ICON,
RT_MENU,
RT_DIALOG,
RT_STRING,
RT_FONTDIR,
RT_FONT,
RT_ACCELERATOR,
RT_RCDATA,
RT_MESSAGETABLE,
RT_GROUP_CURSOR,
RT_GROUP_ICON,
RT_VERSION,
RT_DLGINCLUDE,
RT_PLUGPLAY,
RT_VXD,
RT_ANICURSOR,
RT_ANIICON,
RT_HTML,
RT_MANIFEST,
RT_DLGINIT,
RT_TOOLBAR
};
一个使用 PE 文件的类:
class PEFile {
public:
string name(); // 返回文件名
string format(); // 返回“PE”格式名称
uint64 size(); // 返回文件的大小
int count(); // 返回列表中的架构数量
PEArchitecture item(int index); // 返回一个给定索引的架构
uint64 seek(uint64 offset); // 设置一个文件位置
uint64 tell(); // 返回一个文件位置
int write(string buffer); // 将缓冲区记录到文件中
};
一个使用 PE 架构的类:
class PEArchitecture {
public:
string name(); // 返回架构的名称
PEFile file(); // 返回父文件
uint64 entryPoint(); // 返回起始地址
uint64 imageBase(); // 返回基本偏移量
OperandSize cpuAddressSize(); // 返回架构的位数
uint64 size(); // 返回架构的大小
PESegments segments(); // 返回分段列表
PESections sections(); // 返回章节列表
PEDirectories directories(); // 返回目录列表
PEImports imports(); // 返回导入库的列表
PEExports exports(); // 返回导出的函数列表
PEResources resources(); // 返回资源列表
PEFixups fixups(); // 返回重定位列表(修正);
MapFunctions mapFunctions(); // 返回可用于保护的函数列表
IntelFunctions functions(); // 返回受保护函数的列表
bool addressSeek(uint64 address); // 设置一个文件位置
uint64 seek(uint64 offset); // 设置一个文件位置
uint64 tell(); // 返回一个文件位置
int write(string buffer); // 将缓冲区写入文件
};
一个使用 PE 架构的分段列表的类:
class PESegments {
public:
PESegment item(int index); // 返回一个给定索引的分段
int count(); // 返回列表中的分段数
PESegment itemByAddress(uint64 address); // 返回给定地址的分段
};
一个使用 PE 架构分段的类:
class PESegment {
public:
uint64 address(); // 返回该分段的地址
string name(); // 返回分段的名称
uint64 size(); // 返回分段的大小
int physicalOffset(); // 返回该分段的文件位置(偏移量)
int physicalSize(); // 返回该分段的文件大小
int flags(); // 返回该分段的标志
bool excludedFromPacking(); // 返回 "排除在压缩之外 "的属性
void setName(string name); // 设置分段的名称
};
一个使用 PE 架构节列表的类:
class PESections {
public:
PESection item(int index); // 返回一个给定索引的章节
int count(); // 返回列表中的章节数
PESection itemByAddress(uint64 address); // 返回一个给定地址的节
};
一个使用 PE 架构节的类:
class PESection {
public:
uint64 address(); // 返回该节的地址
string name(); // 返回该节的名称
uint64 size(); // 返回该节的大小
int offset(); // 返回该节的文件位置
PESegment segment(); // 返回父分段
};
一个使用 PE 架构目录的类:
class PEDirectories {
public:
PEDirectory item(int index); // 返回一个给定索引的目录
int count(); // 返回列表中的目录数
PEDirectory itemByType(int type); // 返回一个给定类型的目录
};
一个使用 PE 架构目录的类:
class PEDirectory {
public:
uint64 address(); // 返回目录的地址
string name(); // 返回目录的名称
uint64 size(); // 返回目录的大小
int type(); // 返回目录的类型
void setAddress(uint64 address); // 设置目录的地址
void setSize(int size); // 设置目录的大小
void clear(); // 清除目录的地址和大小
};
一个使用 PE 架构的导入库列表的类:
class PEImports {
public:
PEImport item(int index); // 返回一个给定索引的库
int count(); // 返回列表中库的数量
PEImport itemByName(string name); // 返回一个给定名称的库
};
一个使用用于 PE 架构导入库的类:
class PEImport {
public:
string name(); // 返回库的名称
PEImportFunction item(int index); // 返回一个给定索引的导入函数
int count(); // 返回导入函数的数量
void setName(string name); // 设置库的名称
};
一个使用 PE 架构导入函数的类:
class PEImportFunction {
public:
uint64 address(); // 返回一个存储导入函数地址的内存地址
string name(); // 返回导入函数的名称
};
一个使用 PE 架构的导出函数列表的类:
class PEExports {
public:
string name(); // 返回库的名称
PEExport item(int index); // 返回一个给定索引的导出函数
int count(); // 返回列表中导出的函数的数量
void clear(); // 清除列表
PEExport itemByAddress(uint64 address); // 在给定的地址上返回一个导出的函数
PEExport itemByName(string name); // 返回一个给定名称的导出的函数
};
一个使用 PE 架构导出函数的类:
class PEExport {
public:
uint64 address(); // 返回导出函数的地址
string name(); // 返回导出函数的名称
int ordinal(); // 返回导出函数的序号
string forwardedName(); // 返回导出函数转发的函数名称
void destroy(); // 销毁导出的函数
};
一个使用 PE 架构资源列表的类:
class PEResources {
public:
PEResource item(int index); // 返回一个给定索引的资源
int count(); // 返回列表中资源的数量
void clear(); // 清除列表
PEResource itemByType(int type); // 返回一个给定类型的资源
PEResource itemByName(string name); // 返回一个给定名称的资源
};
一个使用 PE 架构资源的类:
class PEResource {
public:
PEResource item(int index); // 返回一个给定索引的资源
int count(); // 返回列表中资源的数量
void clear(); // 清除列表
uint64 address(); // 返回该资源的地址
int size(); // 返回资源的大小
string name(); // 返回该资源的名称
int type(); // 返回该资源的类型
bool isDirectory(); // 返回 "目录 "属性
void destroy(); // 销毁资源
PEResource itemByName(string name); // 返回一个给定名称的资源
bool excludedFromPacking(); // 返回 "排除在压缩之外 "的属性
};
一个使用 PE 架构修复(重定位)列表的类:
class PEFixups {
public:
PEFixup item(int index); // 返回一个给定索引的元素
int count(); // 返回列表中元素的数量
PEFixup itemByAddress(uint64 address); // 返回一个给定地址的元素
};
一个使用 PE 架构修复(重定位)的类:
class PEFixup {
public:
uint64 address(); // 返回该元素的地址
};
Mach-O files
使用 Mach-O 格式的常量:
enum MacFormat {
// 加载命令类型
LC_SEGMENT,
LC_SYMTAB,
LC_SYMSEG,
LC_THREAD,
LC_UNIXTHREAD,
LC_LOADFVMLIB,
LC_IDFVMLIB,
LC_IDENT,
LC_FVMFILE,
LC_PREPAGE,
LC_DYSYMTAB,
LC_LOAD_DYLIB,
LC_ID_DYLIB,
LC_LOAD_DYLINKER,
LC_PREBOUND_DYLIB,
LC_ROUTINES,
LC_SUB_FRAMEWORK,
LC_SUB_UMBRELLA,
LC_SUB_CLIENT,
LC_SUB_LIBRARY,
LC_TWOLEVEL_HINTS,
LC_PREBIND_CKSUM,
LC_LOAD_WEAK_DYLIB,
LC_SEGMENT_64,
LC_ROUTINES_64,
LC_UUID,
LC_RPATH,
LC_CODE_SIGNATURE,
LC_SEGMENT_SPLIT_INFO,
LC_REEXPORT_DYLIB,
LC_LAZY_LOAD_DYLIB,
LC_ENCRYPTION_INFO,
LC_DYLD_INFO,
LC_DYLD_INFO_ONLY,
LC_LOAD_UPWARD_DYLIB,
LC_VERSION_MIN_MACOSX,
// 章节类型
SECTION_TYPE,
SECTION_ATTRIBUTES,
S_REGULAR,
S_ZEROFILL,
S_CSTRING_LITERALS,
S_4BYTE_LITERALS,
S_8BYTE_LITERALS,
S_LITERAL_POINTERS,
S_NON_LAZY_SYMBOL_POINTERS,
S_LAZY_SYMBOL_POINTERS,
S_SYMBOL_STUBS,
S_MOD_INIT_FUNC_POINTERS,
S_MOD_TERM_FUNC_POINTERS,
S_COALESCED,
S_GB_ZEROFILL,
S_INTERPOSING,
S_16BYTE_LITERALS,
S_DTRACE_DOF,
S_LAZY_DYLIB_SYMBOL_POINTERS,
SECTION_ATTRIBUTES_USR,
S_ATTR_PURE_INSTRUCTIONS,
S_ATTR_NO_TOC,
S_ATTR_STRIP_STATIC_SYMS,
S_ATTR_NO_DEAD_STRIP,
S_ATTR_LIVE_SUPPORT,
S_ATTR_SELF_MODIFYING_CODE,
S_ATTR_DEBUG,
SECTION_ATTRIBUTES_SYS,
S_ATTR_SOME_INSTRUCTIONS,
S_ATTR_EXT_RELOC,
S_ATTR_LOC_RELOC
};
一个使用 Mach-O 文件的类:
class MacFile {
public:
string name(); // 返回文件名
string format(); // 返回“Mach-O”格式的名称
uint64 size(); // 返回文件的大小
int count(); // 返回列表中的架构数量
MacArchitecture item(int index); // 返回一个给定索引的架构
uint64 seek(uint64 offset); // 设置文件位置
uint64 tell(); // 返回文件位置
int write(string buffer); // 将缓冲区写入文件
};
一个使用 Mach-O 架构的类:
class MacArchitecture {
public:
string name(); // 返回架构的名称
MacFile file(); // 返回父文件
uint64 entryPoint(); // 返回起始地址
OperandSize cpuAddressSize(); // 返回架构的位数
uint64 size(); // 返回架构的大小
MacSegments segments(); // 返回分段列表
MacSections sections(); // 返回章节列表
MacCommands commands(); // 返回加载命令的列表
MacSymbols symbols(); // 返回符号列表
MacImports imports(); // 返回导入库的列表
MacExports exports(); // 返回导出的函数列表
MacFixups fixups(); // 返回修复列表(重定位)
MapFunctions mapFunctions(); // 返回可用于保护的函数列表
IntelFunctions functions(); // 返回受保护函数的列表
bool addressSeek(uint64 address); // 设置文件位置
uint64 seek(uint64 offset); // 设置文件位置
uint64 tell(); // 返回文件位置
int write(string buffer); // 将缓冲区写入文件
};
一个使用 Mach-O 架构分段列表的类:
class MacSegments {
public:
MacSegment item(int index); // 返回一个给定索引的分段
int count(); // 返回列表中的分段数
MacSegment itemByAddress(); // 返回一个给定地址的分段
};
一个使用 Mach-O 架构分段的类:
class MacSegment {
public:
uint64 address(); // 返回该分段的地址
string name(); // 返回分段的名称
uint64 size(); // 返回分段的大小
int physicalOffset(); // 返回该分段的文件位置
int physicalSize(); // 返回该分段的文件大小
int flags(); // 返回该分段的标志
bool excludedFromPacking(); // 返回 "排除在压缩之外 "的属性
};
一个使用 Mach-O 架构节列表的类:
class MacSections {
public:
MacSection item(int index); // 返回一个给定索引的章节
int count(); // 返回列表中的章节数
MacSection itemByAddress(uint64 address); // 返回一个给定地址的节
};
一个使用 Mach-O 架构节的类:
class MacSection {
public:
uint64 address(); // 返回该节的地址
string name(); // 返回该节的名称
uint64 size(); // 返回该节的大小
int offset(); // 返回该节的文件位置
MacSegment segment(); // 返回父分段
};
一个使用 Mach-O 架构加载命令列表的类:
class MacCommands {
public:
MacCommand item(int index); // 返回一个给定索引的命令
int count(); // 返回列表中命令的数量
MacCommand itemByType(int type); // 返回一个给定类型的命令
};
一个使用 Mach-O 架构加载命令的类:
class MacCommand {
public:
uint64 address(); // 返回命令的地址
int type(); // 返回该命令的类型
string name(); // 返回该命令的名称
int size(); // 返回命令的大小
};
一个使用 Mach-O 架构符号列表的类:
class MacSymbols {
public:
MacSymbol item(int index); // 返回一个给定索引的符号
int count(); // 返回列表中符号的数量
};
一个使用 Mach-O 架构符号的类:
class MacSymbol {
public:
uint64 value(); // 返回符号的值
string name(); // 返回符号的名称
};
一个使用 Mach-O 架构的导入库列表的类:
class MacImports {
public:
MacImport item(int index); // 返回一个给定索引的导入库
int count(); // 返回列表中导入的库的数量
MacImport itemByName(string name); // 返回一个给定名称的导入库
};
一个使用 Mach-O 架构导入库的类:
class MacImport {
public:
string name(); // 返回导入库的名称
MacImportFunction item(int index); // 返回一个给定索引的导入函数
int count(); // 返回列表中导入函数的数量
void setName(string name); // 设置导入库的名称
};
一个使用 Mach-O 架构导入函数的类:
class MacImportFunction {
public:
uint64 address(); // 返回存储导入函数地址的内存地址
string name(); // 返回导入函数的名称
};
一个使用 Mach-O 架构的导出函数列表的类:
class MacExports {
public:
string name(); // 返回库的名称
MacExport item(); // 返回一个给定索引的导出函数
int count(); // 返回列表中导出的函数的数量
void clear(); // 清除列表
MacExport itemByAddress(uint64 address); // 在给定的地址上返回一个导出的函数
MacExport itemByName(string name); // 返回一个给定名称的导出函数
};
一个使用 Mach-O 架构导出函数的类:
class MacExport {
public:
uint64 address(); // 返回导出函数的地址
string name(); // 返回导出函数的名称
string forwardedName(); // 返回导出函数转发到的函数的名称
void destroy(); // 销毁导出的函数
};
一个使用 Mach-O 架构的修复(重定位)列表的类:
class MacFixups {
public:
MacFixup item(int index); // 返回一个给定索引的元素
int count(); // 返回列表中元素的数量
MacFixup itemByAddress(uint64 address); // 返回一个给定地址的元素
};
一个使用 Mach-O 架构修复的类:
class MacFixup {
public:
uint64 address(); // 返回该元素的地址
};
Functions
一个使用函数列表的类:
class MapFunctions {
public:
MapFunction item(int index); // 返回一个给定索引的函数
int count(); // 返回列表中函数的数量
MapFunction itemByAddress(uint64 address); // 返回一个给定地址的函数
MapFunction itemByName(string name); // 返回一个给定名称的函数
};
函数类型:
enum ObjectType {
Unknown,
Code,
Data,
Export,
Marker,
APIMarker,
Import,
String
};
一个使用函数的类:
class MapFunction {
public:
uint64 address(); // 返回函数的地址
string name(); // 返回该函数的名称
ObjectType type(); // 返回函数的类型
References references(); // 返回引用列表
};
一个使用参考列表的类:
class References {
public:
Reference item(int index); // 返回一个给定索引的引用
int count(); // 返回列表中的引用数量
};
一个使用参考的类:
class Reference {
public:
uint64 address(); // 返回命令的地址
uint64 operandAddress(); // 返回引用的地址
};
Intel functions
一个使用 Intel 函数列表的类:
class IntelFunctions {
public:
IntelFunction item(int index); // 返回一个给定索引的函数
int count(); // 返回列表中函数的数量
void clear(); // 清除列表
IntelFunction itemByAddress(uint64 address); // 返回一个给定地址的函数
IntelFunction itemByName(string name); // 返回一个给定名称的函数
IntelFunction addByAddress(uint64 address, CompilationType type = ctVirtualization);
//
};
编译类型:
enum CompilationType {
None,
Virtualization,
Mutation,
Ultra
};
一个使用 Intel 函数的类:
class IntelFunction {
public:
uint64 address(); // 返回函数的地址
string name(); // 返回该函数的名称
ObjectType type(); // 返回函数的类型
IntelCommand item(int index); // 返回一个给定索引的命令
int count(); // 返回列表中命令的数量
CompilationType compilationType(); // 返回编译类型
void setCompilationType(CompilationType value); // 设置编译类型
CommandLinks links(); // 返回链接列表
IntelCommand itemByAddress(uint64 address); // 返回一个在给定地址的命令
void destroy(); // 销毁函数
Folder folder(); // 返回自定义文件夹
void setFolder(Folder folder); // 设置自定义文件夹
};
Intel 命令的类型:
enum IntelCommandType {
Unknown, Push, Pop, Mov, Add, Xor, Test, Lea, Ud0, Ret, Ssh, Crc, Call, Jmp,
Fstsw, Fsqrt, Fchs, Fstcw, Fldcw, Fild, Fist, Fistp, Fld, Fstp, Fst, Fadd,
Fsub, Fsubr, Fisub, Fisubr, Fdiv, Fcomp, Fmul, Repe, Repne, Rep, DB, DW, DD, DQ,
Movs, Cmps, Scas, Movzx, Movsx, Inc, Dec, Les, Lds, Lfs, Lgs, Lss, Xadd, Bswap,
Jxx, And, Sub, Stos, Lods, Nop, Xchg, Pushf, Popf, Sahf, Lahf, Shl, Shr, Sal,
Sar, Rcl, Rcr, Rol, Ror, Shld, Shrd, Loope, Loopne, Loop, Jcxz, In, Ins, Out,
Outs, Wait, Cbw, Cwde, Cdqe, Cwd, Cdq, Cqo, Clc, Stc, Cli, Sti, Cld, Std, Not,
Neg, Div, Imul, Idiv, Mul, Or, Adc, Cmp, Sbb, Pusha, Popa, Clflush, Pause,
Bound, Arpl, Daa, Das, Aaa, Aam, Aad, Aas, Enter, Leave, Int, Into, Iret, Set,
Cmov, Addpd, Addps, Addsd, Addss, Andpd, Andps, Andnpd, Andnps, Cmppd, Cmpps,
Cmpsd, Cmpss, Comisd, Comiss, Cvtdq2ps, Cvtpd2dq, Cvtdq2pd, Cvtpd2pi, Cvtps2pi,
Cvtpd2ps, Cvtps2pd, Cvtpi2pd, Cvtpi2ps, Cvtps2dq, Cvtsd2si, Cvtss2si, Cvtsd2ss,
Cvtss2sd, Cvttpd2pi, Cvttps2pi, Cvttpd2dq, Cvttps2dq, Cvttsd2si, Cvttss2si,
Divpd, Divps, Divsd, Divss, Maxpd, Maxps, Maxsd, Maxss, Minpd, Minps, Minsd,
Minss, Mulpd, Mulps, Mulsd, Mulss, Orpd, Orps, Movd, Movq, Movntq, Movapd, Movaps,
Movdqa, Movdqu, Movdq2q, Movq2dq, Movhlps, Movhpd, Movhps, Movlhps, Movlpd,
Movlps, Movmskpd, Movmskps, Movnti, Movntpd, Movntps, Movsd, Movss, Movupd,
Movups, Pmovmskb, Psadbw, Pshufw, Pshufd, Pshuflw, Pshufhw, Psubb, Psubw, Psubd,
Psubq, Psubsb, Psubsw, Psubusb, Psubusw, Paddb, Paddw, Paddd, Paddq, Paddsb,
Paddsw, Paddusb, Paddusw, Pavgb, Pavgw, Pinsrw, Pextrw, Pmaxsw, Pmaxub, Pminsw,
Pminub, Pmulhuw, Pmulhw, Pmullw, Pmuludq, Psllw, Pslld, Psllq, Pslldq, Psraw,
Psrad, Psrlw, Psrld, Psrlq, Psrldq, Punpcklbw, Punpcklwd, Punpckldq, Punpcklqdq,
Punpckhqdq, Packusdw, Pcmpgtb, Pcmpgtw, Pcmpgtd, Pcmpeqb, Pcmpeqw, Pcmpeqd,
Emms, Packsswb, Packuswb, Punpckhbw, Punpckhwd, Punpckhdq, Packssdw, Pand,
Pandn, Por, Pxor, Pmaddwd, Rcpps, Rcpss, Rsqrtss, Movsxd, Shufps, Shufpd, Sqrtpd,
Sqrtps, Sqrtsd, Sqrtss, Subpd, Subps, Subsd, Subss, Ucomisd, Ucomiss, Unpckhpd,
Unpckhps, Unpcklpd, Unpcklps, Xorpd, Xorps, Bt, Bts, Btr, Btc, Xlat, Cpuid,
Rsm, Bsf, Bsr, Cmpxchg, Cmpxchg8b, Hlt, Cmc, Lgdt, Sgdt, Lidt, Sidt, Smsw, Lmsw,
Invlpg, Lar, Lsl, Clts, Invd, Wbinvd, Ud2, Wrmsr, Rdtsc, Rdmsr, Rdpmc, Fcom,
Fdivr, Fiadd, Fimul, Ficom, Ficomp, Fidiv, Fidivr, Faddp, Fmulp, Fsubp, Fsubrp,
Fdivp, Fdivrp, Fbld, Fbstp, Ffree, Frstor, Fsave, Fucom, Fucomp, Fldenv, Fstenvm,
Fxch, Fabs, Fxam, Fld1, Fldl2t, Fldl2e, Fldpi, Fldlg2, Fldln2, Fldz, Fyl2x,
Fptan, Fpatan, Fxtract, Fprem1, Fdecstp, Fincstp, Fprem, Fyl2xp1, Fsincos, Frndint,
Fscale, Fsin, Fcos, Ftst, Fstenv, F2xm1, Fnop, Finit, Fclex, Fcompp, Sysenter,
Sysexit, Sldt, Str, Lldt, Ltr, Verr, Verw, Sfence, Lfence, Mfence, Prefetchnta,
Prefetcht0, Prefetcht1, Prefetcht2, Prefetch, Prefetchw, Fxrstor, Fxsave, Ldmxcsr,
Stmxcsr, Fcmovb, Fcmove, Fcmovbe, Fcmovu, Fcmovnb, Fcmovne, Fcmovnbe, Fcmovnu,
Fucomi, Fcomi, Fucomip, Fcomip, Fucompp, Vmcall, Vmlaunch, Vmresume, Vmxoff,
Monitor, Mwait, Xgetbv, Xsetbv, Vmrun, Vmmcall, Vmload, Vmsave, Stgi, Clgi,
Skinit, Invlpga, Swapgs, Rdtscp, Syscall, Sysret, Femms, Getsec, Pshufb, Phaddw,
Phaddd, Phaddsw, Pmaddubsw, Phsubw, Phsubd, Phsubsw, Psignb, Psignw, Psignd,
Pmulhrsw, Pabsb, Pabsw, Pabsd, Movbe, Palignr, Rsqrtps, Vmread, Vmwrite, Svldt,
Rsldt, Svts, Rsts, Xsave, Xrstor, Vmptrld, Vmptrst, Maskmovq, Fnstenv, Fnstcw,
Fstp1, Fneni, Fndisi, Fnclex, Fninit, Fsetpm, Fisttp, Fnsave, Fnstsw, Fxch4,
Fcomp5, Ffreep, Fxch7, Fstp8, Fstp9, Haddpd, Hsubpd, Addsubpd, Addsubps, Movntdq,
Fcom2, Fcomp3, Haddps, Hsubps, Movddup, Movsldup, Cvtsi2sd, Cvtsi2ss, Movntsd,
Movntss, Lddqu, Movshdup, Popcnt, Tzcnt, Lzcnt, Pblendvb, Pblendps, Pblendpd,
Ptest, Movsxbw, Movsxbd, Movsxbq, Movsxwd, Movsxwq, Movsxdq, Muldq, Pcmpeqq,
Movntdqa, Xsaveopt, Maskmovdqu, Ud1, Pcmpgtq, Movzxbw, Movzxbd, Movzxbq, Movzxwd,
Movzxwq, Movzxdq
};
Intel 分段:
enum IntelSegment {
None,
es,
cs,
ss,
ds,
fs,
gs
};
Intel 标志:
enum IntelFlag {
C,
P,
A,
Z,
S,
T,
I,
D,
O
};
Intel 注册:
enum IntelRegistr {
eax,
ecx,
edx,
ebx,
esp,
ebp,
esi,
edi,
r8,
r9,
r10,
r11,
r12,
r13,
r14,
r15
};
一个使用 Intel 命令的类:
class IntelCommand {
public:
uint64 address(); // 返回命令的地址
IntelCommandType type(); // 返回该命令的类型
string text(); // 返回文本表示法
int size(); // 返回命令的大小
int dump(int index); // 返回给定索引的命令的数据
CommandLink link(); // 返回命令链接
int flags(); // 返回命令标志
IntelSegment baseSegment(); // 返回基础分段
IntelCommandType preffix(); // 返回前缀命令的类型
IntelOperand operand(int index); // 返回一个给定索引的操作数
};
操作数类型:
enum OperandType {
None,
Value,
Registr,
Memory,
SegmentRegistr,
ControlRegistr,
DebugRegistr,
FPURegistr,
HiPartRegistr,
BaseRegistr,
MMXRegistr,
XMMRegistr
};
操作数大小:
enum OperandSize {
Byte,
Word,
DWord,
QWord,
TByte,
OWord,
FWord
};
一个使用 Intel 命令的操作数的类:
class IntelOperand {
public:
int type(); // 返回操作数的类型
OperandSize size(); // 返回操作数的大小
int registr(); // 返回寄存器
int baseRegistr(); // 返回基数寄存器
int scale(); // 返回比例
uint64 value(); // 返回值
};
一个使用命令链接列表的类:
class CommandLinks {
public:
CommandLink item(int index); // 返回一个给定索引的链接
int count(); // 返回列表中链接的数量
};
链接类型:
enum LinkType {
None,
SEHBlock,
FinallyBlock,
DualSEHBlock,
FilterSEHBlock,
Jmp,
JmpWithFlag,
JmpWithFlagNSFS,
JmpWithFlagNSNA,
JmpWithFlagNSNS,
Call,
Case,
Switch,
Native,
Offset,
GateOffset,
ExtSEHBlock,
MemSEHBlock,
ExtSEHHandler,
VBMemSEHBlock
};
一个使用命令链接的类:
class CommandLink {
public:
uint64 toAddress(); // 返回链接指向的地址
LinkType type(); // 返回链接的类型
IntelCommand from(); // 返回父命令
};
一个使用库的类:
enum ParamType {
void,
byte,
char,
short,
ushort,
int,
uint,
long,
ulong,
size_t,
float,
double,
string,
pointer
};
enum CallType {
default,
cdecl,
stdcall
};
class FFILibrary {
public:
string name(); // 返回名称
uint64 address(); // 返回内存中的地址
void close();
FFIFunction getFunction(string name, ParamType ret, ParamType param1, ...); // 返回一个函数
FFIFunction getFunction(string name, table (ParamType ret, CallType abi, ParamType, ...)); // 返回一个函数
};
一个使用外部函数的类:
class FFIFunction {
string name(); // 返回名称
uint64 address(); // 返回内存中的地址
};