§3 程序的机器级表示

type
status
date
slug
summary
tags
category
icon
password

§3.1 基础

§3.1.1 Intel CPU及架构的发展史

§3.1.2 IA32处理器体系结构

  1. 概念
  1. 微机的基本结构
  1. IA32的寄存器
notion image
notion image
notion image
notion image
notion image
notion image
notion image
notion image
notion image
notion image
notion image
notion image
  1. IA32的内存管理
3.1 实地址模式
20位地址总线,1MB内存(0~FFFFF)
8086:16位地址线,内存分段
3.2 保护模式
32位地址总线,4GB内存(0~FFFFFFFF)
3.2.1 平坦分段模式
3.2.2 多段模式
3.2.3 分页(虚拟内存)
  1. 指令周期
取指令、解码、执行
  1. 程序是如何运行的
  1. 计算机是如何启动的

§3.1.3 汇编语言

机器语言
汇编语言:助记符
高级语言

§3.1.4 C、汇编、机器代码

§3.1.5 汇编基础:寄存器、操作数、数据传送

notion image
notion image
左源头右目的
不能用%rsp
notion image
单条指令不能进行从内存到内存的数据传送
条件传送cmov
notion image
notion image
notion image
notion image
notion image
notion image
notion image

§3.1.6 算术和逻辑运算

notion image
notion image
notion image
小结、两种格式的语法对比

§3.1.7 汇编指令简介

§3.2 控制

§3.2.1 流程控制:条件码(状态标志位)

notion image
notion image
notion image

§3.2.2 条件分支

notion image
notion image
5+03=8
d(13)+f8(-8)=5

§3.2.3 循环结构的实现

§3.2.4 Switch语句

§3.3 过程

§3.3.1 栈结构

notion image
notion image
notion image

§3.3.2 调用约定

一、传递控制
notion image
notion image
二、传递数据
notion image
三、管理局部数据

§3.3.3 递归

§3.4 数据

§3.4.1 数组

notion image
notion image
notion image
notion image
notion image
notion image

§3.4.2 结构体

notion image
notion image
notion image

§3.4.3 浮点数

§3.5 高级主题

§3.5.1 内存布局

notion image

§3.5.2 缓冲区溢出

  1. 避免溢出漏洞
notion image
  1. 使用系统级的防护
notion image
notion image
  1. 编译器使用“栈金丝雀”
notion image

§3.5.3 联合

notion image

期末真题

24春
notion image
B
notion image
%si
notion image
1000 0000
NEG指令是取补操作,也就是将操作数的值按位取反后加1,相当于求补码的负数
问值不管小端序,依然是80
notion image
notion image
23春
notion image
C
notion image
C rsp
notion image
A
notion image
D 4005ea+03=4005eb
notion image
w
notion image
%rsi
notion image
×
notion image
notion image
%rdi %rsi
objdump -d bomb
notion image
缓冲区溢出,改用fgets
notion image
x:edi y:eax w:edx z:ecx
将x赋值给y
更新条件码寄存器
y==0跳转
运算z=x*y
w
notion image
0x100
0x66
0x100+0x3+9=0x10c 地址取值=0x88
4*0x1+0xfc=0x100 地址取值=0x66
0x100+4*0x3=0x10c 地址取值0x88
22春
notion image
D
Loading...