add little source codes and compiled .o, .exe codes from alpine linux for testing

master
chyyuu 6 years ago
parent 836a007de9
commit 633b28f273

Binary file not shown.

@ -0,0 +1,6 @@
public class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello World");
}
}

@ -0,0 +1,27 @@
/* sbrk and brk example */
#include <stdio.h>
#include <unistd.h>
#include <sys/types.h>
int main(int argc, char ** argv)
{
int *curr_brk, *tmp_brk = NULL;
int num,i;
if(argc >1) { num=atoi(argv[1]);}
printf("Welcome to sbrk example:%d num %d\n", getpid(),num);
for(i=0;i<num;i++) {
/* sbrk(0) gives current program break location */
tmp_brk = curr_brk = sbrk(0);
printf("%d: Program Break Location1:%p\n", i, curr_brk);
/* brk(addr) increments/decrements program break location */
brk((char*)curr_brk + 4096);
curr_brk = sbrk(0);
printf("%d: Program break Location2:%p\n", i, curr_brk);
*(curr_brk-20)=1;
// brk(tmp_brk);
// curr_brk = sbrk(0);
// printf("Program Break Location3:%p\n", curr_brk);
}
return 0;
}

@ -0,0 +1,18 @@
#define _GNU_SOURCE
#include <assert.h>
#include <unistd.h>
int main(void) {
void *b;
char *p, *end;
b = sbrk(0);
p = (char *)b;
end = p + 0x1000000;
brk(end);
while (p < end) {
*(p++) = 1;
}
brk(b);
return 0;
}

@ -0,0 +1,10 @@
gcc -c dlmain.c -o dlmain.o
gcc -c func.c -o func.o
cc -shared -fPIC func.c -o libfunc.so
gcc dlmain.c libfunc.so -o dlmain
go build hello.go
javac HelloWorld.java
#java HelloWorld

Binary file not shown.

@ -0,0 +1,6 @@
#include "func.h"
int main()
{
func();
return 0;
}

Binary file not shown.

@ -0,0 +1,26 @@
#include<stdlib.h>
#include<stdio.h>
#include<unistd.h>
extern char **environ;
char **env ;
int main()
{
env= environ;
while(*environ){
puts(*environ);
environ++;
}
char * p;
puts("----------------------\n");
if((p=getenv("USER")))
printf("USER =%s\n",p);
setenv("USER","test",1);
printf("USER=%s\n",getenv("USER"));
//unsetenv("USER");
//printf("USER=%s\n",getenv("USER"));
char * argv[]={"env2", NULL};
execve("./env2",argv,env);
return 0;
}

Binary file not shown.

@ -0,0 +1,26 @@
#include<stdlib.h>
#include<stdio.h>
#include<unistd.h>
extern char **environ;
char **env ;
int main()
{
env= environ;
while(*environ){
puts(*environ);
environ++;
}
char * p;
puts("----------------------\n");
if((p=getenv("USER")))
printf("USER =%s\n",p);
setenv("USER","test",1);
printf("USER=%s\n",getenv("USER"));
//unsetenv("USER");
//printf("USER=%s\n",getenv("USER"));
char * argv[]={"env2", NULL};
execve("./env2",argv,env);
return 0;
}

@ -0,0 +1,490 @@
# 1 "env1.c"
# 1 "<built-in>"
# 1 "<command-line>"
# 31 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 32 "<command-line>" 2
# 1 "env1.c"
# 1 "/usr/include/stdlib.h" 1 3 4
# 1 "/usr/include/features.h" 1 3 4
# 9 "/usr/include/stdlib.h" 2 3 4
# 19 "/usr/include/stdlib.h" 3 4
# 1 "/usr/include/bits/alltypes.h" 1 3 4
# 18 "/usr/include/bits/alltypes.h" 3 4
# 18 "/usr/include/bits/alltypes.h" 3 4
typedef int wchar_t;
# 101 "/usr/include/bits/alltypes.h" 3 4
typedef unsigned long size_t;
# 20 "/usr/include/stdlib.h" 2 3 4
int atoi (const char *);
long atol (const char *);
long long atoll (const char *);
double atof (const char *);
float strtof (const char *restrict, char **restrict);
double strtod (const char *restrict, char **restrict);
long double strtold (const char *restrict, char **restrict);
long strtol (const char *restrict, char **restrict, int);
unsigned long strtoul (const char *restrict, char **restrict, int);
long long strtoll (const char *restrict, char **restrict, int);
unsigned long long strtoull (const char *restrict, char **restrict, int);
int rand (void);
void srand (unsigned);
void *malloc (size_t);
void *calloc (size_t, size_t);
void *realloc (void *, size_t);
void free (void *);
void *aligned_alloc(size_t, size_t);
_Noreturn void abort (void);
int atexit (void (*) (void));
_Noreturn void exit (int);
_Noreturn void _Exit (int);
int at_quick_exit (void (*) (void));
_Noreturn void quick_exit (int);
char *getenv (const char *);
int system (const char *);
void *bsearch (const void *, const void *, size_t, size_t, int (*)(const void *, const void *));
void qsort (void *, size_t, size_t, int (*)(const void *, const void *));
int abs (int);
long labs (long);
long long llabs (long long);
typedef struct { int quot, rem; } div_t;
typedef struct { long quot, rem; } ldiv_t;
typedef struct { long long quot, rem; } lldiv_t;
div_t div (int, int);
ldiv_t ldiv (long, long);
lldiv_t lldiv (long long, long long);
int mblen (const char *, size_t);
int mbtowc (wchar_t *restrict, const char *restrict, size_t);
int wctomb (char *, wchar_t);
size_t mbstowcs (wchar_t *restrict, const char *restrict, size_t);
size_t wcstombs (char *restrict, const wchar_t *restrict, size_t);
size_t __ctype_get_mb_cur_max(void);
# 99 "/usr/include/stdlib.h" 3 4
int posix_memalign (void **, size_t, size_t);
int setenv (const char *, const char *, int);
int unsetenv (const char *);
int mkstemp (char *);
int mkostemp (char *, int);
char *mkdtemp (char *);
int getsubopt (char **, char *const *, char **);
int rand_r (unsigned *);
char *realpath (const char *restrict, char *restrict);
long int random (void);
void srandom (unsigned int);
char *initstate (unsigned int, char *, size_t);
char *setstate (char *);
int putenv (char *);
int posix_openpt (int);
int grantpt (int);
int unlockpt (int);
char *ptsname (int);
char *l64a (long);
long a64l (const char *);
void setkey (const char *);
double drand48 (void);
double erand48 (unsigned short [3]);
long int lrand48 (void);
long int nrand48 (unsigned short [3]);
long mrand48 (void);
long jrand48 (unsigned short [3]);
void srand48 (long);
unsigned short *seed48 (unsigned short [3]);
void lcong48 (unsigned short [7]);
# 1 "/usr/include/alloca.h" 1 3 4
# 9 "/usr/include/alloca.h" 3 4
# 1 "/usr/include/bits/alltypes.h" 1 3 4
# 10 "/usr/include/alloca.h" 2 3 4
void *alloca(size_t);
# 139 "/usr/include/stdlib.h" 2 3 4
char *mktemp (char *);
int mkstemps (char *, int);
int mkostemps (char *, int, int);
void *valloc (size_t);
void *memalign(size_t, size_t);
int getloadavg(double *, int);
int clearenv(void);
# 2 "env1.c" 2
# 1 "/usr/include/stdio.h" 1 3 4
# 22 "/usr/include/stdio.h" 3 4
# 1 "/usr/include/bits/alltypes.h" 1 3 4
typedef __builtin_va_list va_list;
typedef __builtin_va_list __isoc_va_list;
# 116 "/usr/include/bits/alltypes.h" 3 4
typedef long ssize_t;
# 203 "/usr/include/bits/alltypes.h" 3 4
typedef long off_t;
# 356 "/usr/include/bits/alltypes.h" 3 4
typedef struct _IO_FILE FILE;
# 23 "/usr/include/stdio.h" 2 3 4
# 50 "/usr/include/stdio.h" 3 4
typedef union _G_fpos64_t {
char __opaque[16];
long long __lldata;
double __align;
} fpos_t;
extern FILE *const stdin;
extern FILE *const stdout;
extern FILE *const stderr;
FILE *fopen(const char *restrict, const char *restrict);
FILE *freopen(const char *restrict, const char *restrict, FILE *restrict);
int fclose(FILE *);
int remove(const char *);
int rename(const char *, const char *);
int feof(FILE *);
int ferror(FILE *);
int fflush(FILE *);
void clearerr(FILE *);
int fseek(FILE *, long, int);
long ftell(FILE *);
void rewind(FILE *);
int fgetpos(FILE *restrict, fpos_t *restrict);
int fsetpos(FILE *, const fpos_t *);
size_t fread(void *restrict, size_t, size_t, FILE *restrict);
size_t fwrite(const void *restrict, size_t, size_t, FILE *restrict);
int fgetc(FILE *);
int getc(FILE *);
int getchar(void);
int ungetc(int, FILE *);
int fputc(int, FILE *);
int putc(int, FILE *);
int putchar(int);
char *fgets(char *restrict, int, FILE *restrict);
int fputs(const char *restrict, FILE *restrict);
int puts(const char *);
int printf(const char *restrict, ...);
int fprintf(FILE *restrict, const char *restrict, ...);
int sprintf(char *restrict, const char *restrict, ...);
int snprintf(char *restrict, size_t, const char *restrict, ...);
int vprintf(const char *restrict, __isoc_va_list);
int vfprintf(FILE *restrict, const char *restrict, __isoc_va_list);
int vsprintf(char *restrict, const char *restrict, __isoc_va_list);
int vsnprintf(char *restrict, size_t, const char *restrict, __isoc_va_list);
int scanf(const char *restrict, ...);
int fscanf(FILE *restrict, const char *restrict, ...);
int sscanf(const char *restrict, const char *restrict, ...);
int vscanf(const char *restrict, __isoc_va_list);
int vfscanf(FILE *restrict, const char *restrict, __isoc_va_list);
int vsscanf(const char *restrict, const char *restrict, __isoc_va_list);
void perror(const char *);
int setvbuf(FILE *restrict, char *restrict, int, size_t);
void setbuf(FILE *restrict, char *restrict);
char *tmpnam(char *);
FILE *tmpfile(void);
FILE *fmemopen(void *restrict, size_t, const char *restrict);
FILE *open_memstream(char **, size_t *);
FILE *fdopen(int, const char *);
FILE *popen(const char *, const char *);
int pclose(FILE *);
int fileno(FILE *);
int fseeko(FILE *, off_t, int);
off_t ftello(FILE *);
int dprintf(int, const char *restrict, ...);
int vdprintf(int, const char *restrict, __isoc_va_list);
void flockfile(FILE *);
int ftrylockfile(FILE *);
void funlockfile(FILE *);
int getc_unlocked(FILE *);
int getchar_unlocked(void);
int putc_unlocked(int, FILE *);
int putchar_unlocked(int);
ssize_t getdelim(char **restrict, size_t *restrict, int, FILE *restrict);
ssize_t getline(char **restrict, size_t *restrict, FILE *restrict);
int renameat(int, const char *, int, const char *);
char *ctermid(char *);
char *tempnam(const char *, const char *);
char *cuserid(char *);
void setlinebuf(FILE *);
void setbuffer(FILE *, char *, size_t);
int fgetc_unlocked(FILE *);
int fputc_unlocked(int, FILE *);
int fflush_unlocked(FILE *);
size_t fread_unlocked(void *, size_t, size_t, FILE *);
size_t fwrite_unlocked(const void *, size_t, size_t, FILE *);
void clearerr_unlocked(FILE *);
int feof_unlocked(FILE *);
int ferror_unlocked(FILE *);
int fileno_unlocked(FILE *);
int getw(FILE *);
int putw(int, FILE *);
char *fgetln(FILE *, size_t *);
int asprintf(char **, const char *, ...);
int vasprintf(char **, const char *, __isoc_va_list);
# 3 "env1.c" 2
# 1 "/usr/include/unistd.h" 1 3 4
# 33 "/usr/include/unistd.h" 3 4
# 1 "/usr/include/bits/alltypes.h" 1 3 4
# 121 "/usr/include/bits/alltypes.h" 3 4
typedef long intptr_t;
# 276 "/usr/include/bits/alltypes.h" 3 4
typedef int pid_t;
# 286 "/usr/include/bits/alltypes.h" 3 4
typedef unsigned uid_t;
typedef unsigned gid_t;
# 301 "/usr/include/bits/alltypes.h" 3 4
typedef unsigned useconds_t;
# 34 "/usr/include/unistd.h" 2 3 4
int pipe(int [2]);
int pipe2(int [2], int);
int close(int);
int posix_close(int, int);
int dup(int);
int dup2(int, int);
int dup3(int, int, int);
off_t lseek(int, off_t, int);
int fsync(int);
int fdatasync(int);
ssize_t read(int, void *, size_t);
ssize_t write(int, const void *, size_t);
ssize_t pread(int, void *, size_t, off_t);
ssize_t pwrite(int, const void *, size_t, off_t);
int chown(const char *, uid_t, gid_t);
int fchown(int, uid_t, gid_t);
int lchown(const char *, uid_t, gid_t);
int fchownat(int, const char *, uid_t, gid_t, int);
int link(const char *, const char *);
int linkat(int, const char *, int, const char *, int);
int symlink(const char *, const char *);
int symlinkat(const char *, int, const char *);
ssize_t readlink(const char *restrict, char *restrict, size_t);
ssize_t readlinkat(int, const char *restrict, char *restrict, size_t);
int unlink(const char *);
int unlinkat(int, const char *, int);
int rmdir(const char *);
int truncate(const char *, off_t);
int ftruncate(int, off_t);
int access(const char *, int);
int faccessat(int, const char *, int, int);
int chdir(const char *);
int fchdir(int);
char *getcwd(char *, size_t);
unsigned alarm(unsigned);
unsigned sleep(unsigned);
int pause(void);
pid_t fork(void);
int execve(const char *, char *const [], char *const []);
int execv(const char *, char *const []);
int execle(const char *, const char *, ...);
int execl(const char *, const char *, ...);
int execvp(const char *, char *const []);
int execlp(const char *, const char *, ...);
int fexecve(int, char *const [], char *const []);
_Noreturn void _exit(int);
pid_t getpid(void);
pid_t getppid(void);
pid_t getpgrp(void);
pid_t getpgid(pid_t);
int setpgid(pid_t, pid_t);
pid_t setsid(void);
pid_t getsid(pid_t);
char *ttyname(int);
int ttyname_r(int, char *, size_t);
int isatty(int);
pid_t tcgetpgrp(int);
int tcsetpgrp(int, pid_t);
uid_t getuid(void);
uid_t geteuid(void);
gid_t getgid(void);
gid_t getegid(void);
int getgroups(int, gid_t []);
int setuid(uid_t);
int seteuid(uid_t);
int setgid(gid_t);
int setegid(gid_t);
char *getlogin(void);
int getlogin_r(char *, size_t);
int gethostname(char *, size_t);
char *ctermid(char *);
int getopt(int, char * const [], const char *);
extern char *optarg;
extern int optind, opterr, optopt;
long pathconf(const char *, int);
long fpathconf(int, int);
long sysconf(int);
size_t confstr(int, char *, size_t);
int setreuid(uid_t, uid_t);
int setregid(gid_t, gid_t);
int lockf(int, int, off_t);
long gethostid(void);
int nice(int);
void sync(void);
pid_t setpgrp(void);
char *crypt(const char *, const char *);
void encrypt(char *, int);
void swab(const void *restrict, void *restrict, ssize_t);
int usleep(unsigned);
unsigned ualarm(unsigned, unsigned);
int brk(void *);
void *sbrk(intptr_t);
pid_t vfork(void);
int vhangup(void);
int chroot(const char *);
int getpagesize(void);
int getdtablesize(void);
int sethostname(const char *, size_t);
int getdomainname(char *, size_t);
int setdomainname(const char *, size_t);
int setgroups(size_t, const gid_t *);
char *getpass(const char *);
int daemon(int, int);
void setusershell(void);
void endusershell(void);
char *getusershell(void);
int acct(const char *);
long syscall(long, ...);
int execvpe(const char *, char *const [], char *const []);
int issetugid(void);
int getentropy(void *, size_t);
# 252 "/usr/include/unistd.h" 3 4
# 1 "/usr/include/bits/posix.h" 1 3 4
# 253 "/usr/include/unistd.h" 2 3 4
# 4 "env1.c" 2
# 5 "env1.c"
extern char **environ;
char **env ;
int main()
{
env= environ;
while(*environ){
puts(*environ);
environ++;
}
char * p;
puts("----------------------\n");
if((p=getenv("USER")))
printf("USER =%s\n",p);
setenv("USER","test",1);
printf("USER=%s\n",getenv("USER"));
char * argv[]={"env2",
# 23 "env1.c" 3 4
((void*)0)
# 23 "env1.c"
};
execve("./env2",argv,env);
return 0;
}

