使用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 相关文章推荐
windows下安装python paramiko模块的代码
Feb 10 Python
python发送邮件接收邮件示例分享
Jan 21 Python
简单介绍Python的Tornado框架中的协程异步实现原理
Apr 23 Python
python3 pandas 读取MySQL数据和插入的实例
Apr 20 Python
使用pandas read_table读取csv文件的方法
Jul 04 Python
python使用udp实现聊天器功能
Dec 10 Python
python找出列表中大于某个阈值的数据段示例
Nov 24 Python
Pytorch 多维数组运算过程的索引处理方式
Dec 27 Python
解决TensorFlow GPU版出现OOM错误的问题
Feb 03 Python
Python统计文本词汇出现次数的实例代码
Feb 27 Python
Anaconda的安装及其环境变量的配置详解
Apr 22 Python
python 用递归实现通用爬虫解析器
Apr 16 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函数篇详解十进制、二进制、八进制和十六进制转换函数说明
2011/12/05 PHP
分享一个PHP数据流应用的简单例子
2012/06/01 PHP
如何解决CI框架的Disallowed Key Characters错误提示
2013/07/05 PHP
PHP 抽象方法与抽象类abstract关键字介绍及应用
2014/10/16 PHP
php生成4位数字验证码的实现代码
2015/11/23 PHP
PHP使用内置函数file_put_contents写入文件及追加内容的方法
2015/12/07 PHP
php array_walk_recursive 使用自定的函数处理数组中的每一个元素
2016/11/16 PHP
基于php解决json_encode中文UNICODE转码问题
2020/11/10 PHP
基于jQuery的动态增删改查表格信息,可左键/右键提示(原创自Zjmainstay)
2012/07/31 Javascript
全面解析Bootstrap中tab(选项卡)的使用方法
2016/06/06 Javascript
给easyui datebox扩展一个清空的实例
2016/11/09 Javascript
老生常谈angularjs中的$state.go
2017/04/24 Javascript
深究AngularJS——ng-checked(回写:带真实案例代码)
2017/06/13 Javascript
Dropify.js图片宽高自适应的方法
2017/11/27 Javascript
vue实现移动端悬浮窗效果
2018/12/01 Javascript
vue elementUI 表单校验功能之数组多层嵌套
2019/06/04 Javascript
layui之table checkbox初始化时选中对应选项的方法
2019/09/02 Javascript
Python获取网页上图片下载地址的方法
2015/03/11 Python
Python实现包含min函数的栈
2016/04/29 Python
centos 安装python3.6环境并配置虚拟环境的详细教程
2018/02/22 Python
python自动查询12306余票并发送邮箱提醒脚本
2018/05/21 Python
python爬虫豆瓣网的模拟登录实现
2019/08/21 Python
python实现mask矩阵示例(根据列表所给元素)
2020/07/30 Python
Python threading模块condition原理及运行流程详解
2020/10/05 Python
css3 实现滚动条美化效果的实例代码
2021/01/06 HTML / CSS
浅析canvas元素的html尺寸和css尺寸对元素视觉的影响
2019/07/22 HTML / CSS
JDBC操作数据库的基本流程是什么
2014/10/28 面试题
中专毕业生自我鉴定范文
2013/11/09 职场文书
应届毕业生求职信范文
2013/12/18 职场文书
我的中国梦演讲稿400字
2014/08/19 职场文书
小区的门卫岗位职责
2014/10/01 职场文书
教育见习报告范文
2014/11/03 职场文书
学校教学工作总结2015
2015/05/19 职场文书
Python内置数据类型中的集合详解
2022/03/18 Python
使用CSS实现黑白格背景效果
2022/06/01 HTML / CSS
mysqldump进行数据备份详解
2022/07/15 MySQL