virtual and physical memory map
We can use ::vtop and "\" (format from physical instead of virtual) to retrieve the physical address and content of a virtual address.
# mdb -k
...
> rootfs/s
rootfs:
rootfs: zfs
> rootfs::vtop
virtual fffffffffbc00f48 mapped to physical a400f48
> a400f48\s
0xa400f48: zfs
Things will be a little complexed if we want to make this for a virutal address in application address.
Here is a segment of code to print the virtual address and content of a application pointer.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define MSG "Hello, World!"
int main(int argc, char* argv[])
{
int length = strlen(MSG);
char* message = malloc(length + 1);
memcpy(message, MSG, length);
message[length + 1] = 0;
unsigned int address = (unsigned int) message;
printf("Message is: %s\n", message);
printf("Address is: %x\n", address);
getchar();
free(message);
return EXIT_SUCCESS;
}
bash-3.00# cc -g -o test test.c
bash-3.00# ./test
Message is: Hello, World!
Address is: 8060e90
If you want to translate the virtual address 8060e90 to the physical address with mdb. It is ok, when you just run mdb and print string by virtual address:
bash-3.00# mdb -p `ps -a | pgrep test`
Loading modules: [ ld.so.1 libc.so.1 ]
> 8060e90/s
0x8060e90: Hello, World!
But neither "::vtop", nor "\" works.
> 8060e90::vtop
mdb: failed to get physical mapping: operation not supported by target
> 8060e90\s
mdb: failed to read data from target: operation not supported by target
0x8060e90:
Those won't work when attached to a process; the process model doesn't export that. You'll have to run MDB against the live kernel and do it from there:
% cat > tmpc.c <<EOF
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define MSG "Hello, World!"
int
main(int argc, char *argv[])
{
char *message = strdup(MSG);
printf("Message: \"%s\" (0x%p)\n", message, message);
getchar();
return (0);
}
EOF
% cc -o tmpc tmpc.c
% ./tmpc & sleep 1
[2] 101948
* note the PID
Message: "Hello, World!" (0x8061128)
* note the virtual address address
[2] + 101948 suspended (tty input) ./tmpc
% su
Password:
# mdb -k
* attach to the running kernel
Loading modules: [ ... ]
> 0t101948::pid2proc
* uses the pid ("0t" indicates decimal)
ffffff0527e33398
> 0t101948::pid2proc | ::print proc_t p_as
p_as = 0xffffff01eca01d00
* this gives the "address space" (as) for the process
> 0x8061128::vtop -a 0xffffff01eca01d00
virtual 8061128 mapped to physical 331a1128
* Now we can print the string from the physical page
> 331a1128\s
0x331a1128: Hello, World!
>
Okay, we've made it.
分享到:
相关推荐
### MDB: 内存映射数据库与OpenLDAP后端 #### 概述 本文主要介绍了一种名为MDB(Memory-Mapped Database)的读优化数据库库及其作为OpenLDAP后端的应用。该技术由Howard Chu开发,并在Symas Corp.以及OpenLDAP项目...
SFTP URL to the SFTP-server directory (syntax: sftp://user:password@hostname[:port]/[dirpath/]mdbfile, also required third-party libraries Commons VFS and JSch for this protocol), e.g.: jdbc:jstels:...
"The Solaris™Internals volumes are simply the best and most comprehensive treatment of the Solaris (and OpenSolaris) Operating Environment. Any person using Solaris--in any capacity--would be remiss ...
MDB Explorer for mac是专为快速和方便的查看MDB和MDE文件无需访问许可证。这个应用程序可以用来打开来自多个访问数据库的表,你的表结构和描述所示列和关系。MDB Explorer可以导出数据到许多其他的格式包括SQLite,...
- **Memory Mapping for Direct Access**: By mapping the entire database into virtual memory, MDB avoids the overhead of traditional I/O operations. Direct access to the mapped memory enables faster ...
dump_mdb 将MDB文件表转储为CSV的微服务 构建并运行: $ docker build --tag=dumpmdb:latest . $ docker run -p 8000:8000 \ -e PORT=8000 \ -e MDB_DUMP_USERNAME=user123 \ -e MDB_DUMP_PASSWORD=pass456 \ ...
使用mdb start 、 mdb init db 、 mdb init collection 运行node mdb help查看所有命令以及如何使用它 如何使用 用法: node mdb help或node mdb --help 显示帮助 node mdb started 显示正在运行的 mongo 进程 ...
设置环境下载解开 glassfish 的拉链编辑 build.properties 文件指向 glassfish 所在的文件夹运行应用程序打开一个终端...glassfish 终端中,应显示消息: |MESSAGE BEAN: Message received: IS-Expert|参考 MDB的.html
标题中的“mdb”通常指的是Material Design for Bootstrap,一个流行的开源项目,它提供了基于Bootstrap框架的Material Design组件。而“角度js”(AngularJS)是Google开发的一个强大的前端JavaScript框架,用于...
mdb 使用手册 mdb 使用手册 mdb 使用手册 mdb 使用手册 mdb 使用手册
**MDB 4.3 协议文档概述** MDB(Multi-Drop Bus)4.3协议是一种专门用于在自动售货机及其组件之间进行通信的协议,由NAMA(美国国家自动售货协会)、EVA(欧洲自动售货协会)和EVMMA(欧洲自动售货机制造商协会)的...
"MDB:Memento数据库脚本的Javascript函数" 指的是一个使用JavaScript编写的脚本集合,这些脚本与Memento数据库配合使用。Memento数据库是一款轻量级、用户友好的数据库应用,它允许用户创建、管理和共享数据。这里...
**MDB协议详解** MDB协议,全称为Media Device Bus(媒体设备总线)协议,是一种用于在多媒体设备之间进行通信的标准。这个协议主要应用于车载信息娱乐系统,允许不同硬件组件如音响、导航系统、蓝牙模块等无缝协作...
此压缩包“arcpy读取MDB数据库&创建GDB数据库&MDB转换GDB.zip”显然聚焦于使用Python的arcpy模块处理两种常见的地理数据库格式:MDB(Microsoft Access Database)和GDB(Geodatabase)。下面将详细解释这两个数据库...
"Prentice Hall PTR - Solaris Performance and Tools - DTrace and MDB Techniques for Solaris 10 and OpenSolaris - Jul 2006.pdf"是一本深入的技术书籍,它详细介绍了Solaris的性能分析工具,包括DTrace和mdb。...
市面上有很多专门用于修复MDB文件的软件,如EaseUS Data Recovery Wizard、Stellar Repair for Access等。这些工具通常具有深度扫描和恢复功能,能帮助找回大部分甚至全部数据。 4. **系统还原点**:如果是在操作...
标题中的“MDB-Cashless-Test.rar_MDB-Cashless-Test_mdb-rs232_mdb测试工具_vendin”提到了几个关键概念,包括MDB协议、非现金支付、RS232-MDB适配器、测试工具以及与自动售货机相关的应用。这些关键词都是IT行业中...
* MDB:application/msaccess * SQL:application/octet-stream * CON:application/octet-stream * LOG:text/plain * DAT:application/octet-stream * INI:application/octet-stream * ...
《sqler-mdb:在Node.js中驾驭MariaDB与MySQL的高效工具》 在现代Web开发中,数据库管理是至关重要的部分,而SQLer-mdb则是一个专为Node.js环境设计的工具,它提供了对MariaDB和MySQL数据库的强大支持。这款库通过...
·jyg_sets.mdb:生成的数据库,包括jyg_test和jyg_training两个点要素类; ·jyggrid:内插结果转换成的栅格数据; ·chp10.mxd:运行结果的地图文档。 tutor文件夹的数据为本章1-4节所用的输入数据,包括: ...