[Auto Assemble] Generate random number from 0 to K

Upload *YOUR* gamehacking tools/helpers here
Post Reply
mshumsky.info
What is cheating?
What is cheating?
Posts: 1
Joined: Sat Jul 01, 2023 7:04 pm
Reputation: 0

[Auto Assemble] Generate random number from 0 to K

Post by mshumsky.info »

Keep in mind: [Link]
Replace K with maximum value limit u want; in real u need code only from 'start' section; everything related to certain app replaced with '...' just to keep CE AA code structure

Code: Select all

[Enable]
alloc(start, 2048)
label(originalcode)
label(exit)
label(randomValue)          // There stored generated random value
label(returnhere)

start:
pushad
mov     eax, 0x2000001      // RDTSC (https://www.felixcloutier.com/x86/rdtsc)
cpuid
rdtsc
and     eax, K              // Modulo by 4 to get a number between N and K
mov     [randomValue], eax  // Remember generated value by writing it to cave's address
popad

originalcode:
mov     eax, [randomValue]  // In original code game wrote here into eax result of function which is an integer in range from N to K
mov     ebp,eax
mov     edi, [...]

exit:
jmp returnhere

randomValue:
dd      0

...:
jmp     start
nop     3
returnhere:


[Disable]
dealloc(start)
...


Post Reply

Who is online

Users browsing this forum: Bing [Bot]