当我们cat'proc/kallsyms'或'system.map'时,我们会得到这样的符号
....
c033718c T nf_hook_slow
c04ca284 r __ksymtab_nf_hook_slow
c04ca28c r __ksymtab_nf_hooks
c04d24a0 r __kcrctab_nf_hook_slow
c04d24a4 r __kcrctab_nf_hooks
c04e9122 r __kstrtab_nf_hook_slow
c04e9179 r __kstrtab_nf_hooks
c054d854 D nf_hooks
c0571ca0 d nf_hook_mutex
....
Run Code Online (Sandbox Code Playgroud)
先感谢您.
是否有任何文档描述了php zend vm的字节码指令结构?
php网站上有操作码编号和名称, 但我想知道更详细的结构,如操作数大小或语法.
是否有任何文件的zend vm字节码,如flash字节码文件,或英特尔指令参考手册或java字节码手册?
先感谢您
我有一个奇怪的ELF二进制文件.我可以在32位linux中运行这个二进制文件.
但是如果我用IDA反汇编程序打开这个二进制文件,IDA会说"无效入口点".
readelf的结果如下:
root@meltdown-VirtualBox:/home/meltdown# readelf -S -l SimpleVM
There are no sections in this file.
Elf file type is EXEC (Executable file)
Entry point 0xc023dc
There are 2 program headers, starting at offset 52
Program Headers:
Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align
LOAD 0x000000 0x00c01000 0x00c01000 0x013c7 0x013c7 RWE 0x1000
LOAD 0x00019c 0x0804b19c 0x0804b19c 0x00000 0x00000 RW 0x1000
Run Code Online (Sandbox Code Playgroud)
没有部分.我以为这个二进制文件很紧凑.但是,第一个LOAD段的最后一个虚拟地址是0xc023c7.入口点的虚拟地址为0xc023dc,超出范围......
谁能告诉我发生了什么事?
先感谢您.
/ proc/PID/maps如下(创建了两个进程......)
root@meltdown-VirtualBox:/proc/3510# cat maps
00110000-00111000 rwxp 00000000 00:00 0
006c0000-006c1000 r-xp 00000000 00:00 0 [vdso]
007d2000-007d4000 …Run Code Online (Sandbox Code Playgroud)我想在我的x86 ubuntu linux上交叉编译ARM内核模块.我已经下载了内核源代码(linux 2.6.26,因为目标ARM机器正在运行这个linux版本).和apt-get'ed arm交叉编译器.如你看到的.
root@declspec-desktop:/var/www/module_test# arm-linux-gnueabi-
arm-linux-gnueabi-addr2line arm-linux-gnueabi-cpp-4.5
arm-linux-gnueabi-gcov-4.5 arm-linux-gnueabi-ld.gold
arm-linux-gnueabi-ranlib arm-linux-gnueabi-strip
arm-linux-gnueabi-ar arm-linux-gnueabi-elfedit
arm-linux-gnueabi-gprof arm-linux-gnueabi-nm
arm-linux-gnueabi-readelf arm-linux-gnueabi-as
arm-linux-gnueabi-gcc arm-linux-gnueabi-ld
arm-linux-gnueabi-objcopy arm-linux-gnueabi-size
arm-linux-gnueabi-c++filt arm-linux-gnueabi-gcc-4.5
arm-linux-gnueabi-ld.bfd arm-linux-gnueabi-objdump
arm-linux-gnueabi-strings
Run Code Online (Sandbox Code Playgroud)
以下是我的内核模块(hello_module.ko)编译的Makefile(对于我的x86机器),这很好用.
obj-m += hello_module.o
KDIR := /lib/modules/$(shell uname -r)/build
#PWD:=$(shell pwd)
all:
$(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules
clean:
rm -rf *.o *.ko *.mod.* .c* .t*
Run Code Online (Sandbox Code Playgroud)
现在,为了交叉编译Linux 2.6.26 for ARM的内核模块,我需要在原来的Makefile中进行哪些更改?
以及linux源码和linux头码源之间的区别?我每次编译一些内核时都看过这些内容,但我仍然没有得到它.
我搜索了一些文章,但它不会帮助...
英特尔架构手册说,当第一次对内存页进行写访问时,CPU 会设置页表条目的脏位。我对这个问题有疑问。
1. The 'dirty bit' in this context is used for guaranteeing the correctness of disk swapping in, out of memory pages. is this correct?
2. Is this automatically performed by the hardware? or is this an implementation of operating system?
3. If it is automatically performed by the hardware, is there any noteworthy difference compared to the usual memory updates which are performed by software instructions?
Run Code Online (Sandbox Code Playgroud)
先感谢您。
使用GDB调试ARMv7二进制文件时,除了查看指令长度外,有没有办法确定CPU当前处于哪种模式?(ARM,Thumb)
我有以下代码.它只是调用ptrace(PTRACE_TRACEME)然后进入无限循环.我有两个问题.
1. after executing this binary, I can't attach gdb even if I am root.
2. with ptrace(PTRACE_TRACEME), I can't terminate the process with Ctrl-C (SIGINT). it simply stops.
Run Code Online (Sandbox Code Playgroud)
能有人解释我的原因吗?先感谢您.PS.我知道大多数调试器会分叉子,并在'execve()之前调用ptrace(PTRACE_TRACEME)'.没必要提醒我这个.
#include <sys/ptrace.h>
#include <sys/reg.h>
#include <sys/wait.h>
#include <sys/types.h>
#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
#include <errno.h>
#include <string.h>
int main(int argc, char **argv) {
printf("my pid : %d\n", getpid());
ptrace(PTRACE_TRACEME);
while(1){
printf("euid : %d\n", geteuid());
sleep(2);
}
return 0;
}
Run Code Online (Sandbox Code Playgroud) 在linux x86 中分页。
每个进程都有自己的页面目录。
页表遍历从 CR3 指向的页目录开始。
每个进程共享内核页目录内容
假设三个句子是正确的,假设某个进程进入内核模式并更新其内核页目录内容(地址映射、访问权限等......)
问题。由于内核地址空间在进程之间全局共享,因此此更新必须与其他进程的页目录同步,对吧?
如何管理?
假设有这样的代码.
MOV [0x1234], EAX (intel assembly)
Run Code Online (Sandbox Code Playgroud)
假设CPU想要处理此指令.我们假设没有管理程序.我们只是在linux环境中使用普通的x86 CPU(保护模式).
现在,我理解的是,因为0x1234是一个虚拟地址,所以需要将其转换为物理地址.(让我们跳过分段部分)
CPU只是将此地址(0x1234)传递给MMU硬件.MMU遍历页表并使用物理地址访问内存内容.
我对么?
现在让我们假设有一个虚拟机管理程序,这个代码是从客户操作系统运行的.
究竟发生了什么?
我知道虚拟机管理程序提供了另一层页表.但我不明白这究竟是如何运作的.
如果客户代码"MOV [0x1234],EAX"在真实CPU中执行.虚拟地址0x1234将由真实硬件MMU转换.所以我认为必须重写这条指令(0x1234应该在执行代码之前替换为另一个地址),或者被困在管理程序中......
我错了吗?如果我错了,请修正我的理解......
先感谢您.
在x86架构中,有一些段寄存器,如SS,CS,DS,FS,GS.
我知道这些16位寄存器表示LDT,GDT条目(作为段选择器),MMU引用它(GDT,LDT)来计算段基+偏移值.并检查权限等.
我很好奇的是:谁根据什么填写段寄存器内容?内核调度程序?
当应用程序更改段寄存器值本身时会发生什么?我知道只有CS才能更改,因为它具有当前CPU的CPL.但是其他寄存器(SS,DS ......)可以改变.