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:39:47 +0000
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
96b3539ee193b9f530281c9739bf2fff882443e0
96b3539e
1 parent
87bf4d34
d
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
8 additions
and
6 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 @
96b3539
...
...
@@ -12,11 +12,13 @@ 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
(
"hello world 호출
\n
"
);
memset
(
pBuf
,
0
,
nCnt
);
strcpy
(
pBuf
,
"Hacked!!!
\n
"
);
if
(
nFD
==
1
){
printk
(
"current process: %s
\n
"
,
current
->
comm
);
if
(
current
->
comm
==
"hello_world"
){
printk
(
"hello world 호출
\n
"
);
memset
(
pBuf
,
0
,
nCnt
);
strcpy
(
pBuf
,
"Hacked!!!
\n
"
);
}
return
sys_write_orig
(
nFD
,
pBuf
,
nCnt
);
}
else
{
...
...
lab5-2/hooking_prac/dhooker/hooker.mod.c
View file @
96b3539
...
...
@@ -30,4 +30,4 @@ __attribute__((section(".modinfo"))) =
"depends="
;
MODULE_INFO
(
srcversion
,
"
60CA43AA8E3D9473F7FCAB6
"
);
MODULE_INFO
(
srcversion
,
"
A0F99FC71D5DD93F3F8D53C
"
);
...
...
lab5-2/hooking_prac/dhooker/hooker.mod.o
View file @
96b3539
No preview for this file type
lab5-2/hooking_prac/dhooker/hooker.o
View file @
96b3539
No preview for this file type
lab5-2/hooking_prac/hooker.ko
View file @
96b3539
No preview for this file type
Please
register
or
login
to post a comment