[转帖]Dump2PNG

dump2png · 浏览次数 : 0

小编点评

Sure, here is the summary you requested: **Dump2PNG** is a program that visualizes file data as a PNG. It can be used to analyze memory or core dumps by converting each byte to a colored pixel and building an image from these lines. **Features:** * Works with both memory and core dumps. * Masks the least significant bit to avoid privacy leaks. * Offers various palette options. * Can be optimized using the -O3 flag. **Usage:** To use Dump2PNG, simply pass the path to the file you want to convert to a PNG image to the `file` argument. You can also specify various options such as the palette, output file name, and zoom factor. **Example:** ``` ./dump2png core.node.13562 ``` This command will create an image called `core.png` containing the memory dump data of a node named `core.node.13562`. **Additional Notes:** * The -M flag prevents masking the least significant bit. * The -k flag specifies the number of lines to skip horizontally. * The -s flag specifies the byte offset to begin reading from. * The -z flag specifies the zoom factor, which determines the number of bytes to average together as a single pixel.

正文

https://github.com/brendangregg/Dump2PNG

 


Visualize file data as a png. Intended for memory or core dumps. This tool is an experiment, intended to characterize the memory usage of large process core dumps. It does by converting each byte to a colored pixel, and building an image from these line by line. For serious core dump analysis, look for other tools that read the metadata and structure from the dump. By default, the least significant bit is masked, so that the image can't be converted back to the input file, to avoid inadvertent privacy leaks. Use -M to avoid masking, or increase BYTE_MASK to mask more bits. 1. Build Using gcc: gcc -O3 -lm -lpng -o dump2png dump2png.c Requires libpng. This is a good candidate for optimization (-O3). 2. Usage $ ./dump2png --help USAGE: dump2png [-HM] [-w width] [-h height_max] [-p palette] [-o outfile.png] [-k skip_factor] [-s seek_bytes] [-z zoom_factor] file [--help] # for full help palette types: gray, gray16b, gray16l, gray32b, gray32l, hues, hues6, fhues, color, color16, color32, rgb, dvi, x86 (default). -H don't autoscale height -M don't mask least significant bit -k skip_factor skips horiz lines; eg, 3 means show 1 out of 3 -s seek_bytes the byte offset of the infile to begin reading -z zoom_factor averages multiple bytes; eg, 16 avgs 16 as 1 -z palette palette type for colorization: gray grayscale, per byte gray16b grayscale, per short (big-endian) gray16l grayscale, per short (little-endian) gray32b grayscale, per long (big-endian) gray32l grayscale, per long (little-endian) hues map to 3 hue ranges (rgb), per byte (zoom safe) hues6 map to 6 hue ranges (rgbcmy), per byte fhues map to 3 full hue ranges (rgb), per byte (zoom safe) color full colorized scale, per byte color16 full colorized scale, per short (16-bit) color32 full colorized scale, per long (32-bit) rgb treat 3 sequential bytes as RGB dvi use RGB to convey differential, value, integral x86 grayscale with some (9) color indicators: green = common english chars: 'e', 't', 'a' red = common x86 instructions: movl, call, testl blue = binary values: 0x01, 0x02, 0x03 3. Examples $ ./dump2png core.node.13562 # by default uses "x86" palette $ ./dump2png -w 2048 core # output image 2048 pixels wide $ ./dump2png -o out.png core # write to "out.png" $ ./dump2png -p gray core # grayscale palette $ ./dump2png -p color core # full color palette $ ./dump2png -p hues core # RGB hues only (zoom friendly) $ ./dump2png -z 32 core # Zoom out by 32x (32 bytes averaged as 1 pixel) $ ./dump2png -k 10 core # Include one horiz line out of 10 (skip 9) You can always open the images up in an image editor (eg, gimp) and apply more effects.

与[转帖]Dump2PNG相似的内容:

[转帖]Dump2PNG

https://github.com/brendangregg/Dump2PNG Visualize file data as a png. Intended for memory or core dumps. This tool is an experiment, intended to char

[转帖]

Linux ubuntu20.04 网络配置(图文教程) 因为我是刚装好的最小系统,所以很多东西都没有,在开始配置之前需要做下准备 环境准备 系统:ubuntu20.04网卡:双网卡 网卡一:供连接互联网使用网卡二:供连接内网使用(看情况,如果一张网卡足够,没必要做第二张网卡) 工具: net-to

[转帖]

https://cloud.tencent.com/developer/article/2168105?areaSource=104001.13&traceId=zcVNsKTUApF9rNJSkcCbB 前言 Redis作为高性能的内存数据库,在大数据量的情况下也会遇到性能瓶颈,日常开发中只有时刻

[转帖]ISV 、OSV、 SIG 概念

ISV 、OSV、 SIG 概念 2022-10-14 12:29530原创大杂烩 本文链接:https://www.cndba.cn/dave/article/108699 1. ISV: Independent Software Vendors “独立软件开发商”,特指专门从事软件的开发、生产、

[转帖]Redis 7 参数 修改 说明

2022-06-16 14:491800原创Redis 本文链接:https://www.cndba.cn/dave/article/108066 在之前的博客我们介绍了Redis 7 的安装和配置,如下: Linux 7.8 平台 Redis 7 安装并配置开机自启动 操作手册https://ww

[转帖]HTTPS中间人攻击原理

https://www.zhihu.com/people/bei-ji-85/posts 背景 前一段时间,公司北京地区上线了一个HTTPS防火墙,用来监听HTTPS流量。防火墙上线之前,邮件通知给管理层,我从我老大那里听说这个事情的时候,说这个有风险,然后意外地发现,很多人原来都不知道HTTPS防

[转帖]关于字节序(大小端)的一点想法

https://www.zhihu.com/people/bei-ji-85/posts 今天在一个技术群里有人问起来了,当时有一些讨论(不完全都是我个人的观点),整理一下: 为什么网络字节序(多数情况下)是大端? 早年设备的缓存很小,先接收高字节能快速的判断报文信息:包长度(需要准备多大缓存)、地

[转帖]awk提取某一行某一列的数据

https://www.jianshu.com/p/dbcb7fe2da56 1、提取文件中第1列数据 awk '{print $1}' filename > out.txt 2、提取前2列的文件 awk `{print $1,$2}' filename > out.txt 3、打印完第一列,然后打

[转帖]awk 中 FS的用法

https://www.cnblogs.com/rohens-hbg/p/5510890.html 在openwrt文件 ar71xx.sh中 查询设备类型时,有这么一句, machine=$(awk 'BEGIN{FS="[ \t]+:[ \t]"} /machine/ {print $2}' /

[转帖]Windows Server 2022 简体中文版、英文版下载 (updated Oct 2022)

https://sysin.org/blog/windows-server-2022/ Windows Server 2022 正式版,2022 年 10 月更新,VLSC Posted by sysin on 2022-10-27 Estimated Reading Time 8 Minutes