代码还原动态调试之 pstree ‘\033‘

十六进制 十进制 八进制
0x1b 27 33
    /*469c:	b8 1b 00 00 00       	mov    $0x1b,%eax           // eax=0x1b=27='\033'
    46a1:	48 8d 1d 45 1a 00 00 	lea    0x1a45(%rip),%rbx    # 60ed <_IO_stdin_used@@Base+0xed>*/  // str="\033[0m"
    char *str = "\033[0m";

    /*46a8:	0f 1f 84 00 00 00 00 	nopl   0x0(%rax,%rax,1)
    46af:	00 
    46b0:	0f be f8             	movsbl %al,%edi                 // edi=eax=al
    46b3:	48 83 c3 01          	add    $0x1,%rbx                // str++
    46b7:	e8 d4 f8 ff ff       	callq  3f90 <__sprintf_chk@plt+0x1820>    // fun_3f90(const char ch)
    46bc:	0f b6 03             	movzbl (%rbx),%eax              // eax=*str
    46bf:	84 c0                	test   %al,%al                  // *str ?= NULL
    46c1:	75 ed                	jne    46b0 <__sprintf_chk@plt+0x1f40>*/
    while (*str) fun_3f90(*str++);


(gdb) p/c 0x1b
$3 = 27 '\033'

 

相关推荐

  1. 代码随想录leetcode200题动态规划算法

    2024-07-17 20:02:04       25 阅读
  2. pdb 调试 python 代码

    2024-07-17 20:02:04       66 阅读

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-07-17 20:02:04       67 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-07-17 20:02:04       72 阅读
  3. 在Django里面运行非项目文件

    2024-07-17 20:02:04       58 阅读
  4. Python语言-面向对象

    2024-07-17 20:02:04       69 阅读

热门阅读

  1. XML详解

    2024-07-17 20:02:04       17 阅读
  2. Vue进阶之Vue无代码可视化项目(六)

    2024-07-17 20:02:04       19 阅读
  3. 209.长度最小的子数组 数组 双指针 滑动窗口

    2024-07-17 20:02:04       18 阅读
  4. notes for datawhale 2th summer camp NLP task2

    2024-07-17 20:02:04       20 阅读
  5. linux学习笔记整理: 关于linux系统介绍 2024/7/16;

    2024-07-17 20:02:04       20 阅读
  6. 单例模式-C#

    2024-07-17 20:02:04       17 阅读