Python - Volatility ImageInfo 에서 중요한 결과만 추출하기
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
|
#Written by Pental
import re
import string
# Function
#Find Unique Word
def findSentence(fileName, findText):
file = open(fileName, mode="r", encoding="utf8")
result = []
data = file.read()
data = data.splitlines()
for line in data:
sentences = line.split(". ")
for sentence in sentences:
sentence = sentence.strip(".")
if findText in sentence:
result.append(sentence + ".")
file.close()
return result
#Delete Special Text
def cleanText(readData):
text = re.sub('[(),:.]','',readData)
return text
#---------------Find Image--------------
#Find Unique Word (Win)
result = findSentence("image.txt", "Win")
for sentence in result:
extact_sentece = sentence
if __name__ == "__main__":
oriText = extact_sentece
# print('Del Special word : ', cleanText(oriText))
del_speical_word_image = cleanText(oriText)
#Del SpaceBar
replace_space_bar_image = del_speical_word_image.replace(" ","")
image_information = replace_space_bar_image[17:28]
print ('Image Profile :',image_information)
#--------------------------FileAddressSpace---------------------
fileaddress = findSentence("image.txt", "FileAddressSpace")
#Del Unique Word - File Space
for sentence in fileaddress:
file_space = sentence
if __name__ == "__main__":
oriText = file_space
del_speical_word_file_space = cleanText(oriText)
#Del Space Bar - File Space
replace_space_bar_file_space = del_speical_word_file_space.replace(" ","")
file_space = replace_space_bar_file_space[24:]
print ('Image File Address :',file_space)
#------------Image date and time--------------
imagedataandtime = findSentence("image.txt", "Image date and time")
#Del Unique Word - Image date and time
for sentence in imagedataandtime:
image_data_and_time = sentence
if __name__ == "__main__":
oriText = image_data_and_time
del_speical_word_image_data_and_time = cleanText(oriText)
#Del Space Bar - Image date and time
replace_space_bar_image_data_and_time = del_speical_word_image_data_and_time.replace(" ","",12)
image_data_and_time = replace_space_bar_image_data_and_time[20:]
print ('Image Data And Time :',image_data_and_time)
|
cs |
'Programming > Python' 카테고리의 다른 글
[정올] 2809 : 약수 (0) | 2020.03.24 |
---|---|
[정올] 1658 : 최대공약수와최소공배수 (0) | 2020.03.24 |
python - 공백줄 삭제 (0) | 2020.03.15 |
Python - Volatility Cmdscan 에서 중요한 정보만 추출하기 (0) | 2019.11.21 |
Python - Volatility pslist 에서 특정 프로세스만 추출하기 (0) | 2019.11.21 |
댓글
이 글 공유하기
다른 글
-
[정올] 1658 : 최대공약수와최소공배수
[정올] 1658 : 최대공약수와최소공배수
2020.03.24 -
python - 공백줄 삭제
python - 공백줄 삭제
2020.03.15 -
Python - Volatility Cmdscan 에서 중요한 정보만 추출하기
Python - Volatility Cmdscan 에서 중요한 정보만 추출하기
2019.11.21 -
Python - Volatility pslist 에서 특정 프로세스만 추출하기
Python - Volatility pslist 에서 특정 프로세스만 추출하기
2019.11.21