PWN_3 ORW

2018-02-18 15:44:34

Open Write Read

 

 


open函数

#include <sys/types.h>
       #include <sys/stat.h>
       #include <fcntl.h>

       int open(const char *pathname, int flags);
       int open(const char *pathname, int flags, mode_t mode);

       int creat(const char *pathname, mode_t mode);

       int openat(int dirfd, const char *pathname, int flags);
       int openat(int dirfd, const char *pathname, int flags, mode_t mode);
最简单的open *pathname文件路径 flags 打开的模式,可读 可写 可执行
一般来说 返回值会赋值给eax


 

open函数

read函数

write函数

eax
 赋值为0x05
 赋值为0x03
 赋值为0x05
ebx
文件名

fd 文件描述符 由open函数返回到eax中 


fd 文件描述符 由open函数返回到eax中提供
1代表打印到屏幕
ecx

0代表只读模式

缓冲区

缓冲区

edx  

长度


长度

读什么写什么,ecx和edx的值都不变

自己完成 后贴源码。
posted @ 2018-02-18 15:57  歇马  阅读(582)  评论(0编辑  收藏  举报