Skip to content

Commit

Permalink
可输出自身版本信息
Browse files Browse the repository at this point in the history
  • Loading branch information
qux-bbb committed Aug 12, 2022
1 parent dc447f0 commit d3b7051
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

setup(
name='xanalyzer',
version='0.2.1',
version=open('xanalyzer/VERSION', 'r').read(),
packages=find_packages(),
package_data={
'xanalyzer': [
Expand Down
1 change: 1 addition & 0 deletions xanalyzer/VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0.2.1
1 change: 1 addition & 0 deletions xanalyzer/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ class Config:
# UserDB.TXT文件默认是GBK编码, 需要简单处理一下, 去掉乱码, 新的UserDB.TXT加了新的规则, peutils解析不了
peid_signature_path = home_dir / 'data' / 'UserDB.TXT'
tools_info_path = home_dir / 'data' / 'tools_info.json'
VERSION = open(home_dir / 'VERSION', 'r').read().strip()

conf = {}

Expand Down
5 changes: 5 additions & 0 deletions xanalyzer/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,14 @@ def main():
group = parser.add_mutually_exclusive_group(required=True)
group.add_argument('-f', '--file', nargs='+', help='analyze one or more files, can be a folder path')
group.add_argument('-u', '--url', help='analyze the url')
group.add_argument('--version', action='store_true', help='print version info')
parser.add_argument('-s', '--save', action='store_true', help='save log and data')
args = parser.parse_args()

if args.version:
print(Config.VERSION)
return

Config.init(args.save)
init_log()

Expand Down

0 comments on commit d3b7051

Please sign in to comment.