-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
41 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
将 IDA Hexrays 语法书导出并转换为 codeql 的数据库 | ||
|
||
``` | ||
ida2codeql.bat 二进制文件目录 保存数据库的目录 | ||
``` | ||
|
||
bat 的内容 | ||
|
||
``` | ||
@echo off | ||
set bat_dir=%~dp0 | ||
set codeql_home=%bat_dir%\codeql | ||
set extractor_path=%bat_dir%\ida-extractor.exe | ||
set ida_path=%bat_dir%\IDA_PRO_7.7\ida.exe | ||
cd /d "%~dp0" | ||
if defined CODEQL_HOME ( | ||
set codeql_home=%CODEQL_HOME% | ||
) else ( | ||
echo "使用目录下的 codeql" | ||
) | ||
set codeql_path=%codeql_home%\codeql.exe | ||
set scheme_path=%codeql_home%\go\go.dbscheme | ||
set binary_path=%1 | ||
set ast_path=%binary_path%\out | ||
set db_path=%2 | ||
python ida-extractor.py "%ida_path%" "%binary_path%" | ||
python ida2codeql.py "%codeql_path%" "%scheme_path%" "%extractor_path%" "%db_path%" "%ast_path%" | ||
``` | ||
|
||
|
||
|
||
生成数据库后需要使用 vscode-codeql 的 go 语法写规则. |