反汇编ipanic中的 16进制数code

Kernel panic流程及处理 kernel panic主要包括die和panic两部分流程。 阅读详情

Kernel中出现的panic 都会带Code段, 如红色字体所示.

The following is an example of a protection fault in a loadable module
processed by klogd:
---------------------------------------------------------------------------
Aug 29 09:51:01 blizard kernel: Unable to handle kernel paging request at virtual address f15e97cc
Aug 29 09:51:01 blizard kernel: current->tss.cr3 = 0062d000, %cr3 = 0062d000
Aug 29 09:51:01 blizard kernel: *pde = 00000000
Aug 29 09:51:01 blizard kernel: Oops: 0002
Aug 29 09:51:01 blizard kernel: CPU:    0
Aug 29 09:51:01 blizard kernel: EIP:    0010:[oops:_oops+16/3868]
Aug 29 09:51:01 blizard kernel: EFLAGS: 00010212
Aug 29 09:51:01 blizard kernel: eax: 315e97cc   ebx: 003a6f80   ecx: 001be77b   edx: 00237c0c
Aug 29 09:51:01 blizard kernel: esi: 00000000   edi: bffffdb3   ebp: 00589f90   esp: 00589f8c
Aug 29 09:51:01 blizard kernel: ds: 0018   es: 0018   fs: 002b   gs: 002b   ss: 0018
Aug 29 09:51:01 blizard kernel: Process oops_test (pid: 3374, process nr: 21, stackpage=00589000)
Aug 29 09:51:01 blizard kernel: Stack: 315e97cc 00589f98 0100b0b4 bffffed4 0012e38e 00240c64 003a6f80 00000001
Aug 29 09:51:01 blizard kernel:        00000000 00237810 bfffff00 0010a7fa 00000003 00000001 00000000 bfffff00
Aug 29 09:51:01 blizard kernel:        bffffdb3 bffffed4 ffffffda 0000002b 0007002b 0000002b 0000002b 00000036
Aug 29 09:51:01 blizard kernel: Call Trace: [oops:_oops_ioctl+48/80] [_sys_ioctl+254/272] [_system_call+82/128]
Aug 29 09:51:01 blizard kernel: Code: c7 00 05 00 00 00 eb 08 90 90 90 90 90 90 90 90 89 ec 5d c3
---------------------------------------------------------------------------

 

如果要把这段二进制指令反汇编为汇编语言可以通过下面方法:

1.  把 这段数据保存到文本文件, 比如下面例子中的/home/decode.txt文件中

2.  使用linux代码中的decodecode脚本(路径: linux/kernel/scripts) 来对这段指令反汇编, 如下面内容所示. 其中code段有<8b>比较特殊, <>框住的指令代表ipanic是在这条指令上出现的问题.

fred@fred:~/linux/kernel/scripts$ ./decodecode </home/decode.txt
Code: f9 0f 8d f9 00 00 00 8d 42 0c e8 dd 26 11 c7 a1 60 ea 2b f9 8b 50 08 a1 64 ea 2b f9 8d 34 82 8b 1e 85 db 74 6d 8b 15 60 ea 2b f9 <8b> 43 04 39 42 54 7e 04 40 89 42 54 8b 43 04 3b 05 00 f6 52 c0
All code
========
   0:   f9                      stc
   1:   0f 8d f9 00 00 00       jge    0x100
   7:   8d 42 0c                lea    0xc(%rdx),%eax
   a:   e8 dd 26 11 c7          callq  0xffffffffc71126ec
   f:   a1 60 ea 2b f9 8b 50    movabs 0xa108508bf92bea60,%eax
  16:   08 a1
  18:   64                      fs
  19:   ea                      (bad)
  1a:   2b f9                   sub    %ecx,%edi
  1c:   8d 34 82                lea    (%rdx,%rax,4),%esi
  1f:   8b 1e                   mov    (%rsi),%ebx
  21:   85 db                   test   %ebx,%ebx
  23:   74 6d                   je     0x92
  25:   8b 15 60 ea 2b f9       mov    -0x6d415a0(%rip),%edx        # 0xfffffffff92bea8b
  2b:*  8b 43 04                mov    0x4(%rbx),%eax           <-- trapping instruction
  2e:   39 42 54                cmp    %eax,0x54(%rdx)
  31:   7e 04                   jle    0x37
  33:   40 89 42 54             rex mov %eax,0x54(%rdx)
  37:   8b 43 04                mov    0x4(%rbx),%eax
  3a:   3b 05 00 f6 52 c0       cmp    -0x3fad0a00(%rip),%eax   # 0xffffffffc052f640

