使用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使用Bottle来提供一个简单的web服务
Dec 27 Python
python对视频画框标记后保存的方法
Dec 07 Python
钉钉群自定义机器人消息Python封装的实例
Feb 20 Python
python之pyqt5通过按钮改变Label的背景颜色方法
Jun 13 Python
python实现beta分布概率密度函数的方法
Jul 08 Python
浅析python,PyCharm,Anaconda三者之间的关系
Nov 27 Python
Python使用PyQt5/PySide2编写一个极简的音乐播放器功能
Feb 07 Python
Python中zip()函数的解释和可视化(实例详解)
Feb 16 Python
Python lxml库的简单介绍及基本使用讲解
Dec 22 Python
scrapy实践之翻页爬取的实现
Jan 05 Python
Python Pandas pandas.read_sql_query函数实例用法分析
Jun 21 Python
PO模式在selenium自动化测试框架的优势
Mar 20 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
php数组函数序列之each() - 获取数组当前内部指针所指向元素的键名和键值,并将指针移到下一位
2011/10/31 PHP
PHP+MySQL实现无极限分类栏目的方法
2015/12/23 PHP
运用Windows XP附带的Msicuu.exe、Msizap.exe来彻底卸载顽固程序
2007/04/21 Javascript
JS类的封装及实现代码
2009/12/02 Javascript
jquery数组之存放checkbox全选值示例代码
2013/12/20 Javascript
自写的jQuery异步加载数据添加事件
2014/05/15 Javascript
一个实用的图片切换支持点击切换和自动轮播
2014/09/09 Javascript
使用JavaScript实现ajax的实例代码
2016/05/11 Javascript
JS弹出窗口插件zDialog简单用法示例
2016/06/12 Javascript
window.close(); 关闭浏览器窗口js代码的总结介绍
2016/07/14 Javascript
微信小程序  action-sheet详解及实例代码
2016/11/09 Javascript
jQuery实现简单弹窗遮罩效果
2017/02/27 Javascript
vue axios用法教程详解
2017/07/23 Javascript
微信小程序wx.uploadfile 本地文件转base64的实现代码
2018/06/28 Javascript
JS获取月的第几周和年的第几周实例代码
2018/12/05 Javascript
详解vue-cli项目在IE浏览器打开报错解决方法
2020/12/10 Vue.js
Python实现文件按照日期命名的方法
2015/07/09 Python
Python Flask-web表单使用详解
2017/11/18 Python
python实现爬山算法的思路详解
2019/04/09 Python
python中多个装饰器的调用顺序详解
2019/07/16 Python
基于python实现的百度新歌榜、热歌榜下载器(附代码)
2019/08/05 Python
Flask框架学习笔记之模板操作实例详解
2019/08/15 Python
简单了解python协程的相关知识
2019/08/31 Python
Python可变参数会自动填充前面的默认同名参数实例
2019/11/18 Python
Python 中@property的用法详解
2020/01/15 Python
用Python 执行cmd命令
2020/12/18 Python
Pandas数据分析的一些常用小技巧
2021/02/07 Python
英国最大的在线床超市:Bed Star
2019/01/24 全球购物
澳大利亚家用电器在线商店:Billy Guyatts
2020/05/05 全球购物
打架检讨书400字
2014/01/17 职场文书
大学同学聚会邀请函
2014/01/19 职场文书
大学生校园创业计划书
2014/02/08 职场文书
《李时珍夜宿古寺》教学反思
2014/04/09 职场文书
人事行政主管岗位职责
2015/04/09 职场文书
婚礼领导致辞大全
2015/07/28 职场文书
js判断两个数组相等的5种方法
2022/05/06 Javascript