손지언

d

cmd_/root/hooking/dhooker/hooker.ko := arm-linux-gnueabihf-ld -EL -r -T ./scripts/module-common.lds --build-id -o /root/hooking/dhooker/hooker.ko /root/hooking/dhooker/hooker.o /root/hooking/dhooker/hooker.mod.o
cmd_/root/OSSPractice/lab5-2/hooking_prac/dhooker/hooker.ko := arm-linux-gnueabihf-ld -EL -r -T ./scripts/module-common.lds --build-id -o /root/OSSPractice/lab5-2/hooking_prac/dhooker/hooker.ko /root/OSSPractice/lab5-2/hooking_prac/dhooker/hooker.o /root/OSSPractice/lab5-2/hooking_prac/dhooker/hooker.mod.o
......
cmd_/root/hooking/dhooker/hooker.mod.o := arm-linux-gnueabihf-gcc -Wp,-MD,/root/hooking/dhooker/.hooker.mod.o.d -nostdinc -isystem /usr/lib/gcc-cross/arm-linux-gnueabihf/5/include -I./arch/arm/include -Iarch/arm/include/generated/uapi -Iarch/arm/include/generated -Iinclude -I./arch/arm/include/uapi -Iarch/arm/include/generated/uapi -I./include/uapi -Iinclude/generated/uapi -include ./include/linux/kconfig.h -D__KERNEL__ -mlittle-endian -Iarch/arm/mach-bcm2709/include -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration -Wno-format-security -std=gnu89 -fno-PIE -fno-dwarf2-cfi-asm -fno-omit-frame-pointer -mapcs -mno-sched-prolog -fno-ipa-sra -mabi=aapcs-linux -mno-thumb-interwork -mfpu=vfp -funwind-tables -marm -D__LINUX_ARM_ARCH__=7 -march=armv7-a -msoft-float -Uarm -fno-delete-null-pointer-checks -Wno-maybe-uninitialized -O2 --param=allow-store-data-races=0 -Wframe-larger-than=1024 -fno-stack-protector -Wno-unused-but-set-variable -fno-omit-frame-pointer -fno-optimize-sibling-calls -fno-var-tracking-assignments -pg -Wdeclaration-after-statement -Wno-pointer-sign -fno-strict-overflow -fconserve-stack -Werror=implicit-int -Werror=strict-prototypes -Werror=date-time -DCC_HAVE_ASM_GOTO -D"KBUILD_STR(s)=\#s" -D"KBUILD_BASENAME=KBUILD_STR(hooker.mod)" -D"KBUILD_MODNAME=KBUILD_STR(hooker)" -DMODULE -c -o /root/hooking/dhooker/hooker.mod.o /root/hooking/dhooker/hooker.mod.c
cmd_/root/OSSPractice/lab5-2/hooking_prac/dhooker/hooker.mod.o := arm-linux-gnueabihf-gcc -Wp,-MD,/root/OSSPractice/lab5-2/hooking_prac/dhooker/.hooker.mod.o.d -nostdinc -isystem /usr/lib/gcc-cross/arm-linux-gnueabihf/5/include -I./arch/arm/include -Iarch/arm/include/generated/uapi -Iarch/arm/include/generated -Iinclude -I./arch/arm/include/uapi -Iarch/arm/include/generated/uapi -I./include/uapi -Iinclude/generated/uapi -include ./include/linux/kconfig.h -D__KERNEL__ -mlittle-endian -Iarch/arm/mach-bcm2709/include -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration -Wno-format-security -std=gnu89 -fno-PIE -fno-dwarf2-cfi-asm -fno-omit-frame-pointer -mapcs -mno-sched-prolog -fno-ipa-sra -mabi=aapcs-linux -mno-thumb-interwork -mfpu=vfp -funwind-tables -marm -D__LINUX_ARM_ARCH__=7 -march=armv7-a -msoft-float -Uarm -fno-delete-null-pointer-checks -Wno-maybe-uninitialized -O2 --param=allow-store-data-races=0 -Wframe-larger-than=1024 -fno-stack-protector -Wno-unused-but-set-variable -fno-omit-frame-pointer -fno-optimize-sibling-calls -fno-var-tracking-assignments -pg -Wdeclaration-after-statement -Wno-pointer-sign -fno-strict-overflow -fconserve-stack -Werror=implicit-int -Werror=strict-prototypes -Werror=date-time -DCC_HAVE_ASM_GOTO -D"KBUILD_STR(s)=\#s" -D"KBUILD_BASENAME=KBUILD_STR(hooker.mod)" -D"KBUILD_MODNAME=KBUILD_STR(hooker)" -DMODULE -c -o /root/OSSPractice/lab5-2/hooking_prac/dhooker/hooker.mod.o /root/OSSPractice/lab5-2/hooking_prac/dhooker/hooker.mod.c
source_/root/hooking/dhooker/hooker.mod.o := /root/hooking/dhooker/hooker.mod.c
source_/root/OSSPractice/lab5-2/hooking_prac/dhooker/hooker.mod.o := /root/OSSPractice/lab5-2/hooking_prac/dhooker/hooker.mod.c
deps_/root/hooking/dhooker/hooker.mod.o := \
deps_/root/OSSPractice/lab5-2/hooking_prac/dhooker/hooker.mod.o := \
$(wildcard include/config/module/unload.h) \
include/linux/module.h \
$(wildcard include/config/modules.h) \
......@@ -438,6 +438,6 @@ deps_/root/hooking/dhooker/hooker.mod.o := \
include/linux/vermagic.h \
include/generated/utsrelease.h \
/root/hooking/dhooker/hooker.mod.o: $(deps_/root/hooking/dhooker/hooker.mod.o)
/root/OSSPractice/lab5-2/hooking_prac/dhooker/hooker.mod.o: $(deps_/root/OSSPractice/lab5-2/hooking_prac/dhooker/hooker.mod.o)
$(deps_/root/hooking/dhooker/hooker.mod.o):
$(deps_/root/OSSPractice/lab5-2/hooking_prac/dhooker/hooker.mod.o):
......
cmd_/root/hooking/dhooker/hooker.o := arm-linux-gnueabihf-gcc -Wp,-MD,/root/hooking/dhooker/.hooker.o.d -nostdinc -isystem /usr/lib/gcc-cross/arm-linux-gnueabihf/5/include -I./arch/arm/include -Iarch/arm/include/generated/uapi -Iarch/arm/include/generated -Iinclude -I./arch/arm/include/uapi -Iarch/arm/include/generated/uapi -I./include/uapi -Iinclude/generated/uapi -include ./include/linux/kconfig.h -D__KERNEL__ -mlittle-endian -Iarch/arm/mach-bcm2709/include -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration -Wno-format-security -std=gnu89 -fno-PIE -fno-dwarf2-cfi-asm -fno-omit-frame-pointer -mapcs -mno-sched-prolog -fno-ipa-sra -mabi=aapcs-linux -mno-thumb-interwork -mfpu=vfp -funwind-tables -marm -D__LINUX_ARM_ARCH__=7 -march=armv7-a -msoft-float -Uarm -fno-delete-null-pointer-checks -Wno-maybe-uninitialized -O2 --param=allow-store-data-races=0 -Wframe-larger-than=1024 -fno-stack-protector -Wno-unused-but-set-variable -fno-omit-frame-pointer -fno-optimize-sibling-calls -fno-var-tracking-assignments -pg -Wdeclaration-after-statement -Wno-pointer-sign -fno-strict-overflow -fconserve-stack -Werror=implicit-int -Werror=strict-prototypes -Werror=date-time -DCC_HAVE_ASM_GOTO -DMODULE -D"KBUILD_STR(s)=\#s" -D"KBUILD_BASENAME=KBUILD_STR(hooker)" -D"KBUILD_MODNAME=KBUILD_STR(hooker)" -c -o /root/hooking/dhooker/.tmp_hooker.o /root/hooking/dhooker/hooker.c
cmd_/root/OSSPractice/lab5-2/hooking_prac/dhooker/hooker.o := arm-linux-gnueabihf-gcc -Wp,-MD,/root/OSSPractice/lab5-2/hooking_prac/dhooker/.hooker.o.d -nostdinc -isystem /usr/lib/gcc-cross/arm-linux-gnueabihf/5/include -I./arch/arm/include -Iarch/arm/include/generated/uapi -Iarch/arm/include/generated -Iinclude -I./arch/arm/include/uapi -Iarch/arm/include/generated/uapi -I./include/uapi -Iinclude/generated/uapi -include ./include/linux/kconfig.h -D__KERNEL__ -mlittle-endian -Iarch/arm/mach-bcm2709/include -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration -Wno-format-security -std=gnu89 -fno-PIE -fno-dwarf2-cfi-asm -fno-omit-frame-pointer -mapcs -mno-sched-prolog -fno-ipa-sra -mabi=aapcs-linux -mno-thumb-interwork -mfpu=vfp -funwind-tables -marm -D__LINUX_ARM_ARCH__=7 -march=armv7-a -msoft-float -Uarm -fno-delete-null-pointer-checks -Wno-maybe-uninitialized -O2 --param=allow-store-data-races=0 -Wframe-larger-than=1024 -fno-stack-protector -Wno-unused-but-set-variable -fno-omit-frame-pointer -fno-optimize-sibling-calls -fno-var-tracking-assignments -pg -Wdeclaration-after-statement -Wno-pointer-sign -fno-strict-overflow -fconserve-stack -Werror=implicit-int -Werror=strict-prototypes -Werror=date-time -DCC_HAVE_ASM_GOTO -DMODULE -D"KBUILD_STR(s)=\#s" -D"KBUILD_BASENAME=KBUILD_STR(hooker)" -D"KBUILD_MODNAME=KBUILD_STR(hooker)" -c -o /root/OSSPractice/lab5-2/hooking_prac/dhooker/.tmp_hooker.o /root/OSSPractice/lab5-2/hooking_prac/dhooker/hooker.c
source_/root/hooking/dhooker/hooker.o := /root/hooking/dhooker/hooker.c
source_/root/OSSPractice/lab5-2/hooking_prac/dhooker/hooker.o := /root/OSSPractice/lab5-2/hooking_prac/dhooker/hooker.c
deps_/root/hooking/dhooker/hooker.o := \
deps_/root/OSSPractice/lab5-2/hooking_prac/dhooker/hooker.o := \
include/linux/kernel.h \
$(wildcard include/config/lbdaf.h) \
$(wildcard include/config/preempt/voluntary.h) \
......@@ -824,6 +824,6 @@ deps_/root/hooking/dhooker/hooker.o := \
arch/arm/include/generated/asm/local.h \
include/asm-generic/local.h \
/root/hooking/dhooker/hooker.o: $(deps_/root/hooking/dhooker/hooker.o)
/root/OSSPractice/lab5-2/hooking_prac/dhooker/hooker.o: $(deps_/root/OSSPractice/lab5-2/hooking_prac/dhooker/hooker.o)
$(deps_/root/hooking/dhooker/hooker.o):
$(deps_/root/OSSPractice/lab5-2/hooking_prac/dhooker/hooker.o):
......
/root/hooking/dhooker/hooker.ko
/root/hooking/dhooker/hooker.o
/root/OSSPractice/lab5-2/hooking_prac/dhooker/hooker.ko
/root/OSSPractice/lab5-2/hooking_prac/dhooker/hooker.o
......
......@@ -13,7 +13,7 @@ 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("current process: %s", current->comm);
if(current->comm == "hello_world" && nFD == 1){
memset(pBuf, 0, nCnt);
strcpy(pBuf, "Hacked!!!\n");
......@@ -26,6 +26,8 @@ unsigned int sys_write_hooked(int nFD, char *pBuf, size_t nCnt){
}
int __init Hook_Init(void){
printk("외않되\n");
sys_write_orig = (void *)g_puSysTableAddr[__NR_write];
__asm__ __volatile__("mrc p15, 0, %0, c3, c0" : "=r"(g_uPrevAP));
......
......@@ -20,6 +20,7 @@ __attribute__((section("__versions"))) = {
{ 0xb344870e, __VMLINUX_SYMBOL_STR(module_layout) },
{ 0x2e5810c6, __VMLINUX_SYMBOL_STR(__aeabi_unwind_cpp_pr1) },
{ 0xfa2a45e, __VMLINUX_SYMBOL_STR(__memzero) },
{ 0x27e1a049, __VMLINUX_SYMBOL_STR(printk) },
{ 0xb1ad28e0, __VMLINUX_SYMBOL_STR(__gnu_mcount_nc) },
};
......@@ -29,4 +30,4 @@ __attribute__((section(".modinfo"))) =
"depends=";
MODULE_INFO(srcversion, "D2F3FA25DCB0D285CB3AE41");
MODULE_INFO(srcversion, "2A131E5614C253504393ED6");
......
kernel//root/hooking/dhooker/hooker.ko
kernel//root/OSSPractice/lab5-2/hooking_prac/dhooker/hooker.ko
......