使用pyinstaller逆向.pyc文件
作者:buzhifou01 发布时间:2021-09-10 01:34:23
标签:pyinstaller,逆向,pyc
搭建python环境
1.百度搜索python3.7下载,找到官网下载安装包,运行安装包并配置环境变量。
2.这里一定要安装python3.7版本的,我之前安装python3.5,不能正常使用pyinstalller库。
3.能显示一下界面说明安装成功
安装pyintaller
1.进入scripts脚本目录,执行pip install pyinstaller,不过我这里已经下好了。
2.使用archive_viewer.py工具,提取出CM.pyc文件,接着open PYZ-00.pyz压缩包,提取出压缩包中的两个.pyc文件。
3.编辑三个.pyc文件,就是PyInstaller在打包.pyc时,会把.pyc的magic和时间戳去掉,所以需要手工修复,在文件的头部插入03 F3 0D 0A 74 a7cf 5c。
4.用pip install uncompyle6命令语句, 下载uncompyle6 工具,接着反汇编
CM.py代码如下:
# uncompyle6 version 3.6.0
# Python bytecode 2.7 (62211)
# Decompiled from: Python 3.7.4 (tags/v3.7.4:e09359112e, Jul 8 2019, 20:34:20) [MSC v.1916 64 bit (AMD64)]
# Embedded file name: b'D:\\\xd7\xca\xc1\xcf\xce\xc4\xbc\xfe\\a\xd1\xd0\xbe\xbf\xb7\xbd\xcf\xf2\xb2\xce\xbf\xbc\xd7\xca\xc1\xcf\\3-\xbc\xc6\xcb\xe3\xbb\xfa\xc8\xa1\xd6\xa4(\xd6\xd8\xb5\xe3)\\\xbf\xf2\xbc\xdc\\volatility\xce\xc4\xbc\xfe\\volatility-master\\vol.py'
# Compiled at: 2018-12-07 00:22:54
"""
@author: AAron Walters
@license: GNU General Public License 2.0
@contact: awalters@4tphi.net
@organization: Volatility Foundation
"""
import sys
if sys.version_info < (2, 6, 0):
sys.stderr.write('Volatility requires python version 2.6, please upgrade your python installation.')
sys.exit(1)
try:
import psyco
except ImportError:
pass
if False:
import yara
import textwrap, volatility.conf as conf
config = conf.ConfObject()
import volatility.constants as constants, volatility.registry as registry, volatility.exceptions as exceptions, volatility.obj as obj, volatility.debug as debug, volatility.addrspace as addrspace, volatility.commands as commands, volatility.scan as scan
config.add_option('INFO', default=None, action='store_true', cache_invalidator=False, help='Print information about all registered objects')
def list_plugins():
result = '\n\tSupported Plugin Commands:\n\n'
cmds = registry.get_plugin_classes(commands.Command, lower=True)
profs = registry.get_plugin_classes(obj.Profile)
if config.PROFILE == None:
config.update('PROFILE', 'WinXPSP2x86')
assert not config.PROFILE not in profs, 'Invalid profile ' + config.PROFILE + ' selected'
profile = profs[config.PROFILE]()
wrongprofile = ''
for cmdname in sorted(cmds):
command = cmds[cmdname]
helpline = command.help() or ''
for line in helpline.splitlines():
if line:
helpline = line
break
if command.is_valid_profile(profile):
result += ('\t\t{0:15}\t{1}\n').format(cmdname, helpline)
else:
wrongprofile += ('\t\t{0:15}\t{1}\n').format(cmdname, helpline)
if wrongprofile and config.VERBOSE:
result += '\n\tPlugins requiring a different profile:\n\n'
result += wrongprofile
return result
def command_help(command):
outputs = []
for item in dir(command):
if item.startswith('render_'):
outputs.append(item.split('render_', 1)[(-1)])
outputopts = '\nModule Output Options: ' + ('{0}\n').format(('{0}').format(('\n').join([(', ').join(o for o in sorted(outputs))])))
result = textwrap.dedent(('\n ---------------------------------\n Module {0}\n ---------------------------------\n').format(command.__class__.__name__))
return outputopts + result + command.help() + '\n\n'
def print_info():
""" Returns the results """
categories = {addrspace.BaseAddressSpace: 'Address Spaces', commands.Command: 'Plugins',
obj.Profile: 'Profiles',
scan.ScannerCheck: 'Scanner Checks'}
for c, n in sorted(categories.items()):
lower = c == commands.Command
plugins = registry.get_plugin_classes(c, lower=lower)
print '\n'
print ('{0}').format(n)
print '-' * len(n)
result = []
max_length = 0
for clsname, cls in sorted(plugins.items()):
try:
doc = cls.__doc__.strip().splitlines()[0]
except AttributeError:
doc = 'No docs'
result.append((clsname, doc))
max_length = max(len(clsname), max_length)
for name, doc in result:
print ('{0:{2}} - {1:15}').format(name, doc, max_length)
def main():
sys.stderr.write(('Volatility Foundation Volatility Framework {0}\n').format(constants.VERSION))
sys.stderr.flush()
debug.setup()
registry.PluginImporter()
registry.register_global_options(config, addrspace.BaseAddressSpace)
registry.register_global_options(config, commands.Command)
if config.INFO:
print_info()
sys.exit(0)
config.parse_options(False)
debug.setup(config.DEBUG)
module = None
cmds = registry.get_plugin_classes(commands.Command, lower=True)
for m in config.args:
if m in cmds.keys():
module = m
break
if not module:
config.parse_options()
debug.error('You must specify something to do (try -h)')
try:
if module in cmds.keys():
command = cmds[module](config)
config.set_help_hook(obj.Curry(command_help, command))
config.parse_options()
if not config.LOCATION:
debug.error('Please specify a location (-l) or filename (-f)')
command.execute()
except exceptions.VolatilityException as e:
print e
return
if __name__ == '__main__':
config.set_usage(usage='Volatility - A memory forensics analysis platform.')
config.add_help_hook(list_plugins)
try:
main()
except Exception as ex:
if config.DEBUG:
debug.post_mortem()
else:
raise
except KeyboardInterrupt:
print 'Interrupted'
# okay decompiling CM.pyc
来源:https://blog.csdn.net/qq_33526144/article/details/103616487


猜你喜欢
- 原因:使用git clone项目后,项目根路径是小写英文名称,比如cmdbapi,但是项目里面的import导入自己的相关包时,红色报错解决
- 前言Tenacity是一个 Apache 2.0授权的通用重试库,用 Python 编写,用于简化向几乎所有内容添加重试行为的任务。它起源于
- 一些杀毒软件经常会把某些asp文件当成病毒删除,如卡巴斯基杀毒软件就经常把网页中有Microsoft.XMLHTTP 的当作病毒,有时简直防
- 本文详细讲述了Python使用MySQLdb for Python操作数据库的方法,分享给大家供大家参考。具体如下:一般来说网站就是要和数据
- (1)标准类型操作符(所有的集合类型)成员关系 (in, not in) &nbs
- 最近在写的一个django小项目需要实现用户上传图片的功能,使用到了七牛云存储,特此记录下来。这里我使用的七牛python SDK 版本是7
- 最近拾回Django学习,实例练习中遇到了对多维字典类型数据的遍历操作问题,Google查询没有相关资料…毕竟是新手,到自己动手时发现并非想
- 请问如何实现复合查询?我们用下面的代码来实现动态生成查询条件,动态显示结果的复合查询。set database to databasenam
- 这是初始状态 输入文字变成这样,这里会区分圆角半角,2个半角的文字算一个。 这个是超出的样子 如果超出了点击提
- 将mat文件转为png花费了很大力气做这件事,总是出现各种错误,现在终于解决了from PIL import Imageimport mat
- 本文实例为大家分享了python实现学生信息管理系统的具体代码,含代码注释、增删改查、排序、统计显示学生信息,供大家参考,具体内容如下运行如
- 神经网络框架使用方法及设计思想在框自己手写架上基本模仿pytorch,用以学习神经网络的基本算法,如前向传播、反向传播、各种层、各种激活函数
- 上一篇讲了《Python入门》Windows 7下Python Web开发环境搭建笔记,接下来讲一下Python语言Web服务的具体实现:第
- 网站设计时,有一个最常用的指导性原则:页面长度原则上不超过3屏,宽度不超过1屏。这个原则明显是从用户的体验出发,特别是宽度不超过一屏,其最基
- 对于内容驱动的网站,设计好坏的关键是关系型数据库。在这个教程中,我们已经使用了MySQL关系型数据库管理系统(RDBMS)建立了我们的数据库
- 一、读取Excel中的数据安装xlrd 只能读取Excel内容pip install xlrd==1.2.0xlrd库的open_workb
- 字体的处理在网页设计中无论怎么强调也不为过,毕竟网页使用来传递信息的,而最经典最直接的信息传递方式就是
- 介绍在机器视觉领域的深度学习中,每个数据集都有一份标注好的数据用于训练神经网络。为了节省空间,很多数据集的标注文件使用RLE的格式。但是神经
- 问题你需要将数字格式化后输出,并控制数字的位数、对齐、千位分隔符和其他的细节。解决方案格式化输出单个数字的时候,可以使用内置的 format
- 本文实例讲述了MySQL 的启动选项和系统变量。分享给大家供大家参考,具体如下:MySQL的配置信息可以通过两种方式实现,一种是命令行形式,