[C] Re-execute itself from elf file.
Re-execute itself from elf file.
#define _GNU_SOURCE
#include <sched.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
#include <string.h>
#include <errno.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <sys/wait.h> extern char **environ; int main(int argc, char *argv[])
{
char **ep;
char *sh[] = {"/bin/sh", NULL};
char me[], *mee[] = {me, "hello", NULL};
puts("hey~");
//execve(*sh, sh, environ); if ( argc > && strcmp(argv[], "hello") == ) {
printf("argv[1] : %s\n", argv[]);
puts("from execve()...");
return ;
} memset(me, , sizeof(me));
readlink("/proc/self/exe", me, sizeof(me) - );
printf("[+] Found myself: '%s'\n", me);
execve(*mee, mee, environ); for ( ep = environ; *ep != NULL; ep++)
printf("environ: %s\n", *ep); }
[C] Re-execute itself from elf file.的更多相关文章
- Failed to execute operation: No such file or directory(systemctl enable iptables.service)
在保存Iptables配置时:systemctl enable iptables.service 出现错误: Failed to execute operation: No such file or ...
- Watch gcc at ubuntu 12,See ELF file header
first write article at my ubuntu 12. ELF is very important file format.
- Centos下的 .so is not an ELF file
1 错误描述: 测试程序时,发现报错: 动态库不是一个ELF文件, 此时确定LD_LIBRARY_PATH设置正确,然后执行ldconfig命令,发现如上图: 后来执行:file liblog4cpp ...
- compile to 32-bit elf file
nasm -f elf -o a.o a.asm gcc -c -m32 -o b.o b.c ld -s -m elf_i386 -Ttext 0x30400 -o b.bin b.o a.o
- ldconfig: /usr/lib/libpython2.6.so.1.0-gdb.py is not an ELF file - it has the wrong magic bytes at the start.
https://bugzilla.redhat.com/show_bug.cgi?id=562980
- how can i get the source code path && file names from an ELF file(compired with -g)?
https://stackoverflow.com/questions/31333337/how-can-i-get-the-source-code-path-file-names-from-an-e ...
- ELF(Executable and Linkable Format)
目录 . 引言 . ELF文件格式 . ELF格式分析工具 0. 引言 0x1: ELF文件类型 ELF文件标准里把系统中采用ELF格式的文件归为以下几类 . 可重定位文件(Relocatable F ...
- 可执行文件(ELF)格式之讲解
ELF(Executable and Linking Format)是一种对象文件的格式,用于定义不同类型的对象文件(Object files)中都放了什么东西.以及都以什么样的格式去放这些东西.它自 ...
- 可执行文件(ELF)格式的理解
摘自http://www.cnblogs.com/xmphoenix/archive/2011/10/23/2221879.html 可执行文件(ELF)格式的理解 ELF(Executable an ...
随机推荐
- WebStorm / IDEA最新激活码2019----100%随时可用
亲测日期:2019.12.24 网址里面有 lookdiv.com 里面的钥匙就是lookdiv.com 或者直接点击备用码 http://lookdiv.com/spare.html 进入可能会比 ...
- java:集合输出之Iterator和ListIterator
在调用Iterator集合输出时,如果想要删除某个元素,请直接使用Iterator来判断元素是否存在然后再删除(next()当前指针内容,remove()删除当前内容 );如果在将集合丢给Iterat ...
- vue面试题专题
1,v-if和v-show的作用是什么?有什么区别? v-if: 创建---删除,没有元素.切换开销大.适合不频繁切换的情况用. 例子:制作搜索框,导航栏和搜索框重叠的两个框,点击搜索图 ...
- 触发器insert
USE [stalentzx]GO/****** Object: Trigger [dbo].[GZ_HISTORY_INSERT] Script Date: 2019/12/24 13:11:40 ...
- 嵌入式逻辑分析仪SignalTap II 设计范例
Crazy Bingo :嵌入式逻辑分析仪SignalTap II 设计范例 例程下载地址 http://www.cnblogs.com/crazybingo/archive/2011/07/26/ ...
- 解决:父类中的@NotNull无效以及@Notnull 验证list对象无效
解决方法如图: controller层 vo.param层 父类验证注解要使用@NotEmpty 不能使用 @NotNull,否则验证无效的,反正笔者是没有成功过
- JPA Hibernate 等面向对象持久化框架难以解决的问题
1+N查询性能问题 单个更新实体对象,而不是使用单调语句 在Java端做了很重的数据处理,数据库端反而很少 多层次 fetch inner join 难以实现 关联映射难以自定义条件 级联操作难以掌控 ...
- React-Native 之 GD (二)自定义共用导航栏样式
1.自定义导航栏样式 步骤一:从效果图中可以看出,导航栏的样式都差不多,因为我们前面已经设置了 Navigator ,这边的话我们还需要自定义 Navigator 的样式,可以看到所有的 Naviga ...
- str_shuffle函数
str_shuffle() 函数打乱一个字符串,使用任何一种可能的排序方案. <?php $str = 'hello world '; echo str_shuffle($str); ...
- clojure 语法
Clojure 是一种运行在 Java 平台上的 LISP 方言,LISP 是一种以表达性和功能强大著称的编程语言. ; 分号作为注释的开始 ; clojure 用括号把元素括起来,元素之间用空格隔开 ...