Using the uinput kernel module in Lisp/SBCL - linux

is there currently any way to use the uinput kernel module in SBCL? I have not been able to find any library myself (except some Japanese[?] guy's github: https://github.com/quek/info.read-eval-print.cl-mayu/blob/master/mayu.lisp ) so I was wondering if anyone knew anything about that.
Am I supposed to use some kind of SBCL-specific package? Am I supposed to generate my own bindings for this using something like CFFI?

I think it's safe to say there is no finished library you can use. However, that github repo seems to be a good place to look for ideas for making your own.

Related

NSIS - Compile with opcode re arranged to prevent access to source code

I am trying to reduce and make as difficult as possible the ability to access my source code after being compiled by NSIS. I have read that the only way to reduce the chance of unzipping is to modify the order of the opcodes in the Source\fileform.h from the source code and then Compile the new version.
This is a bit over my head. I was wondering if anyone has done this before and willing to post one they have done. (Or create one for me?)
Main reason for this is I have info that I encrypt using blow-fish within NSIS and do not want the chance oFf someone finding out what the encryption keys are. (Used for licencing the software) I understand noting is fool proof, but just want it as difficult as possible.
I know its asking a lot, but could really this.
Thanks!
I don't believe there are any publicly available modified builds like that. And if there were and it got popular, the decompilers would just add support for it.
I have a complete step-by-step guide to building NSIS here.
If you know C/C++, Delphi or C# you could build your own private NSIS plug-in that handles the encryption details.
No matter what you do, somebody who knows how to use a debugger can easily set a breakpoint on the blow-fish plug-in and view your key. The only way around that is a custom plug-in or an external application that handles the cryptography internally...

Can I write a CoffeeScript lib the same way for the server and client?

I'm trying to write a modular library in CoffeeScript. I want to write the code once, and use it in the same way on the server (running Node in this case) and on the browser. How can I do this?
My code structure is like this...
src/a.coffee
src/b.coffee
src/c.coffee
And my dependencies are like this...
a depends on b, c depends on a and b.
I've tried Browserify and requirejs, but I couldn't quite get there with it. I've also looked into Traceur but that's no use since I'm using CoffeeScript. I'm really at a loss, the only thing I can think of, is bundling it all up in one file and doing it traditionally as explained in this blog... https://alicoding.com/write-javascript-modules-that-works-both-in-nodejs-and-browser-with-requirejs/. I really don't want to do that, I'd probably just write it in Dart sooner than I would bundle it up like that. CoffeeScript is really letting me down with this particular issue.
I forgot to resolve this. I ended up using https://github.com/jrburke/amdefine.

Attaching a compilation flag to a Linux kernel build

What is the best practice for adding a compilation flag when building the Linux kernel? I'm interested to know this both generally because I encounter the same issue from time to time and specifically for enabling kenter, kdebug and kleave traces in http://lxr.free-electrons.com/source/security/keys/internal.h.
When you compile a module you can use CFLAGS_MODULE but that doesn't seem to inject into subtree builds when you compile the whole kernel.
Currently I just add a define directly to the source file, which is not a very lean solution.
It was quite easy and actually I had used this previously but just had forgotten it. You can just use make CFLAGS_KERNEL="<flags>".

Programming a kernel module, so that I can serve?

I wish someone could tell me the advantage of creating a module to the kernel because it can not see the difference with a normal executable. I know that depends on the task at hand but I could give an example?
How to building kernel modules depends on your needs.
For further instruction please read something like http://www.tldp.org/LDP/lkmpg/2.6/html/lkmpg.html
After that if you have some more detailed question regarding on how to create kernel modules feel free to come back ;)

Is it possible to add a system call via a LKM?

I'd like to add a new system call via an LKM, but I'm not sure how to do this. That is, I know that if I want to add a completely new system call, I can look through the sys_call_table and find a sys_ni_syscall and just replace it, but I was curious if it was possible to actually add to the sys_call_table. I realize it's probably not possible, given that it's a fixed size array, but I was wondering if there were any other clever ways to add system calls without overriding an unused system call number.
Here's an example
linux system calls
edit:
The example above shows howto implement a system call, as far as implementing one from a loadable module; AFAIK, that's not possible, unless you where to overwrite an existing one because the size of the array is a #define.
Keep in mind there are user space changes required as well, at least if you want to be able to actually use the new system call.
Check The Linux Documentation Project website for "The Linux Kernel Module Programming Guide" (http://www.tldp.org/LDP/lkmpg/2.6/html/index.html). Specifically, look here for System Calls: http://www.tldp.org/LDP/lkmpg/2.6/html/x978.html. That should give you a start, at least.
This is an old question, but nevertheless I want to propose my solution. The easiest way to implement a "system-call-like" environment is to rely on a fake device.
In particular, you could create a new device driver which is not actually driving anything. Yet, writing on it, can cause the installed module to perform the required actions.
Additionally, if you want to offer several services, you might map them to ioctl operations.

Resources