Jan 13, 2025
10:37:31pm
kapcreations All-American
Or even better
int random01() {
return ({
int x;
asm volatile(
"1: call random;" // Call the `random` function
"cmp $5, %%eax;" // Compare the result with 5
"je 1b;" // If equal, jump back to label 1
"mov %%eax, %0;" // Store the result in x
: "=r"(x) // Output operand (x)
: // No input operands
: "eax" // Clobbered registers
);
(x % 2) << 1 >> 1; // Obfuscate with pointless shifts
});
}
kapcreations
Bio page
kapcreations
Joined
Aug 17, 2010
Last login
Jan 16, 2025
Total posts
5,018 (19 FO)
Messages
Author
Time
Jan 13, 10:03pm
Jan 13, 10:03pm

Posting on CougarBoard

In order to post, you will need to either sign up or log in.