Binary file not shown.

@ -0,0 +1,94 @@
.file "env1.c"
.text
.comm env,8,8
.section .rodata
.LC0:
.string "----------------------\n"
.LC1:
.string "USER"
.LC2:
.string "USER =%s\n"
.LC3:
.string "test"
.LC4:
.string "USER=%s\n"
.LC5:
.string "env2"
.LC6:
.string "./env2"
.text
.globl main
.type main, @function
main:
.LFB0:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $48, %rsp
movq %fs:40, %rax
movq %rax, -8(%rbp)
xorl %eax, %eax
movq environ(%rip), %rax
movq %rax, env(%rip)
jmp .L2
.L3:
movq environ(%rip), %rax
movq (%rax), %rax
movq %rax, %rdi
call puts@PLT
movq environ(%rip), %rax
addq $8, %rax
movq %rax, environ(%rip)
.L2:
movq environ(%rip), %rax
movq (%rax), %rax
testq %rax, %rax
jne .L3
leaq .LC0(%rip), %rdi
call puts@PLT
leaq .LC1(%rip), %rdi
call getenv@PLT
movq %rax, -40(%rbp)
cmpq $0, -40(%rbp)
je .L4
movq -40(%rbp), %rax
movq %rax, %rsi
leaq .LC2(%rip), %rdi
movl $0, %eax
call printf@PLT
.L4:
movl $1, %edx
leaq .LC3(%rip), %rsi
leaq .LC1(%rip), %rdi
call setenv@PLT
leaq .LC1(%rip), %rdi
call getenv@PLT
movq %rax, %rsi
leaq .LC4(%rip), %rdi
movl $0, %eax
call printf@PLT
leaq .LC5(%rip), %rax
movq %rax, -32(%rbp)
movq $0, -24(%rbp)
movq env(%rip), %rdx
leaq -32(%rbp), %rax
movq %rax, %rsi
leaq .LC6(%rip), %rdi
call execve@PLT
movl $0, %eax
movq -8(%rbp), %rcx
xorq %fs:40, %rcx
je .L6
call __stack_chk_fail@PLT
.L6:
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE0:
.size main, .-main
.ident "GCC: (Alpine 8.2.0) 8.2.0"
.section .note.GNU-stack,"",@progbits

Binary file not shown.

@ -0,0 +1,25 @@
#include<stdlib.h>
#include<stdio.h>
#include<unistd.h>
//extern char **environ;
//char **env = environ;
int main(int argc, char * argv [] , char ** environ)
{
puts("child, evn2----------------------\n");
while(*environ){
puts(*environ);
environ++;
}
char * p;
puts("----------------------\n");
if((p=getenv("USER")))
printf("USER =%s\n",p);
setenv("USER","TEST",1);
printf("USER=%s\n",getenv("USER"));
unsetenv("USER");
printf("USER=%s\n",getenv("USER"));
setenv("USER","TEST",1);
return 0;
}

@ -0,0 +1,243 @@
env2: file format elf64-x86-64
Disassembly of section .init:
0000000000001000 <_init>:
1000: 50 push %rax
1001: e8 ad 01 00 00 callq 11b3 <frame_dummy>
1006: e8 ce 02 00 00 callq 12d9 <__do_global_ctors_aux>
100b: 58 pop %rax
100c: c3 retq
Disassembly of section .plt:
0000000000001010 <.plt>:
1010: ff 35 82 2f 00 00 pushq 0x2f82(%rip) # 3f98 <_GLOBAL_OFFSET_TABLE_+0x8>
1016: ff 25 84 2f 00 00 jmpq *0x2f84(%rip) # 3fa0 <_GLOBAL_OFFSET_TABLE_+0x10>
101c: 0f 1f 40 00 nopl 0x0(%rax)
0000000000001020 <unsetenv@plt>:
1020: ff 25 82 2f 00 00 jmpq *0x2f82(%rip) # 3fa8 <unsetenv>
1026: 68 00 00 00 00 pushq $0x0
102b: e9 e0 ff ff ff jmpq 1010 <.plt>
0000000000001030 <printf@plt>:
1030: ff 25 7a 2f 00 00 jmpq *0x2f7a(%rip) # 3fb0 <printf>
1036: 68 01 00 00 00 pushq $0x1
103b: e9 d0 ff ff ff jmpq 1010 <.plt>
0000000000001040 <getenv@plt>:
1040: ff 25 72 2f 00 00 jmpq *0x2f72(%rip) # 3fb8 <getenv>
1046: 68 02 00 00 00 pushq $0x2
104b: e9 c0 ff ff ff jmpq 1010 <.plt>
0000000000001050 <puts@plt>:
1050: ff 25 6a 2f 00 00 jmpq *0x2f6a(%rip) # 3fc0 <puts>
1056: 68 03 00 00 00 pushq $0x3
105b: e9 b0 ff ff ff jmpq 1010 <.plt>
0000000000001060 <setenv@plt>:
1060: ff 25 62 2f 00 00 jmpq *0x2f62(%rip) # 3fc8 <setenv>
1066: 68 04 00 00 00 pushq $0x4
106b: e9 a0 ff ff ff jmpq 1010 <.plt>
0000000000001070 <__libc_start_main@plt>:
1070: ff 25 5a 2f 00 00 jmpq *0x2f5a(%rip) # 3fd0 <__libc_start_main>
1076: 68 05 00 00 00 pushq $0x5
107b: e9 90 ff ff ff jmpq 1010 <.plt>
Disassembly of section .plt.got:
0000000000001080 <__cxa_finalize@plt>:
1080: ff 25 52 2f 00 00 jmpq *0x2f52(%rip) # 3fd8 <__cxa_finalize>
1086: 66 90 xchg %ax,%ax
0000000000001088 <__deregister_frame_info@plt>:
1088: ff 25 52 2f 00 00 jmpq *0x2f52(%rip) # 3fe0 <__deregister_frame_info>
108e: 66 90 xchg %ax,%ax
0000000000001090 <__register_frame_info@plt>:
1090: ff 25 62 2f 00 00 jmpq *0x2f62(%rip) # 3ff8 <__register_frame_info>
1096: 66 90 xchg %ax,%ax
Disassembly of section .text:
0000000000001098 <_start>:
1098: 48 31 ed xor %rbp,%rbp
109b: 48 89 e7 mov %rsp,%rdi
109e: 48 8d 35 6b 2d 00 00 lea 0x2d6b(%rip),%rsi # 3e10 <_DYNAMIC>
10a5: 48 83 e4 f0 and $0xfffffffffffffff0,%rsp
10a9: e8 00 00 00 00 callq 10ae <_start_c>
00000000000010ae <_start_c>:
10ae: 50 push %rax
10af: 48 8d 57 08 lea 0x8(%rdi),%rdx
10b3: 48 8b 37 mov (%rdi),%rsi
10b6: 45 31 c9 xor %r9d,%r9d
10b9: 4c 8d 05 3b 02 00 00 lea 0x23b(%rip),%r8 # 12fb <_fini>
10c0: 48 8d 0d 39 ff ff ff lea -0xc7(%rip),%rcx # 1000 <_init>
10c7: 48 8d 3d 0c 01 00 00 lea 0x10c(%rip),%rdi # 11da <main>
10ce: e8 9d ff ff ff callq 1070 <__libc_start_main@plt>
00000000000010d3 <deregister_tm_clones>:
10d3: 48 8d 3d 2e 2f 00 00 lea 0x2f2e(%rip),%rdi # 4008 <__TMC_END__>
10da: 48 8d 05 27 2f 00 00 lea 0x2f27(%rip),%rax # 4008 <__TMC_END__>
10e1: 48 39 f8 cmp %rdi,%rax
10e4: 74 0e je 10f4 <deregister_tm_clones+0x21>
10e6: 48 8b 05 03 2f 00 00 mov 0x2f03(%rip),%rax # 3ff0 <_ITM_deregisterTMCloneTable>
10ed: 48 85 c0 test %rax,%rax
10f0: 74 02 je 10f4 <deregister_tm_clones+0x21>
10f2: ff e0 jmpq *%rax
10f4: c3 retq
00000000000010f5 <register_tm_clones>:
10f5: 48 8d 3d 0c 2f 00 00 lea 0x2f0c(%rip),%rdi # 4008 <__TMC_END__>
10fc: 48 8d 35 05 2f 00 00 lea 0x2f05(%rip),%rsi # 4008 <__TMC_END__>
1103: b9 02 00 00 00 mov $0x2,%ecx
1108: 48 29 fe sub %rdi,%rsi
110b: 48 c1 fe 03 sar $0x3,%rsi
110f: 48 89 f0 mov %rsi,%rax
1112: 48 99 cqto
1114: 48 f7 f9 idiv %rcx
1117: 48 89 c6 mov %rax,%rsi
111a: 48 85 c0 test %rax,%rax
111d: 74 0e je 112d <register_tm_clones+0x38>
111f: 48 8b 05 c2 2e 00 00 mov 0x2ec2(%rip),%rax # 3fe8 <_ITM_registerTMCloneTable>
1126: 48 85 c0 test %rax,%rax
1129: 74 02 je 112d <register_tm_clones+0x38>
112b: ff e0 jmpq *%rax
112d: c3 retq
000000000000112e <__do_global_dtors_aux>:
112e: 80 3d eb 2e 00 00 00 cmpb $0x0,0x2eeb(%rip) # 4020 <completed.6136>
1135: 75 7b jne 11b2 <__do_global_dtors_aux+0x84>
1137: 55 push %rbp
1138: 48 83 3d 98 2e 00 00 cmpq $0x0,0x2e98(%rip) # 3fd8 <__cxa_finalize>
113f: 00
1140: 48 89 e5 mov %rsp,%rbp
1143: 41 54 push %r12
1145: 53 push %rbx
1146: 74 0c je 1154 <__do_global_dtors_aux+0x26>
1148: 48 8b 3d b1 2e 00 00 mov 0x2eb1(%rip),%rdi # 4000 <__dso_handle>
114f: e8 2c ff ff ff callq 1080 <__cxa_finalize@plt>
1154: 48 8d 05 a5 2c 00 00 lea 0x2ca5(%rip),%rax # 3e00 <__DTOR_LIST__>
115b: 48 8d 1d a6 2c 00 00 lea 0x2ca6(%rip),%rbx # 3e08 <__DTOR_END__>
1162: 48 29 c3 sub %rax,%rbx
1165: 49 89 c4 mov %rax,%r12
1168: 48 c1 fb 03 sar $0x3,%rbx
116c: 48 ff cb dec %rbx
116f: 48 8b 05 b2 2e 00 00 mov 0x2eb2(%rip),%rax # 4028 <dtor_idx.6138>
1176: 48 39 d8 cmp %rbx,%rax
1179: 73 10 jae 118b <__do_global_dtors_aux+0x5d>
117b: 48 ff c0 inc %rax
117e: 48 89 05 a3 2e 00 00 mov %rax,0x2ea3(%rip) # 4028 <dtor_idx.6138>
1185: 41 ff 14 c4 callq *(%r12,%rax,8)
1189: eb e4 jmp 116f <__do_global_dtors_aux+0x41>
118b: e8 43 ff ff ff callq 10d3 <deregister_tm_clones>
1190: 48 83 3d 48 2e 00 00 cmpq $0x0,0x2e48(%rip) # 3fe0 <__deregister_frame_info>
1197: 00
1198: 74 0c je 11a6 <__do_global_dtors_aux+0x78>
119a: 48 8d 3d 37 0f 00 00 lea 0xf37(%rip),%rdi # 20d8 <__EH_FRAME_BEGIN__>
11a1: e8 e2 fe ff ff callq 1088 <__deregister_frame_info@plt>
11a6: 5b pop %rbx
11a7: 41 5c pop %r12
11a9: c6 05 70 2e 00 00 01 movb $0x1,0x2e70(%rip) # 4020 <completed.6136>
11b0: 5d pop %rbp
11b1: c3 retq
11b2: c3 retq
00000000000011b3 <frame_dummy>:
11b3: 48 83 3d 3d 2e 00 00 cmpq $0x0,0x2e3d(%rip) # 3ff8 <__register_frame_info>
11ba: 00
11bb: 74 18 je 11d5 <frame_dummy+0x22>
11bd: 55 push %rbp
11be: 48 8d 35 7b 2e 00 00 lea 0x2e7b(%rip),%rsi # 4040 <object.6148>
11c5: 48 8d 3d 0c 0f 00 00 lea 0xf0c(%rip),%rdi # 20d8 <__EH_FRAME_BEGIN__>
11cc: 48 89 e5 mov %rsp,%rbp
11cf: e8 bc fe ff ff callq 1090 <__register_frame_info@plt>
11d4: 5d pop %rbp
11d5: e9 1b ff ff ff jmpq 10f5 <register_tm_clones>
00000000000011da <main>:
11da: 55 push %rbp
11db: 48 89 e5 mov %rsp,%rbp
11de: 48 83 ec 30 sub $0x30,%rsp
11e2: 89 7d ec mov %edi,-0x14(%rbp)
11e5: 48 89 75 e0 mov %rsi,-0x20(%rbp)
11e9: 48 89 55 d8 mov %rdx,-0x28(%rbp)
11ed: 48 8d 3d 0c 0e 00 00 lea 0xe0c(%rip),%rdi # 2000 <_fini+0xd05>
11f4: e8 57 fe ff ff callq 1050 <puts@plt>
11f9: eb 14 jmp 120f <main+0x35>
11fb: 48 8b 45 d8 mov -0x28(%rbp),%rax
11ff: 48 8b 00 mov (%rax),%rax
1202: 48 89 c7 mov %rax,%rdi
1205: e8 46 fe ff ff callq 1050 <puts@plt>
120a: 48 83 45 d8 08 addq $0x8,-0x28(%rbp)
120f: 48 8b 45 d8 mov -0x28(%rbp),%rax
1213: 48 8b 00 mov (%rax),%rax
1216: 48 85 c0 test %rax,%rax
1219: 75 e0 jne 11fb <main+0x21>
121b: 48 8d 3d 01 0e 00 00 lea 0xe01(%rip),%rdi # 2023 <_fini+0xd28>
1222: e8 29 fe ff ff callq 1050 <puts@plt>
1227: 48 8d 3d 0d 0e 00 00 lea 0xe0d(%rip),%rdi # 203b <_fini+0xd40>
122e: e8 0d fe ff ff callq 1040 <getenv@plt>
1233: 48 89 45 f8 mov %rax,-0x8(%rbp)
1237: 48 83 7d f8 00 cmpq $0x0,-0x8(%rbp)
123c: 74 18 je 1256 <main+0x7c>
123e: 48 8b 45 f8 mov -0x8(%rbp),%rax
1242: 48 89 c6 mov %rax,%rsi
1245: 48 8d 3d f4 0d 00 00 lea 0xdf4(%rip),%rdi # 2040 <_fini+0xd45>
124c: b8 00 00 00 00 mov $0x0,%eax
1251: e8 da fd ff ff callq 1030 <printf@plt>
1256: ba 01 00 00 00 mov $0x1,%edx
125b: 48 8d 35 e8 0d 00 00 lea 0xde8(%rip),%rsi # 204a <_fini+0xd4f>
1262: 48 8d 3d d2 0d 00 00 lea 0xdd2(%rip),%rdi # 203b <_fini+0xd40>
1269: e8 f2 fd ff ff callq 1060 <setenv@plt>
126e: 48 8d 3d c6 0d 00 00 lea 0xdc6(%rip),%rdi # 203b <_fini+0xd40>
1275: e8 c6 fd ff ff callq 1040 <getenv@plt>
127a: 48 89 c6 mov %rax,%rsi
127d: 48 8d 3d cb 0d 00 00 lea 0xdcb(%rip),%rdi # 204f <_fini+0xd54>
1284: b8 00 00 00 00 mov $0x0,%eax
1289: e8 a2 fd ff ff callq 1030 <printf@plt>
128e: 48 8d 3d a6 0d 00 00 lea 0xda6(%rip),%rdi # 203b <_fini+0xd40>
1295: e8 86 fd ff ff callq 1020 <unsetenv@plt>
129a: 48 8d 3d 9a 0d 00 00 lea 0xd9a(%rip),%rdi # 203b <_fini+0xd40>
12a1: e8 9a fd ff ff callq 1040 <getenv@plt>
12a6: 48 89 c6 mov %rax,%rsi
12a9: 48 8d 3d 9f 0d 00 00 lea 0xd9f(%rip),%rdi # 204f <_fini+0xd54>
12b0: b8 00 00 00 00 mov $0x0,%eax
12b5: e8 76 fd ff ff callq 1030 <printf@plt>
12ba: ba 01 00 00 00 mov $0x1,%edx
12bf: 48 8d 35 84 0d 00 00 lea 0xd84(%rip),%rsi # 204a <_fini+0xd4f>
12c6: 48 8d 3d 6e 0d 00 00 lea 0xd6e(%rip),%rdi # 203b <_fini+0xd40>
12cd: e8 8e fd ff ff callq 1060 <setenv@plt>
12d2: b8 00 00 00 00 mov $0x0,%eax
12d7: c9 leaveq
12d8: c3 retq
00000000000012d9 <__do_global_ctors_aux>:
12d9: 55 push %rbp
12da: 48 89 e5 mov %rsp,%rbp
12dd: 53 push %rbx
12de: 48 8d 1d 0b 2b 00 00 lea 0x2b0b(%rip),%rbx # 3df0 <__CTOR_LIST__>
12e5: 52 push %rdx
12e6: 48 8b 03 mov (%rbx),%rax
12e9: 48 83 f8 ff cmp $0xffffffffffffffff,%rax
12ed: 74 08 je 12f7 <__do_global_ctors_aux+0x1e>
12ef: ff d0 callq *%rax
12f1: 48 83 eb 08 sub $0x8,%rbx
12f5: eb ef jmp 12e6 <__do_global_ctors_aux+0xd>
12f7: 58 pop %rax
12f8: 5b pop %rbx
12f9: 5d pop %rbp
12fa: c3 retq
Disassembly of section .fini:
00000000000012fb <_fini>:
12fb: 50 push %rax
12fc: e8 2d fe ff ff callq 112e <__do_global_dtors_aux>
1301: 58 pop %rax
1302: c3 retq

@ -0,0 +1,5 @@
#include "func.h"
void func()
{
printf("Hello World!\n");
}

@ -0,0 +1,5 @@
#ifndef __FUNC_H
#define __FUNC_H
#include<stdio.h>
void func();
#endif

Binary file not shown.

@ -0,0 +1,5 @@
package main
import "fmt"
func main() {
fmt.Println("hello world")
}

@ -0,0 +1 @@
print "Hello, World!"

Binary file not shown.

@ -0,0 +1,3 @@
fn main() {
println!("Hello, world!");
}

Binary file not shown.

Binary file not shown.

@ -0,0 +1,19 @@
#include <stdio.h>
#include <stdlib.h>
int *temp[1024*1024];
void test(int i)
{
// char temp[1024*1024] = {0};
char *loc;
temp[i]=malloc(1024*1024);
*temp[i] =i;
printf("%s %d num = %d!\r\n", __FUNCTION__, __LINE__, *temp[i]);
i++;
//if(i==10) return;
test(i++);
}
int main(void)
{
test(0);
return 0;
}

Binary file not shown.

@ -0,0 +1,16 @@
#include <stdio.h>
char a[4096]="\0";
FILE *fp;
void main(int argc, char** argv){
if (argc >1) {
fp = fopen(argv[1], "r");
int i=0;
while (!feof(fp))
{
fscanf(fp, "%c", &a[i]);
printf("%c",a[i]);
i++;
}
}
}

Binary file not shown.

@ -0,0 +1,16 @@
#include <stdio.h>
#include <stdlib.h>
void test(int i)
{
char temp[1024*1024] = {0};
temp[0] = i;
temp[0] ++;
printf("%s %d num = %d!\r\n", __FUNCTION__, __LINE__, temp[0]);
test(temp[0]);
}
int main(void)
{
test(0);
return 0;
}
Loading…
Cancel
Save