使用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 相关文章推荐
使用70行Python代码实现一个递归下降解析器的教程
Apr 17 Python
使用Python设计一个代码统计工具
Apr 04 Python
python 顺时针打印矩阵的超简洁代码
Nov 14 Python
python远程连接MySQL数据库
Apr 19 Python
python 上下文管理器及自定义原理解析
Nov 19 Python
python pygame实现球球大作战
Nov 25 Python
Python3 元组tuple入门基础
Feb 09 Python
Django更新models数据库结构步骤
Apr 01 Python
python利用蒙版抠图(使用PIL.Image和cv2)输出透明背景图
Aug 04 Python
python os.listdir()乱码解决方案
Jan 31 Python
Python将CSV文件转化为HTML文件的操作方法
Jun 30 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实现随机生成易于记忆的密码
2015/06/19 PHP
PHP获取访问设备信息的方法示例
2019/02/20 PHP
jQuery 位置插件
2008/12/25 Javascript
javascript使用activex控件的代码
2011/01/27 Javascript
基于jquery的多功能软键盘插件
2012/07/25 Javascript
javascript中Date对象的getDay方法使用指南
2014/12/22 Javascript
深入分析Javascript跨域问题
2015/04/17 Javascript
简介JavaScript中POSITIVE_INFINITY值的使用
2015/06/05 Javascript
jquery实现顶部向右伸缩的导航区域代码
2015/09/02 Javascript
javascript运算符——逻辑运算符全面解析
2016/06/27 Javascript
微信小程序 form组件详解及简单实例
2017/01/10 Javascript
ReactJs设置css样式的方法
2017/06/08 Javascript
js es6系列教程 - 新的类语法实战选项卡(详解)
2017/09/02 Javascript
JS加密插件CryptoJS实现AES加密操作示例
2018/08/16 Javascript
angular 实时监听input框value值的变化触发函数方法
2018/08/31 Javascript
原生js滑动轮播封装
2020/07/31 Javascript
微信小程序实现文件预览
2020/10/22 Javascript
js实现简易拖拽的示例
2020/10/26 Javascript
JavaScript实现缓动动画
2020/11/25 Javascript
[06:36]吞吞映像top1
2014/06/20 DOTA
[36:45]TNC vs VGJ.S 2018国际邀请赛小组赛BO2 第二场 8.18
2018/08/19 DOTA
python对数组进行反转的方法
2015/05/20 Python
Python检测一个对象是否为字符串类的方法
2015/05/21 Python
Django框架用户注销功能实现方法分析
2019/05/28 Python
基于Python爬取51cto博客页面信息过程解析
2020/08/25 Python
Python命令行参数argv和argparse该如何使用
2021/02/08 Python
解决pip安装tensorflow中出现的no module named tensorflow.python 问题方法
2021/02/20 Python
利用HTML5 Canvas API绘制矩形的超级攻略
2016/03/21 HTML / CSS
成品仓管员岗位职责
2013/12/11 职场文书
幼儿园教师奖惩制度
2014/02/01 职场文书
酒店总经理岗位职责范本
2014/08/08 职场文书
工伤事故赔偿协议书范文
2014/09/24 职场文书
公务员个人考察材料
2014/12/23 职场文书
导游词之西湖雷峰塔
2019/09/18 职场文书
用Python写一个简易版弹球游戏
2021/04/13 Python
利用Python脚本写端口扫描器socket,python-nmap
2022/07/23 Python