Code starting with the faulting instruction
===========================================
   0:   8b 43 04                mov    0x4(%rbx),%eax
   3:   39 42 54                cmp    %eax,0x54(%rdx)
   6:   7e 04                   jle    0xc
   8:   40 89 42 54             rex mov %eax,0x54(%rdx)
   c:   8b 43 04                mov    0x4(%rbx),%eax
   f:   3b 05 00 f6 52 c0       cmp    -0x3fad0a00(%rip),%eax   # 0xffffffffc052f615


 

翻译来于: linux/kernel/Documentation/oops-tracing.txt

---------------------------------

How to track down an Oops.. [originally a mail to linux-kernel]

The main trick is having 5 years of experience with those pesky oops
messages ;-)

Actually, there are things you can do that make this easier. I have two
separate approaches:

        gdb /usr/src/linux/vmlinux
        gdb> disassemble <offending_function>

That's the easy way to find the problem, at least if the bug-report is
well made (like this one was - run through ksymoops to get the
information of which function and the offset in the function that it
happened in).

Oh, it helps if the report happens on a kernel that is compiled with the
same compiler and similar setups.

The other thing to do is disassemble the "Code:" part of the bug report:
ksymoops will do this too with the correct tools, but if you don't have
the tools you can just do a silly program:

        char str[] = "\xXX\xXX\xXX...";
        main(){}

and compile it with gcc -g and then do "disassemble str" (where the "XX"
stuff are the values reported by the Oops - you can just cut-and-paste
and do a replace of spaces to "\x" - that's what I do, as I'm too lazy
to write a program to automate this all).

Alternatively, you can use the shell script in scripts/decodecode.
Its usage is:  decodecode < oops.txt

The hex bytes that follow "Code:" may (in some architectures) have a series
of bytes that precede the current instruction pointer as well as bytes at and
following the current instruction pointer.  In some cases, one instruction
byte or word is surrounded by <> or (), as in "<86>" or "(f00d)".  These
<> or () markings indicate the current instruction pointer.  Example from
i386, split into multiple lines for readability:

Code: f9 0f 8d f9 00 00 00 8d 42 0c e8 dd 26 11 c7 a1 60 ea 2b f9 8b 50 08 a1
64 ea 2b f9 8d 34 82 8b 1e 85 db 74 6d 8b 15 60 ea 2b f9 <8b> 43 04 39 42 54
7e 04 40 89 42 54 8b 43 04 3b 05 00 f6 52 c0

Finally, if you want to see where the code comes from, you can do

        cd /usr/src/linux
        make fs/buffer.s        # or whatever file the bug happened in

and then you get a better idea of what happens than with the gdb
disassembly.

Now, the trick is just then to combine all the data you have: the C
sources (and general knowledge of what it _should_ do), the assembly
listing and the code disassembly (and additionally the register dump you
also get from the "oops" message - that can be useful to see _what_ the
corrupted pointers were, and when you have the assembler listing you can
also match the other registers to whatever C expressions they were used
for).

Essentially, you just look at what doesn't match (in this case it was the
"Code" disassembly that didn't match with what the compiler generated).
Then you need to find out _why_ they don't match. Often it's simple - you
see that the code uses a NULL pointer and then you look at the code and
wonder how the NULL pointer got there, and if it's a valid thing to do
you just check against it..

Now, if somebody gets the idea that this is time-consuming and requires
some small amount of concentration, you're right. Which is why I will
mostly just ignore any panic reports that don't have the symbol table
info etc looked up: it simply gets too hard to look it up (I have some
programs to search for specific patterns in the kernel code segment, and
sometimes I have been able to look up those kinds of panics too, but
that really requires pretty good knowledge of the kernel just to be able
to pick out the right sequences etc..)

_Sometimes_ it happens that I just see the disassembled code sequence
from the panic, and I know immediately where it's coming from. That's when
I get worried that I've been doing this for too long ;-)

                Linus

如何把RISC-V的机器指令反汇编为汇编代码 现知道某条 RISC-V (指RV32)的机器指令在内存中的值为 b3 05 95 00(16进制),从左往右为从低地址到⾼地址,单位为字节,那么如何将其翻译为对应的汇编指令? 阅读详情

相关推荐

反汇编工具和16进制编辑器C32asm

属于底层的编辑工具,同时能够进行16进制的数据转换。

DEBUG 命令详解

直接将 8086/8087/8088 记忆码合并到内存。该命令从汇编语言语句创建可执行的机器码。所有数值都是十六进制格式,必须按一到四个字符输入这些数值。在引用的操作代码(操作码)前指定前缀记忆码。a [address]参数address指定键入汇编语言指令的位置。对 address 使用十六进制值,并键入不以“h”字符结尾的每个值。如果不指定地址,a 将在它上次停止处开始汇编。有关将数据输入到指

张庆(网眼) 2635

so 反编译工具,16进制反编译

so 反编译s

深入理解 Linux Kernel Panic:常见原因与实战分析

栈(stack)是函数调用的临时变量与返回地址的保存区,属于线程私有区域,位于内存高地址区域。栈溢出(stack overflow):函数递归太深,或局部变量太大,把整个栈顶端撑爆。内核的栈大小通常只有 4K~16K,很容易溢出。栈空(stack underflow):函数调用过程中栈帧未按预期压栈或返回,导致返回地址丢失,从而“跳”到不可预测位置。递归:函数调用自身,适合处理树形、图结构等自包含数据结构;若递归终止条件写错,会形成“死递归”,造成栈溢出。迭代:使用while或for。

Interview_TC的博客 2596

YOLO26算法心电图十二导联目标检测+训练好的模型+368张数据集+pyqt可视化界面.zip

附训练好的 YOLO 权重与 PyQt 可视化检测界面,页面底部含可视化效果预览,毕设/课设开箱即用。 【数据集概况】 · 检测类别(中文):[导联I(I), 导联II(II), 导联III(III), 胸导联V1(V1), 胸导联V2(V2), 胸导联V3(V3), 胸导联V4(V4), 胸导联V5(V5), 胸导联V6(V6), 加压肢体导联aVF(aVF), 加压肢体导联aVL(aVL), 加压肢体导联aVR(aVR)] · 训练集:313 张 · 验证集:37 张 · 测试集:18 张 · 总计:368 张 该数据集聚焦于临床心电图信号的精准识别与定位,其核心检测目标为标准12导联心电图中的各个独立导联波形区域,涵盖肢体导联(I、II、III)与加压肢体导联(aVR、aVL、aVF),以及胸前导联(V1至V6),适用于心电图自动分析系统中对各导联位置的快速准确标注与分类。数据采集场景真实还原了医院心电图室或急诊监护环境下的标准心电图记录纸,波形清晰、基线稳定,具有高度临床参考价值。... 【训练曲线与评估图】 【模型训练配置】 参数 | 值 模型 | yolo26n 训练轮数 | 100 epochs 输入尺寸 | 640x640 批次大小 | 24 优化器 | auto 初始学习率 | 0.01 训练设备 【关键指标汇总】 训练了 57 个 epoch,最终轮指标: 指标 | 数值 mAP50 | **0.9708** mAP50-95 | 0.6344 Precision | 0.8990 Recall | 0.9191 train/box_loss | 1.2231 train/cls_loss | 0.9703 val/box_loss | 1.2779 val/cls_loss | 0.... 使用场景:毕业设计、课程设计、深度学习入门、工业场景落地验证。

用Python玩转Carla-Apollo联合仿真:手把手教你实现自动驾驶测试

本文详细介绍了如何使用Python实现Carla-Apollo联合仿真,从环境搭建到自动驾驶算法测试的全流程。通过Carla提供的高逼真仿真环境和Apollo的自动驾驶算法栈,开发者可以高效验证感知、规划和控制模块。文章包含环境配置、Python API操作、桥接实现及实战测试,为自动驾驶开发提供完整解决方案。

wasm7browser的博客 266

Kernel函数解析之panic

位置:panic()函数在panic.c文件中,该文件位于kernel/目录下; 作用:该函数的主要作用是停止当前的系统运行,供系统监测到异常时调用。 流程: 【源码】: /** * panic - halt the system * @fmt: The text string to print * * Display a message, then perform cleanups. * * This function never returns. */ void panic.

小小小小的专栏 3462

Windows10检查Cuda和cuDNN是否安装成功?

简介:根据上篇博客已经完成了CUDA和cuDNN的安装步骤,完成对其的安装。下面将来检查它们是否安装成功。 1 .首先win+R进入CMD,在命令行输入nvcc -V,如下图所示,则表示cuda已经安装成功。 2 .进入到cuda的安装路径,C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\extras\demo_suite,找到如下两个.exe文件: 首先执行:deviceQuery.exe,查看是否出现如下界面: 然后执行bandwid

jhsignal的博客 14万+

UVA 448 OOPS! 十六进制 反汇编

UVA 448 OOPS! 这道题的困难在于,题目难以读懂。 先看一下原题目: Sample Input 4C00D00004C0020001000000001400 005FFFB801E Sample Output MOV 13,R0 MOV 2,R1 ADD R0,R1 MOV R0,$8191 BR PC+30 前两段不用看。 剩下来可以勉强看看。 题目大意:读一大段字符,字符太长,每行放30个,字符由多个小单元组成,每个单元长度可能是5、9、13, 如何分开这些单元,每个单元第一个字符

qq_44575910的博客 433

DaVinci Developer中枚举类型变量的创建与实战应用

本文详细介绍了在DaVinci Developer中创建和使用枚举类型变量的方法与实战应用。通过智能温控系统的案例,阐述了枚举类型在嵌入式开发中的核心价值,包括提升代码可读性、类型安全性和维护便捷性。文章还提供了枚举类型在状态机实现和多模块协同中的高级应用技巧,以及调试与优化的实用建议。

ik678901234的博客 511

Hi3516CV610开发板实战:从零搭建智能视觉监控系统

本文详细介绍了从零开始基于Hi3516CV610开发板搭建智能视觉监控系统的完整实战流程。涵盖硬件连接、系统配置、摄像头集成、网络设置、固件烧录到视频处理与智能分析功能开发,提供了丰富的实践经验和调试技巧,帮助开发者快速掌握嵌入式视觉系统开发。

vvv99的博客 561

2.IDA-数据显示窗口(反汇编窗口、函数窗口、十六进制窗口)

当IDA加载后,3个立即可见的窗口分别为IDA-View窗口、函数窗口和消息输出窗口,所有窗口都可通过View▶Open Subviews菜单打开 反汇编窗口 反汇编窗口也叫IDA-View窗口,它是操作和分析二进制文件的主要工具 0.在反汇编窗口中,ESC键的作用与Web浏览器的“后退”按钮类似,遗憾的是,在打开的其他窗口中,ESC键用于关闭窗口 IDA使用术语流来表

hgy413的专栏 1万+

Simscape Multiboby学习笔记1——跟着官网学Multibody

文章目录一. 引言二. Simscape Multibody自学之路三. 本教程的目录 一. 引言 最近在倒腾Matlab的动力学仿真,起因是看到有人推荐Matlab的multbody模块,一经了解之下简直惊为天人。作为一名Matlab的小粉,看到这么好用的模块简直不要太开心,之前用simulink搭飞行器的仿真模型,虽然能够仿真看到六自由度位移,毕竟不能可视化,还是很不够直观,而且simulink仿真(以及更费力的脚本文件仿真)需要精确建模,模型不精确计算也是天差地别。而Multibody在具备其他动力学

qq_30267617的博客 8241

16汇编学习:数据传送指令的反汇编

这里有些疑惑的是xchg的第二种类型,和累加寄存器交换,如果携程xchg ax,ax会被xp debug当成nop(可能是交换无意义吧,毕竟都没变)代码还是比较冗余,尽管优化了一点,但还是有很多地方显得重复,代码测试较少,有bug正常。数据传送指令大概是pdf的第一页。

weixin_74197261的博客 261

IGBT模块封装中的银烧结技术:为什么特斯拉和比亚迪都在用这种黑科技?

本文深入解析了IGBT模块封装中的银烧结技术,揭示了其作为功率半导体封装工艺关键升级的原因。该技术通过低温烧结形成高熔点、高导热导电的银连接层,显著提升了模块的功率循环寿命、散热能力和高温工作稳定性,这正是特斯拉、比亚迪等行业巨头采用此项黑科技以释放电动汽车电驱系统极致性能的核心所在。

yhn4567890的博客 833

【Matlab】matlab代码实现sph溃坝模拟

本文介绍了一个基于MATLAB的SPH溃坝模拟实现。代码使用平滑粒子流体动力学方法,通过建立1000个随机分布的粒子,计算粒子间的相互作用力来模拟流体运动。模拟过程包括初始化参数、粒子创建、密度压力更新、速度位置计算以及可视化展示。核心算法采用poly6Kernel和spikyKernelGradient函数处理粒子间作用力。该示例为二维简化模型,仅包含基本物理参数和计算流程,实际应用需进一步优化扩展。

unber的博客 206

MTK平台DDR降频(调整频率)的方法

