反汇编整个内核函数,内存地址、从指定数量的指令的位置,或从函数的开始到指定的内存位置
cat /proc/kallsyms | grep '\<\_text\>'
cat /proc/kallsyms | grep '\<startup\_64\>'
_text是内核代码段的起始地址,也就是 startup_64 函数
(1)
反汇编整个函数:
dis startup_64
查看函数text_poke源码,所在文件,以及行数:
dis -s text_poke
-s displays the filename and line number of the source code that
is associated with the specified text location, followed by a
source code listing if it is available on the host machine.
The line associated with the text location will be marked with
an asterisk; depending upon gdb's internal "listsize" variable,
several lines will precede the marked location. If a "count"
argument is entered, it specifies the number of source code
lines to be displayed after the marked location; otherwise
the remaining source code of the containing function will be
displayed.
显示了函数text_poke在内核源码中哪个文件,行数,以及函数源码:
我与源码进行对比,内核版本3.10.0:
//arch/x86/kernel/alternative.c
(2)
分别从startup_64函数开始反汇编 一条指令,两条指令,三条指令
(3)
从startup_64函数指定的偏移位置开始反汇编
(4)
从指定内存地址开始反汇编
2.rd
displays the contents of memory, with the output formatted in several different manners.
Enter "help rd" for details.
显示内存的内容,并以几种不同的方式格式化输出。
(1)
我用castone反汇编出来的三条跳转指令为例,包括其地址,操作码,操作数,和机器码。
分别从对应的内存地址读取32位,64位,16位内容进行对比机器码,经过对比机器码一样。
-8 display output in 8-bit values.
-16 display output in 16-bit values.
-32 display output in 32-bit values (default on 32-bit machines).
-64 display output in 64-bit values (default on 64-bit machines).
(2)
rd读取jiffies全局变量,显示其地址和值:
Read jiffies in hexadecimal and decimal format:
(3)
Read Linux version
3.struct
查看结构体成员:
查看结构体成员以及其各个成员的相对偏移位置:
-o show member offsets when displaying structure definitions;
if used with an address or symbol argument, each member will be preceded by its virtual address.
(2)
查看packet套接字:
把指定地址的内容以 struct sock结构体解析打印:
include/linux/socket.h
#define AF\_PACKET 17 /\* Packet family \*/
#define PF\_PACKET AF\_PACKET
查看结构体成员以及其各个成员的绝对虚拟地址位置:
4.mod
查看已经加载的模块信息:
5.set
6.task
查看指定任务的task_struct和thread_thread信息
7.ps
查看活跃的进程:
查看用户态进程:
-u restrict the output to only user tasks.
查看内核态进程:
-k restrict the output to only kernel threads.
查看线程组中的线程组领导者:
-G display only the thread group leader in a thread group.
Display only the thread group leader in the crash session:
**先自我介绍一下,小编浙江大学毕业,去过华为、字节跳动等大厂,目前在阿里**
**深知大多数程序员,想要提升技能,往往是自己摸索成长,但自己不成体系的自学效果低效又漫长,而且极易碰到天花板技术停滞不前!**
**因此收集整理了一份《2024年最新Linux运维全套学习资料》,初衷也很简单,就是希望能够帮助到想自学提升又不知道该从何学起的朋友。**
![img](https://img-blog.csdnimg.cn/img_convert/b718dcdf7f04c3760c753a8832da3908.png)
![img](https://img-blog.csdnimg.cn/img_convert/9ed8394d4add0b689792fddfbbba1968.png)
![img](https://img-blog.csdnimg.cn/img_convert/9d5d0cbd21ebc58b72e7ac7c9e567fb8.png)
![img](https://img-blog.csdnimg.cn/img_convert/17801eb0c9186ed8519f3cb39de9e0bd.png)
![img](https://img-blog.csdnimg.cn/img_convert/e4f7ff10e0f0854820849dc963da1bb5.png)
**既有适合小白学习的零基础资料,也有适合3年以上经验的小伙伴深入学习提升的进阶课程,涵盖了95%以上运维知识点,真正体系化!**
**由于文件比较多,这里只是将部分目录截图出来,全套包含大厂面经、学习笔记、源码讲义、实战项目、大纲路线、讲解视频,并且后续会持续更新**
**[需要这份系统化的资料的朋友,可以点击这里获取!](https://bbs.csdn.net/topics/618542503)**
片转存中...(img-DNSXdiv6-1714131770889)]
**既有适合小白学习的零基础资料,也有适合3年以上经验的小伙伴深入学习提升的进阶课程,涵盖了95%以上运维知识点,真正体系化!**
**由于文件比较多,这里只是将部分目录截图出来,全套包含大厂面经、学习笔记、源码讲义、实战项目、大纲路线、讲解视频,并且后续会持续更新**
**[需要这份系统化的资料的朋友,可以点击这里获取!](https://bbs.csdn.net/topics/618542503)**