侯体宗的博客
  • 首页
  • Hyperf版
  • beego仿版
  • 人生(杂谈)
  • 技术
  • 关于我
  • 更多分类
    • 文件下载
    • 文字修仙
    • 中国象棋ai
    • 群聊
    • 九宫格抽奖
    • 拼图
    • 消消乐
    • 相册

使用pyinstaller逆向.pyc文件

Python  /  管理员 发布于 5年前   548

搭建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:   [email protected]@organization: Volatility Foundation"""import sysif 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 psycoexcept ImportError:  passif False:  import yaraimport textwrap, volatility.conf as confconfig = 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 scanconfig.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 resultdef 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  returnif __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

以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持。


  • 上一条:
    利用PyCharm操作Github(仓库新建、更新,代码回滚)
    下一条:
    py-charm延长试用期限实例
  • 昵称:

    邮箱:

    0条评论 (评论内容有缓存机制,请悉知!)
    最新最热
    • 分类目录
    • 人生(杂谈)
    • 技术
    • linux
    • Java
    • php
    • 框架(架构)
    • 前端
    • ThinkPHP
    • 数据库
    • 微信(小程序)
    • Laravel
    • Redis
    • Docker
    • Go
    • swoole
    • Windows
    • Python
    • 苹果(mac/ios)
    • 相关文章
    • 在python语言中Flask框架的学习及简单功能示例(0个评论)
    • 在Python语言中实现GUI全屏倒计时代码示例(0个评论)
    • Python + zipfile库实现zip文件解压自动化脚本示例(0个评论)
    • python爬虫BeautifulSoup快速抓取网站图片(1个评论)
    • vscode 配置 python3开发环境的方法(0个评论)
    • 近期文章
    • 在go中实现一个常用的先进先出的缓存淘汰算法示例代码(0个评论)
    • 在go+gin中使用"github.com/skip2/go-qrcode"实现url转二维码功能(0个评论)
    • 在go语言中使用api.geonames.org接口实现根据国际邮政编码获取地址信息功能(1个评论)
    • 在go语言中使用github.com/signintech/gopdf实现生成pdf分页文件功能(0个评论)
    • gmail发邮件报错:534 5.7.9 Application-specific password required...解决方案(0个评论)
    • 欧盟关于强迫劳动的规定的官方举报渠道及官方举报网站(0个评论)
    • 在go语言中使用github.com/signintech/gopdf实现生成pdf文件功能(0个评论)
    • Laravel从Accel获得5700万美元A轮融资(0个评论)
    • 在go + gin中gorm实现指定搜索/区间搜索分页列表功能接口实例(0个评论)
    • 在go语言中实现IP/CIDR的ip和netmask互转及IP段形式互转及ip是否存在IP/CIDR(0个评论)
    • 近期评论
    • 122 在

      学历:一种延缓就业设计,生活需求下的权衡之选中评论 工作几年后,报名考研了,到现在还没认真学习备考,迷茫中。作为一名北漂互联网打工人..
    • 123 在

      Clash for Windows作者删库跑路了,github已404中评论 按理说只要你在国内,所有的流量进出都在监控范围内,不管你怎么隐藏也没用,想搞你分..
    • 原梓番博客 在

      在Laravel框架中使用模型Model分表最简单的方法中评论 好久好久都没看友情链接申请了,今天刚看,已经添加。..
    • 博主 在

      佛跳墙vpn软件不会用?上不了网?佛跳墙vpn常见问题以及解决办法中评论 @1111老铁这个不行了,可以看看近期评论的其他文章..
    • 1111 在

      佛跳墙vpn软件不会用?上不了网?佛跳墙vpn常见问题以及解决办法中评论 网站不能打开,博主百忙中能否发个APP下载链接,佛跳墙或极光..
    • 2016-10
    • 2016-11
    • 2018-04
    • 2020-03
    • 2020-04
    • 2020-05
    • 2020-06
    • 2022-01
    • 2023-07
    • 2023-10
    Top

    Copyright·© 2019 侯体宗版权所有· 粤ICP备20027696号 PHP交流群

    侯体宗的博客