first draft, should work but have to try on a x86 machine
This commit is contained in:
parent
a933468d61
commit
6414474ce0
4 changed files with 206 additions and 61 deletions
|
|
@ -6,7 +6,7 @@
|
|||
/* By: thrieg <thrieg@student.42mulhouse.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/12/11 04:06:00 by thrieg #+# #+# */
|
||||
/* Updated: 2025/12/11 05:54:47 by thrieg ### ########.fr */
|
||||
/* Updated: 2025/12/11 23:17:28 by thrieg ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
@ -16,12 +16,19 @@
|
|||
#include <unistd.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <errno.h>
|
||||
#include <string.h>
|
||||
#include <sys/ptrace.h>
|
||||
#include <sys/wait.h>
|
||||
#include <signal.h>
|
||||
#include "../libft/libft.h"
|
||||
|
||||
//returns 64 for x84_64, or 32 for 32 bits, -1 for open/read error, -2 for unrecognised file type
|
||||
ssize_t binary_type(char *path_to_binary);
|
||||
void read_regs_and_print_exit(pid_t pid, size_t binary_type);
|
||||
void read_regs_and_print_entry(pid_t pid, size_t binary_type);
|
||||
void print_signal(pid_t pid, int sig);
|
||||
|
||||
typedef struct s_syscall_desc {
|
||||
const char *name;
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
/* By: thrieg <thrieg@student.42mulhouse.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/12/11 05:56:09 by thrieg #+# #+# */
|
||||
/* Updated: 2025/12/11 05:58:14 by thrieg ### ########.fr */
|
||||
/* Updated: 2025/12/11 23:25:53 by thrieg ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
@ -402,4 +402,4 @@ static const t_syscall_desc g_syscalls_32[] = {
|
|||
};
|
||||
|
||||
const size_t g_syscalls_32_len =
|
||||
sizeof(g_syscalls_64) / sizeof(g_syscalls_64[0]);
|
||||
sizeof(g_syscalls_32) / sizeof(g_syscalls_32[0]);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue