diff --git a/test3.c b/test3.c
index f8f532a..1f073a1 100644
--- a/test3.c
+++ b/test3.c
@@ -30,9 +30,9 @@ int main(void) {
                 if (insyscall == 0) {
                     insyscall = 1;
                     ptrace(PTRACE_GETREGS, child,
-                           NULL, regs);
+                           NULL, &regs);
                     fprintf(stdout, "Write called with "
-                            "%llu, %llu, %llu ",
+                            "%llu, %llu, %llu \n",
                             regs.rbx, regs.rcx,
                             regs.rdx);
                 } else {
diff --git a/test4.c b/test4.c
index e69de29..429ed32 100644
--- a/test4.c
+++ b/test4.c
@@ -0,0 +1,54 @@
+#include <sys/ptrace.h>
+#include <sys/types.h>
+#include <sys/wait.h>
+#include <unistd.h>
+#include <sys/user.h>
+#include <sys/syscall.h>
+#include <stdio.h>
+
+int main(void) {
+    pid_t child;
+    const int long_size = sizeof(long);
+    child = fork();
+    if (child == 0) {
+        ptrace(PTRACE_TRACEME, 0, NULL, NULL);
+        execl("/bin/ls", "ls", NULL);
+    } else {
+        int status;
+        union u {
+            long val;
+            char chars[long_size];
+        }data;
+        struct user_regs_struct regs;
+        int start = 0;
+        long ins;
+        while (1) {
+            wait(&status);
+            if (WIFEXITED(status)) {
+                break;
+            }
+
+            ptrace(PTRACE_GETREGS, child, NULL, &regs);
+            if (start == 1) {
+                start = 0;
+                ins = ptrace(PTRACE_PEEKTEXT,
+                             child, regs.rip,
+                             NULL);
+                fprintf(stdout, "RIP: %lx Instruction "
+                        "executed : %lx \n",
+                        regs.rip, ins);
+            }
+
+            if (regs.orig_rax == SYS_write) {
+                start = 1;
+                ptrace(PTRACE_SINGLESTEP, child,
+                       NULL, NULL);
+            } else {
+                ptrace(PTRACE_SYSCALL, child,
+                       NULL, NULL);
+            }
+        }
+    }
+
+    return 0;
+}
diff --git a/test5.c b/test5.c
index e69de29..adc61c0 100644
--- a/test5.c
+++ b/test5.c
@@ -0,0 +1,35 @@
+#include <sys/ptrace.h>
+#include <sys/types.h>
+#include <sys/wait.h>
+#include <unistd.h>
+#include <sys/user.h>
+#include <stdio.h>
+#include <sys/reg.h>
+#include <string.h>
+#include <stdlib.h>
+
+
+int main(int argc, char* argv[]) {
+    pid_t traced_process;
+    struct user_regs_struct regs;
+    long ins;
+    if (argc != 2) {
+        fprintf(stdout, "%s <pid to be traced> ",
+                argv[0], argv[1]);
+        exit(1);
+    }
+    traced_process = atoi(argv[1]);
+    ptrace(PTRACE_ATTACH, traced_process, NULL, NULL);
+    wait(NULL);
+    ptrace(PTRACE_GETREGS, traced_process, NULL, &regs);
+    ins = ptrace(PTRACE_PEEKTEXT, traced_process,
+                 regs.rip, NULL);
+    fprintf(stdout, "lx Instruction executed: %lx",
+            regs.rip, ins);
+    ptrace(PTRACE_DETACH, traced_process, NULL, NULL);
+
+    return 0;
+}
+
+
+
#include <sys/ptrace.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <unistd.h>
#include <sys/user.h>
#include <stdio.h>
#include <sys/reg.h>
#include <string.h>
#include <stdlib.h>

const int long_size = sizeof(long);

void Get_Data(pid_t child, long addr,
              char *str, int len);

void Put_Data(pid_t child, long addr,
             char *str, int len);

int main(int argc, char* argv[]) {
    pid_t traced_process;
    struct user_regs_struct regs, newregs;
    long ins;
    /* init 0x80, int 3 */
    char code[] = {
        0xcd, 0x80, 0xcc, 0};
    char backup[4];
    if (argc != 2) {
        fprintf(stdout, "%s <pid to be traced> ",
                argv[0], argv[1]);
        exit(1);
    }
    traced_process = atoi(argv[1]);
    ptrace(PTRACE_ATTACH, traced_process, NULL, NULL);
    wait(NULL);
    ptrace(PTRACE_GETREGS, traced_process, NULL, &regs);
    /* copy Instructions into a backup variable */
    Get_Data(traced_process, regs.rip, backup, 3);
    /* put the breakpoint */
    Put_Data(traced_process, regs.rip, code, 3);
    /* let the process continue and execute the int 3 Instruction */
    ptrace(PTRACE_CONT, traced_process, NULL, NULL);
    wait(NULL);
    fprintf(stdout, "The process stopped, putting back "
            "the originak Instructions ");
    fprintf(stdout, "Press <enter> to continue ");
    getchar();
    Put_Data(traced_process, regs.rip, backup, 3);
    /* setting the rip back to the original
     * Instruction to let the process continue */
    ptrace(PTRACE_SETREGS, traced_process, NULL, &regs);
    ptrace(PTRACE_DETACH, traced_process, NULL, NULL);
    return 0;
}

void Get_Data(pid_t child, long addr,
              char *str, int len) {
    char *laddr;
    int i, j;
    union u {                           /* notice */
        long val;
        char chars[long_size];
    }data;

    i = 0;
    j = len / long_size;
    laddr = str;

    while (i < j) {
        data.val = ptrace(PTRACE_PEEKDATA, child,
                          addr + i * 8, NULL);
        memcpy(laddr, data.chars, long_size);
        ++i;
        laddr += long_size;
    }

    j = len % long_size;
    if (j != 0) {
        data.val = ptrace(PTRACE_PEEKDATA, child,
                          addr + i * 8, NULL);
        memcpy(laddr, data.chars, j);
    }
    str[len] = ' ';
}

void Put_Data(pid_t child, long addr,
             char *str, int len) {
    char *laddr;
    int i, j;
    union u {
        long val;
        char chars[long_size];
    }data;

    i = 0;
    j = len / long_size;
    laddr = str;
    while (i < j) {
        memcpy(data.chars, laddr, long_size);
        ptrace(PTRACE_PEEKDATA, child,
               addr + i * 8, data.val);
        ++i;
        laddr += long_size;
    }
    j = len % long_size;
    if (j != 0) {
        memcpy(data.chars, laddr, j);
        ptrace(PTRACE_PEEKDATA, child,
               addr + i * 8, data.val);
    }
}