使用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
0
投稿
猜你喜欢
- 目录1、吃金币2、打乒乓3、滑雪4、并夕夕版飞机大战5、打地鼠6、小恐龙7、消消乐8、俄罗斯方块9、贪吃蛇10、24点小游戏11、平衡木12
- 一、reversereverse()是python中列表的一个内置方法(在字典、字符串和元组中没有这个内置方法),用于列表中数据的反转例子:
- 在认证框架中还有其他的一些功能。 我们会在接下来的几个部分中进一步地了解它们。权限权限可以很方便地标识用户和用户组可以执行的操作。 它们被D
- DataFrame 是一个表格型的数据结构,它含有一组有序的列,每列可以是不同的值类型(数值、字符串、布尔型值)。DataFrame 既有行
- MenuEverywhere 是Mac OS X上的一款小程序,前一阵刚为其完成了程序图标设计。© 2011 IconMo
- int()是Python的一个内部函数 Python系统帮助里面是这么说的>>> help(int) Help
- type 所有类是type生成的a = 1b = "abc"print("type a:{}&qu
- Blog的全名应该是Web log,中文意思是“网络日志”,后来缩写为Blog,而博客(Blogger)就是写Blog的人。从理解上讲,博客
- 目录1. 常用的编码2.补充:计算机表示的单位:3.ASCII编码2.GBK和GB2312编码4.Unicode5.UTF-8编码6.编码和
- 环境:python2.7+django1.91、先下载django-sutipip install django-suit2、配置项目打开s
- 有很多种方法来实现图片的预加载,通常大部分使用Javascript让事情滚动。不要再受Javascript预载的束缚了吧,用CSS你就可以毫
- TMD这年头做前端真命苦,IE出了N个版本就算了,还跳出个马桶出来。你说你这个马桶,用人家内核就好好用拉。还改人家的东西干啥,那你改就改拉,
- 先看看结果吧,去bilibili上拿到的图片=-=第一步,导入模块import requestsfrom bs4 import Beauti
- ALTER TABLE将表更改为当前字符集。如果在执行ALTER TABLE操作期间遇到重复键错误,原因在于新的字符集将2个键映射到了相同值
- py读写修改常用的三种方法xlwt:用于写入 Excel 文件xlrd:用于读取 Excel 文件xlutils:用于操作 Excel 文件
- 1、matplotlib支持的颜色格式1.RGB 或者 RGBA 元组格式颜色元组中浮点型数值位于 [0, 1] 之间,e.g(0.1, 0
- 使用 scipy.signal 的 argrelextrema 函数(API),简单方便import numpy as np import
- 我们知道在超级链接的title属性中,是不支持html代码的,我们只能使用文本来处理提示信息。当然借助js可以做出很好的效果。这里讲一下如何
- 一,前言今天做的东西,还算可以,修改了若干个bug,自己又写成功的写了几个bug。增加了一个功能——
- ASP里两种常用的生成文件的方式是:利用ADODB.Stream生成文件和利用Scripting.FileSystemObject生成文件1