mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-30 21:34:27 +01:00
userland: add assembly support
Move arm assembly cheat here, and start some work on x86 cheat as well.
This commit is contained in:
16
userland/arch/x86_64/c/add.c
Normal file
16
userland/arch/x86_64/c/add.c
Normal file
@@ -0,0 +1,16 @@
|
||||
#include <assert.h>
|
||||
#include <inttypes.h>
|
||||
|
||||
int main(void) {
|
||||
uint64_t in1 = 0xFFFFFFFF;
|
||||
uint64_t in2 = 0x1;
|
||||
uint64_t out;
|
||||
__asm__ (
|
||||
"lea (%[in1], %[in2]), %[out];"
|
||||
: [out] "=r" (out)
|
||||
: [in1] "r" (in1),
|
||||
[in2] "r" (in2)
|
||||
:
|
||||
);
|
||||
assert(out == 0x100000000);
|
||||
}
|
||||
Reference in New Issue
Block a user