在系统运行的时候经常会看到 <4>[ 4758.075985] (2)[195:allocator@2.0-s]Normal free:15012kB min:3352kB low:9492kB high:10332kB active_anon:78804kB inactive_anon:102432kB active_file:104580kB inactive_file:856...

jinron10的专栏 7962

解锁机器人动态平衡算法:从原理到实践

机器人的动态平衡,是指机器人在运动过程中,面对各种复杂的动态变化和外界干扰,依然能够维持稳定状态,不发生倾倒或失去控制的能力。它就像是一位技艺精湛的舞者,在舞台上翩翩起舞时,无论做出多么复杂的动作,都能巧妙地调整身体姿态,始终保持平衡,展现出优美的舞姿。在实际应用中,机器人的动态平衡对于其稳定运行起着至关重要的作用。以双足机器人为例,当它行走在不平整的地面上时,地面的起伏会使机器人的重心不断发生变化。如果没有良好的动态平衡能力,机器人就很容易因为重心偏移而摔倒,无法完成行走任务。

远程部署调试 运行安装 项目调试 二次开发 项目技术新 持续迭代 部分源码免费分享 3838

记录两个内核模块开发的坑

在remove函数中调用导致问题。timer的正常用法就时应该在remove函数中调用这个API进行释放。但是这里确遇到了问题,被告知timer是一个静态对象。由于需要在timer的回调里面使用自己的数据结构,因此只能使用静态分配的方式,然后通过container_of去获取自己的数据结构。按道理来说是不应该panic的。后来通过添加日志发现,是自己的数据结构的内存踩了,由于使用了void *作为函数参数,在传参时,错误的将自己的数据结构传进去了,导致timer对象内存被覆盖了导致的这个问题。

duapple的博客 272

ET2012新版免狗免安装绿色软件

ET2012新版免狗免安祖昂绿色软件。,新界面,新视觉,

廖雪峰Python教程[完整版]

廖雪峰的python教程整理的,已经排好版了,而且还是完整的,适合小白

深入 kernel panic 流程

一、前言  我们在项目开发过程中,很多时候会出现由于某种原因经常会导致手机系统死机重启的情况(重启分Android重启跟kernel重启,而我们这里只讨论kernel重启也就是 kernel panic 的情况),死机重启基本算是影响最严重的系统问题了,有稳定复现的,也有概率出现的,解题难度也千差万别,出现问题后,通常我们会拿到类似这样的kernel log信息(下面log仅以调用BUG

沉思 1万+

visio安装包

Microsoft Office Visio 是一款专业的制图软件。利用经过更新的形状、协作工具和数据链接图表,创建专业级图表以简化复杂的信息。

Chapter 7. Linux System Crashes and Hangs

Chapter 7. Linux System Crashes and Hangs Introduction Gathering Information Conclusion 7.1. Introduction One of Linux’s claims to fame is stability and infrequency of system crashes and hangs. D...

mounter625的专栏 1069

霍尼韦尔SoftMaster使用说明

霍尼韦尔SoftMaster使用说明

汇编指令对应的十六进制表示

空            nop jmp + 32位立即数  jmp  a     =   E9 a jmp+[内存地址]   jmp   [0x8d8d3a]     =  FF25   [0x8d8d3a]  jmp+far+[内存地址]   jmp far  [0x8d8d3a]     =  FF2D   [0x8d8d3a]  直接远跳 jmp 0x8:0x7c00  = EA

duhaomin的专栏 1万+

String与十六进制的编译与反编译

记录 String与十六进制的编译与反编译 在原逻辑上每编译一个字符后加上a 这里先不加上md5的加密了 //将16进制数转换为汉字 public static String deUnicode(String content){ int a=0; a=content.length()/5; for(int i=0;i<a-1;i++) { int b=1+i; int c=4*b; int d=5*b; String c

surongbo123的博客 986

linux内核panic

1. Linux Kernel Panic的产生的原因      panic是英文中是惊慌的意思,Linux Kernel panic正如其名,linux kernel不知道如何走了,它会尽可能把它此时能获取的全部信息都打印出来。 有两种主要类型kernel panic,后面会对这两类panic做详细说明: 1.hard panic(也就是Aieee信息输出) 2.soft p

ylyuanlu的专栏 5万+

ARM 看门狗机制 [包括MTK] 【1】

ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo

ffmxnjm的博客 2万+
上一篇: android 系统获取可读写的方法
下一篇: 硬盘坏道修复方法
spring_chen
博客等级 码龄19年 0粉丝 1原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值