模块分拆
This commit is contained in:
parent
337140a26e
commit
65dcfefc05
@ -4,7 +4,7 @@
|
|||||||
<content url="file://$MODULE_DIR$">
|
<content url="file://$MODULE_DIR$">
|
||||||
<sourceFolder url="file://$MODULE_DIR$/python_lib" isTestSource="false" />
|
<sourceFolder url="file://$MODULE_DIR$/python_lib" isTestSource="false" />
|
||||||
</content>
|
</content>
|
||||||
<orderEntry type="jdk" jdkName="Python 2.7" jdkType="Python SDK" />
|
<orderEntry type="jdk" jdkName="gencoding" jdkType="Python SDK" />
|
||||||
<orderEntry type="sourceFolder" forTests="false" />
|
<orderEntry type="sourceFolder" forTests="false" />
|
||||||
</component>
|
</component>
|
||||||
</module>
|
</module>
|
@ -1,4 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project version="4">
|
<project version="4">
|
||||||
<component name="ProjectRootManager" version="2" project-jdk-name="Python 2.7" project-jdk-type="Python SDK" />
|
<component name="Black">
|
||||||
|
<option name="sdkName" value="gencoding" />
|
||||||
|
</component>
|
||||||
|
<component name="ProjectRootManager" version="2" project-jdk-name="gencoding" project-jdk-type="Python SDK" />
|
||||||
</project>
|
</project>
|
@ -21,19 +21,15 @@ import pickle
|
|||||||
# sub_10F20 308 反编译代码有字符串,但是这个特征提取里没有字符串 constant,可能是间接引用的,不识别。看了下所有函数的特征,几乎都没有字符串常量,可能都是写在别的地方然后引用的。
|
# sub_10F20 308 反编译代码有字符串,但是这个特征提取里没有字符串 constant,可能是间接引用的,不识别。看了下所有函数的特征,几乎都没有字符串常量,可能都是写在别的地方然后引用的。
|
||||||
# sub_166C4 393
|
# sub_166C4 393
|
||||||
|
|
||||||
|
def main_op(file_path, jsonl_file):
|
||||||
|
|
||||||
if __name__ == '__main__':
|
|
||||||
done_index = 0
|
done_index = 0
|
||||||
file_name_list = os.listdir('../A2C/')
|
file_name_list = os.listdir(file_path)
|
||||||
res_file = "../sample.jsonl"
|
sample_file = open(jsonl_file, mode='a')
|
||||||
sample_file = open(res_file, mode='a')
|
|
||||||
for file_name in file_name_list:
|
for file_name in file_name_list:
|
||||||
print file_name
|
print file_name
|
||||||
file_path = '../A2C/' + file_name
|
file_path_temp = file_path + file_name
|
||||||
testpath = '../store/' + file_name + '.ida'
|
if os.path.exists(file_path_temp) :
|
||||||
if os.path.exists(testpath) and os.path.splitext(file_path)[-1].lower() == '.exe':
|
fr = open(file_path_temp, 'r')
|
||||||
fr = open(testpath, 'r')
|
|
||||||
data1 = pickle.load(fr) # 一个二进制文件的acfgs
|
data1 = pickle.load(fr) # 一个二进制文件的acfgs
|
||||||
# funtion num
|
# funtion num
|
||||||
function_number = len(data1.raw_graph_list)
|
function_number = len(data1.raw_graph_list)
|
||||||
@ -109,3 +105,8 @@ if __name__ == '__main__':
|
|||||||
print "删除文件" + file_path
|
print "删除文件" + file_path
|
||||||
os.remove(file_path)
|
os.remove(file_path)
|
||||||
sample_file.close()
|
sample_file.close()
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
file_path = "../train_malware_result/"
|
||||||
|
jsonl_path = "../jsonl_res/malware_result.jsonl"
|
||||||
|
main_op(file_path, jsonl_path)
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import itertools
|
import itertools
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
sys.path.insert(1, 'C:/Python27/Lib/site-packages')
|
|
||||||
import networkx as nx
|
import networkx as nx
|
||||||
# import numpy as np
|
# import numpy as np
|
||||||
from subprocess import Popen, PIPE
|
from subprocess import Popen, PIPE
|
||||||
|
Loading…
Reference in New Issue
Block a user