Closed k1gen closed 9 months ago
Hey,
...
ERROR: modpost: missing MODULE_LICENSE() in /home/olk/temp/Diamorphine/diamorphine.o
...
Try to add MODULE_LICENSE
to your module.
vagrant@vagrant:~/diamorphine$ uname -r
5.4.0-120-generic
vagrant@vagrant:~/diamorphine$ make
make -C /lib/modules/5.4.0-120-generic/build M=/home/vagrant/diamorphine modules
make[1]: Entering directory '/usr/src/linux-headers-5.4.0-120-generic'
CC [M] /home/vagrant/diamorphine/../../../home/vagrant/diamorphine/khook/engine.o
CC [M] /home/vagrant/diamorphine/../../../home/vagrant/diamorphine/khook/x86/hook.o
AS [M] /home/vagrant/diamorphine/../../../home/vagrant/diamorphine/khook/x86/stub.o
LD [M] /home/vagrant/diamorphine/diamorphine.o
Building modules, stage 2.
MODPOST 1 modules
WARNING: modpost: missing MODULE_LICENSE() in /home/vagrant/diamorphine/diamorphine.o
see include/linux/module.h for more information
CC [M] /home/vagrant/diamorphine/diamorphine.mod.o
LD [M] /home/vagrant/diamorphine/diamorphine.ko
make[1]: Leaving directory '/usr/src/linux-headers-5.4.0-120-generic'
Works for 5.4.0-120-generic
kernel (ubuntu).
@milabs: hey, thanks for the quick reply. this was the first thing I checked - do you mean this: https://github.com/k1gen/diamorphine/blob/main/diamorphine.c#L295 ? this also doesn't work for 6.1 on debian 12:
Ok, it seems the problem is that you name your module diamorphine
. It's the issue of Kbuild system, check that change:
Also, check how khook_demo
uses khook
. Ideally, you'll need just to add a khook
as submodule and include it's Makefile.khook
.
thanks, it works now! can't believe I didn't try that. the whole reason behind integrating khook though - skipping cpu ticks for a hidden process (https://github.com/k1gen/diamorphine/blob/main/diamorphine.c#L222) doesn't work for some reason :( could you please have a look at that if you have time? I got that piece of code from here: https://github.com/alfonmga/hiding-cryptominers-linux-rootkit/blob/master/main.c#L331
I am trying to integrate khook into https://github.com/k1gen/diamorphine, and I can't compile the module with khook: