Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


code to make value random

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine
View previous topic :: View next topic  
Author Message
bronywarlord
Newbie cheater
Reputation: 0

Joined: 14 Feb 2016
Posts: 20

PostPosted: Fri Jan 19, 2018 4:54 am    Post subject: code to make value random Reply with quote

what's the code to make a value random in auto assembly?

instructions for what writes the address is 083B966C - 89 41 30 - mov [ecx+30],eax
Back to top
View user's profile Send private message Send e-mail
Dark Byte
Site Admin
Reputation: 458

Joined: 09 May 2003
Posts: 25287
Location: The netherlands

PostPosted: Fri Jan 19, 2018 5:04 am    Post subject: Reply with quote

try calling msvcrt.rand
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
bronywarlord
Newbie cheater
Reputation: 0

Joined: 14 Feb 2016
Posts: 20

PostPosted: Fri Jan 19, 2018 5:10 am    Post subject: Reply with quote

This is my auto auto assembly code where do I paste random number code(HEX) if there is no way to do random number gen than I would like a script that goes from FF0000 to FFFF00, to FF00FF to 00FF00, to 0000FF to 00FFFF
[ENABLE]
//code from here to '[DISABLE]' will be used to enable the cheat

alloc(newmem,2048)
label(returnhere)
label(originalcode)
label(exit)

newmem: //this is allocated memory, you have read,write,execute access
//place your code here

originalcode:
mov [ecx+30],eax
lea ebx,[ebx+000000AC]

exit:
jmp returnhere

083B966C:
jmp newmem
nop
nop
nop
nop
returnhere:



[DISABLE]
//code from here till the end of the code will be used to disable the cheat
Back to top
View user's profile Send private message Send e-mail
OldCheatEngineUser
Whateven rank
Reputation: 20

Joined: 01 Feb 2016
Posts: 1587

PostPosted: Fri Jan 19, 2018 6:05 am    Post subject: Reply with quote

it should give you a 2 byte random number.
Code:
newmem:

mov eax,-1
call msvcrt.rand

_________________
About Me;
I Use CE Since Version 1.X, And Still Learning How To Use It Well!
Jul 26, 2020
STN wrote:
i am a sweetheart.
Back to top
View user's profile Send private message Visit poster's website
bronywarlord
Newbie cheater
Reputation: 0

Joined: 14 Feb 2016
Posts: 20

PostPosted: Fri Jan 19, 2018 6:46 am    Post subject: Reply with quote

do i paste this where it says original code? My address is 4 bytes.
Back to top
View user's profile Send private message Send e-mail
Rudo
Advanced Cheater
Reputation: 2

Joined: 27 Jun 2015
Posts: 80

PostPosted: Fri Jan 19, 2018 6:50 am    Post subject: Reply with quote

Code:
call msvcrt.rand

after this call you will have a 2 byte random number in EAX register, then you can do all the fancy stuff from there
Back to top
View user's profile Send private message
bronywarlord
Newbie cheater
Reputation: 0

Joined: 14 Feb 2016
Posts: 20

PostPosted: Fri Jan 19, 2018 7:12 am    Post subject: Reply with quote

i want the value to change constantly though. i don't want to have just one value i want it to change from a random value in the coarse of 1 second.
Back to top
View user's profile Send private message Send e-mail
Rudo
Advanced Cheater
Reputation: 2

Joined: 27 Jun 2015
Posts: 80

PostPosted: Fri Jan 19, 2018 8:37 am    Post subject: Reply with quote

Code:
{ Author: ParkourPenguin
  Date: 27 / 03 / 2016

  This script generates a pseudorandom number between [lowerBound] and
  [upperBound] (inclusive) every [interval] ms. Stored in myRandomNumber.

  Please note that msvcrt.rand is only guaranteed to return a number from 0
  to 32767.
}
[ENABLE]
alloc(newmem,2048)
label(asTimeGoesBy)
label(lowerBound)
label(upperBound)
label(interval)
label(myRandomNumber)
label(shouldExit)

registersymbol(lowerBound)
registersymbol(upperBound)
registersymbol(interval)
registersymbol(myRandomNumber)
registersymbol(shouldExit)

createthread(newmem)

newmem:
  call kernel32.GetTickCount
  push eax
  call msvcrt.srand
  add esp,4
asTimeGoesBy:
  call msvcrt.rand
  xor edx,edx
  mov ebx,[lowerBound]
  mov ecx,[upperBound]
  cmp ecx,ebx
  cmovl ecx,ebx
  inc ecx
  sub ecx,ebx
  idiv ecx
  add edx,ebx
  mov [myRandomNumber],edx
  push [interval]
  call kernel32.Sleep
  cmp [shouldExit],0
  je asTimeGoesBy
// free memory, return
  pop eax
  push 8000
  push 0
  push newmem
  push eax
  jmp kernel32.VirtualFree
  db CC CC CC CC CC CC
lowerBound:
  dd #10
upperBound:
  dd #20
interval:
  dd #1000
myRandomNumber:
  dd 0
shouldExit:
  dd 0

[DISABLE]
shouldExit:
  dd 1

unregistersymbol(lowerBound)
unregistersymbol(upperBound)
unregistersymbol(interval)
unregistersymbol(myRandomNumber)
unregistersymbol(shouldExit)

This script should show you how to do it, was posted by ParkourPenguin in another thread
Back to top
View user's profile Send private message
DerKO
How do I cheat?
Reputation: 0

Joined: 31 Dec 2017
Posts: 6

PostPosted: Sat Jan 20, 2018 2:35 am    Post subject: Reply with quote

What I would do is find a global timer that counts up really fast. How to find one is you do unknown initial value scan and then constantly click increased value scan while you do stuff like go into menus loading zones etc. Once you have a timer, you can just use the last digit(s) as a seed to be input into some RNG math functions you make yourself. The faster the timer the better
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites