Toggle navigation
Toggle navigation
This project
Loading...
Sign in
손지언
/
2019102185
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Network
Create a new issue
Commits
Issue Boards
Authored by
손지언
2022-02-09 07:36:07 +0000
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
87bf4d34c67d8644586d3103b365cbe024ede622
87bf4d34
1 parent
351743ea
d
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
4 additions
and
5 deletions
lab5-2/hooking_prac/dhooker/hooker.c
lab5-2/hooking_prac/dhooker/hooker.mod.c
lab5-2/hooking_prac/dhooker/hooker.mod.o
lab5-2/hooking_prac/dhooker/hooker.o
lab5-2/hooking_prac/hooker.ko
lab5-2/hooking_prac/dhooker/hooker.c
View file @
87bf4d3
...
...
@@ -2,7 +2,6 @@
#include <linux/module.h>
#include <linux/syscalls.h>
#include <linux/string.h>
#define SYSCALL_TABLE_BASE_ADDR (0x8000fc28)
#define MANAGER_PERMISSION (0xff)
...
...
@@ -13,9 +12,9 @@ unsigned int (* sys_write_orig)(int fd, char *byf, size_t count);
//sys_write_orig() 호출 전 pBuF의 내용 수정
unsigned
int
sys_write_hooked
(
int
nFD
,
char
*
pBuf
,
size_t
nCnt
){
printk
(
"hooker 호출!
\n
"
);
if
(
current
->
comm
==
"hello_world"
&&
nFD
==
1
){
printk
(
"
current process: %s"
,
current
->
comm
);
printk
(
"
hello world 호출
\n
"
);
memset
(
pBuf
,
0
,
nCnt
);
strcpy
(
pBuf
,
"Hacked!!!
\n
"
);
return
sys_write_orig
(
nFD
,
pBuf
,
nCnt
);
...
...
@@ -28,7 +27,7 @@ unsigned int sys_write_hooked(int nFD, char *pBuf, size_t nCnt){
int
__init
Hook_Init
(
void
){
printk
(
"
외않되
\n
"
);
printk
(
"
hook 초기화
\n
"
);
sys_write_orig
=
(
void
*
)
g_puSysTableAddr
[
__NR_write
];
__asm__
__volatile__
(
"mrc p15, 0, %0, c3, c0"
:
"=r"
(
g_uPrevAP
));
...
...
lab5-2/hooking_prac/dhooker/hooker.mod.c
View file @
87bf4d3
...
...
@@ -30,4 +30,4 @@ __attribute__((section(".modinfo"))) =
"depends="
;
MODULE_INFO
(
srcversion
,
"6
656FAE980A32BBBB7648FE
"
);
MODULE_INFO
(
srcversion
,
"6
0CA43AA8E3D9473F7FCAB6
"
);
...
...
lab5-2/hooking_prac/dhooker/hooker.mod.o
View file @
87bf4d3
No preview for this file type
lab5-2/hooking_prac/dhooker/hooker.o
View file @
87bf4d3
No preview for this file type
lab5-2/hooking_prac/hooker.ko
View file @
87bf4d3
No preview for this file type
Please
register
or
login
to post a comment