使用pyinstaller逆向.pyc文件


Posted in Python onDecember 20, 2019

搭建python环境

1.百度搜索python3.7下载,找到官网下载安装包,运行安装包并配置环境变量。

使用pyinstaller逆向.pyc文件

使用pyinstaller逆向.pyc文件

使用pyinstaller逆向.pyc文件

2.这里一定要安装python3.7版本的,我之前安装python3.5,不能正常使用pyinstalller库。

使用pyinstaller逆向.pyc文件

3.能显示一下界面说明安装成功

使用pyinstaller逆向.pyc文件

安装pyintaller

1.进入scripts脚本目录,执行pip install pyinstaller,不过我这里已经下好了。

使用pyinstaller逆向.pyc文件

2.使用archive_viewer.py工具,提取出CM.pyc文件,接着open PYZ-00.pyz压缩包,提取出压缩包中的两个.pyc文件。

使用pyinstaller逆向.pyc文件

使用pyinstaller逆向.pyc文件

使用pyinstaller逆向.pyc文件

3.编辑三个.pyc文件,就是PyInstaller在打包.pyc时,会把.pyc的magic和时间戳去掉,所以需要手工修复,在文件的头部插入03 F3 0D 0A 74 a7cf 5c。

使用pyinstaller逆向.pyc文件

4.用pip install uncompyle6命令语句, 下载uncompyle6 工具,接着反汇编

使用pyinstaller逆向.pyc文件

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

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

Python 相关文章推荐
python socket 超时设置 errno 10054
Jul 01 Python
Python之PyUnit单元测试实例
Oct 11 Python
Python程序中使用SQLAlchemy时出现乱码的解决方案
Apr 24 Python
在python中使用with打开多个文件的方法
Jan 07 Python
PythonWeb项目Django部署在Ubuntu18.04腾讯云主机上
Apr 01 Python
基于Python实现签到脚本过程解析
Oct 25 Python
python多进程并发demo实例解析
Dec 13 Python
利用keras加载训练好的.H5文件,并实现预测图片
Jan 24 Python
给ubuntu18安装python3.7的详细教程
Jun 08 Python
python获取命令行参数实例方法讲解
Nov 02 Python
Python+unittest+requests+excel实现接口自动化测试框架
Dec 23 Python
Python使用Turtle模块绘制国旗的方法示例
Feb 28 Python
Python3 实现减少可调用对象的参数个数
Dec 20 #Python
python获取引用对象的个数方式
Dec 20 #Python
Python 获取命令行参数内容及参数个数的实例
Dec 20 #Python
python 读写文件包含多种编码格式的解决方式
Dec 20 #Python
pandas 中对特征进行硬编码和onehot编码的实现
Dec 20 #Python
使用python3批量下载rbsp数据的示例代码
Dec 20 #Python
Python使用QQ邮箱发送邮件报错smtplib.SMTPAuthenticationError
Dec 20 #Python
You might like
星际争霸秘籍
2020/03/04 星际争霸
AJAX for PHP简单表数据查询实例
2007/01/02 PHP
如何使用jQuery+PHP+MySQL来实现一个在线测试项目
2015/04/26 PHP
thinkPHP5.0框架引入Traits功能实例分析
2017/03/18 PHP
Laravel 添加多语言提示信息的方法
2019/09/29 PHP
Javascript 布尔型分析
2008/12/22 Javascript
基于jquery的图片懒加载js
2010/06/30 Javascript
javascript椭圆旋转相册实现代码
2012/01/16 Javascript
Jquery实现兼容各大浏览器的Enter回车切换输入焦点的方法
2014/09/01 Javascript
jQuery 复合选择器应用的几个例子
2014/09/11 Javascript
javascript中Math.random()使用详解
2015/04/15 Javascript
Node.js编程中客户端Session的使用详解
2015/06/23 Javascript
JS使用JSON作为参数实例分析
2016/06/23 Javascript
微信小程序-小说阅读小程序实例(demo)
2017/01/12 Javascript
JS实现页面打印(整体、局部)
2017/08/18 Javascript
VsCode插件整理(小结)
2017/09/14 Javascript
Vue封装一个简单轻量的上传文件组件的示例
2018/03/21 Javascript
Vue.js组件实现选项卡以及切换特效
2019/07/24 Javascript
node.js实现http服务器与浏览器之间的内容缓存操作示例
2020/02/11 Javascript
Django日志模块logging的配置详解
2017/02/14 Python
Python中的单继承与多继承实例分析
2018/05/10 Python
django 解决manage.py migrate无效的问题
2018/05/27 Python
PyCharm更改字体和界面样式的方法步骤
2019/09/27 Python
python爬取代理IP并进行有效的IP测试实现
2020/10/09 Python
详解Html5 Canvas画线有毛边解决方法
2018/03/01 HTML / CSS
关于canvas绘制模糊问题的解决方法
2019/09/24 HTML / CSS
Converse匡威法国官网:美国著名帆布鞋品牌
2018/12/05 全球购物
西班牙购买隐形眼镜、眼镜和太阳镜网站:Lentiamo.es
2020/06/11 全球购物
电大物流学生的自我评价
2013/10/25 职场文书
俄语专业职业生涯规划
2014/02/26 职场文书
怀念母亲教学反思
2014/04/28 职场文书
期末评语大全
2014/05/04 职场文书
供用电专业求职信
2014/07/07 职场文书
2014年宣传部个人工作总结
2014/12/06 职场文书
Python一行代码实现自动发邮件功能
2021/05/30 Python
看完这篇文章获得一些java if优化技巧
2021/07/15 Java/Android