3大類別教你如何使用代碼保護軟件VMProtect的內置腳本(1)

VMProtect是一種很可靠的工具,能夠保護應用程序代碼免受分析和破解,但只有在應用程序內保護機制正確構建且沒有可能破壞整個保護的嚴重錯誤的狀況下,才能實現最好的效果。編程

以前對主窗口進行了介紹,接下來咱們將對VMProtect中強大的內置腳本的使用進行介紹,但願對您有所幫助。>>體驗VMProtect最新試用版架構

VMProtect具備內置的強大腳本語言LUA,極大地加強了VMProtect在每一個保護階段的默認保護功能。LUA語法很是相似於JavaScript,但與之不一樣的是,LUA不包含顯式類。不過,腳本語言容許輕鬆地實現類、繼承和事件等面向對象的編程機制。工具

對於如何使用腳本語言,能夠進行如下三類的介紹:spa

  • 內置功能
  • 事件

第一部分:類

 

VMProtect中內置的腳本語言LUA是面向對象的:它在語法,意識形態和實現方面與JavaScript很是類似。腳本語言包括提供基本功能的標準類和提供對應用程序保護功能的訪問的專用類。orm

 

▲核心

項目選擇:對象

enum ProjectOption {
	None,
	Pack,
	ImportProtection,
	MemoryProtection,
	ResourceProtection,
	CheckDebugger,
	CheckKernelDebugger,
	CheckVirtualMachine,
	StripFixups,
	StripDebugInfo,
	DebugMode
}

使用VMProtect核心的類:繼承

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(); //返回當前項目的VM段名稱
	void setVMSectionName(); //設置當前項目的VM段名稱
	Licenses licenses(); //返回當前項目的許可證列表
	Files files(); //返回當前項目的文件列表
	Watermarks watermarks(); //返回水印列表
	PEFile/MacFile inputFile(); //返回源文件
	PEFile/MacFile outputFile();//返回輸出文件
	PEArchitecture/MacArchitecture inputArchitecture(); //返回源架構
	PEArchitecture/MacArchitecture outputArchitecture();//返回輸出架構
};

 

▲水印

用於處理水印列表的類:索引

class Watermarks {
public:
	Watermark item(int index); //返回帶有給定索引的水印
	int count(); //返回列表中的一些水印
	Watermark itemByName(string name);//返回帶有給定名稱的水印
}

使用水印的類:事件

class Watermark {public:	string name(); //返回水印的名稱	string value();//返回水印的值	bool blocked();//返回「Blocked」屬性	void setBlocked(bool value); //設置「Blocked」屬性}

 

▲許可證

用於處理許可證列表的類:ip

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();//返回購買許可證的訂單id
string comments();//返回許可的註釋
string serialNumber(); //返回許可證的序列號
bool blocked(); //返回「Blocked」屬性
void setBlocked(bool value); //設置「Blocked」屬性
}

 

▲文件

用於處理文件列表的類:

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();//設置選項
}

- 持續更新中 -

相關文章
相關標籤/搜索