Hi everyone. I would like to hook a system function (gettimeofday) to modify it. I guess I'll need kernel mode to do that. By the way, how could I do it (c++ or c)?
I want to modify that function for one process which I know the PID. So I need to return my own value for that PID and real value for any other PID.
You may be able to do this without resorting to hacking and recompiling your kernel, but it depends on your system, what is it?
libkeepalive for instance overloads the socket() call without modifying the kernel, by intercepting function calls in libc. It needs the LD_PRELOAD option though, which AFAIK is linux-specific.
I would like to do a kind of "speed hack" like Cheat Engine does for Windows. So I need to modify that function to return fake values, so apps think the time between tick and tick was twice or thrice of the real.
I don't care about the method if it can be applied to any application, and it doesn't do any kind of lag because the code. So all you give me will be accepted.
LD_PRELOAD will work for you then. Take a look at the code used in libkeepalive, it overrides socket(), you should be able to override gettimeofday() the same way. Force your fake library to be overloaded first with LD_PRELOAD="/path/to/my/fake/library.so" and it will call timeofday from it instead if it finds it there.
Do not export LD_PRELOAD="..." for the whole system, just when running that application. You could mess up your system pretty severely if it got preloaded in places you didn't intend.
I'm forcing that function to print twice as the time that happened but nothing happens. To test, I added print("LOOOLAZO") but it doesn't print . Here is the code I'm using:
speed hack library:
executable main.cpp:
Line export:
When accessing a user mode buffers from kernel space drivers what precautions must we take and how those precautions need to be implemented? (0 Replies)
Hi,all:
I run my program which consists of one kernel module and one user mode process on a dual core server. The problem here is the kernel module consumes 100% of one core while the user mode process only consumes 10% of the other core, is there any solution that I can assign some computing... (1 Reply)
Hi, i'm another question:
I'm a directory /usr/data on my server sco unix 5.0.5:
# du /usr/data
4386948 /usr/data
I'm tried to connect to ftp directory /usr/data to this server and:
PANIC: k_trap - Kernel mode trap type 0x0000000E
Cannot dump 262040 pages to dumpdev hd(1/41):space... (3 Replies)
Hi all i have queastion. Can anybody pease help me
what is user mode and kernel mode and the term "De-mountable volumes" means?
Thanks
Palash (2 Replies)
Hi all,
I am trying to setup a program to use a device driver and am confusing buffer access between User and Kernel mode. I think all applications running in User space have to communicate with the device drivers using io control calls and then have some functions called back from the driver... (1 Reply)
ok so I just installed fedora core 6 on my dell inspiron 700m and I go to boot into linux and I get this error. Has anyone seen this before?
I also had XP Pro and Vista installed on this pc prior to putting fedora core 6 on the machine. I'm trying to setup a triple boot system.
Please Help... (2 Replies)
hi,
I am trying to install sco openserver 5.0.4 on an old system. However, l was not able to proceed after putting the bootstr
l have this panic message of
PANIC: K_trap - kernel mode trap tupe 0x00000006
will someone kindly help to decode this error
kayode (1 Reply)
HELP is urgently required,
I run on SCO Unix 3 and this is the panic message that I get every time that I reboot 10U
k_trap - kernel mode trap type 0x0000000E
I have checked the swap already having the following results:
#swap -l
path dev swaplo blocks free... (3 Replies)