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 


How Could I randomize a float value In AA Script?

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

Joined: 22 Jan 2018
Posts: 19
Location: USA

PostPosted: Wed Feb 21, 2024 5:17 pm    Post subject: How Could I randomize a float value In AA Script? Reply with quote

I'm trying to make the projectile appear randomly when shooting from the player's perspective.

How can we go about randomzing [yShot] variable? I tried making compares and jumps with no luck so far.

Code:
[ENABLE]

aobscanmodule(yProjectiles,halo1.dll,F3 41 0F 10 46 04 F3 0F 59 F0)
alloc(newmem1,$1024,yProjectiles)
alloc(yShot,$8,yProjectiles)

label(code1)
label(return1)

yShot:
  dd (float)5

newmem1:
  movss xmm0,[yShot]
  jmp return1

code1:
  movss xmm0,[r14+04]
  jmp return1

yProjectiles:
  jmp newmem1
  nop
return1:
registersymbol(yProjectiles)
registersymbol(yShot)

[DISABLE]

yProjectiles:
  db F3 41 0F 10 46 04

unregistersymbol(*)
dealloc(*)



Sample Code.PNG
 Description:
Projectile Y offset
 Filesize:  38.94 KB
 Viewed:  641 Time(s)

Sample Code.PNG


Back to top
View user's profile Send private message
Gear2ndGandalf
Newbie cheater
Reputation: 0

Joined: 22 Jan 2018
Posts: 19
Location: USA

PostPosted: Thu Feb 22, 2024 2:22 am    Post subject: Reply with quote

To answer my question above. This cheat makes it look like Master Chief is firing from multiple directions.

I followed a Stephen Chapman Terreria random number gen tutorial and it worked!

Code:
[ENABLE]

aobscanmodule(yProjectiles,halo1.dll,F3 41 0F 10 46 04 F3 0F 59 F0)
alloc(newmem1,$1024,yProjectiles)
alloc(retAddress,$48,yProjectiles)
alloc(rngGen,$48,yProjectiles)

label(opt1)
label(opt2)
label(opt3)
label(opt4)
label(opt5)
label(opt6)
label(opt7)
label(opt8)
label(opt9)
label(optA)
label(optB)
label(optC)
//label(originalCode)
label(return1)

rngGen:
  push rax
  push rcx
  push rdx
  mov rcx,C
  rdtsc
  xor rdx,rdx
  shr rax,1
  idiv rcx
  inc rdx
  jmp [retAddress]

newmem1:
  push rbx
  lea rbx,[newmem1+15]
  mov [retAddress],rbx
  pop rbx
  jmp rngGen
  cmp rdx,1
  je opt1
  cmp rdx,2
  je opt2
  cmp rdx,3
  je opt3
  cmp rdx,4
  je opt4
  cmp rdx,5
  je opt5
  cmp rdx,6
  je opt6
  cmp rdx,7
  je opt7
  cmp rdx,8
  je opt8
  cmp rdx,9
  je opt9
  cmp rdx,A
  je optA
  cmp rdx,B
  je optB
  cmp rdx,C
  je optC
  jmp return1

opt1:
  pop rdx
  pop rcx
  pop rax
  mov [r14+04],(float)-6
  movss xmm0,[r14+04]
  jmp return1

opt2:
  pop rdx
  pop rcx
  pop rax
  mov [r14+04],(float)-5
  movss xmm0,[r14+04]
  jmp return1

opt3:
  pop rdx
  pop rcx
  pop rax
  mov [r14+04],(float)-4
  movss xmm0,[r14+04]
  jmp return1

opt4:
  pop rdx
  pop rcx
  pop rax
  mov [r14+04],(float)-3
  movss xmm0,[r14+04]
  jmp return1

opt5:
  pop rdx
  pop rcx
  pop rax
  mov [r14+04],(float)-2
  movss xmm0,[r14+04]
  jmp return1

opt6:
  pop rdx
  pop rcx
  pop rax
  mov [r14+04],(float)-1
  movss xmm0,[r14+04]
  jmp return1

opt7:
  pop rdx
  pop rcx
  pop rax
  mov [r14+04],(float)1
  movss xmm0,[r14+04]
  jmp return1

opt8:
  pop rdx
  pop rcx
  pop rax
  mov [r14+04],(float)2
  movss xmm0,[r14+04]
  jmp return1

opt9:
  pop rdx
  pop rcx
  pop rax
  mov [r14+04],(float)3
  movss xmm0,[r14+04]
  jmp return1

optA:
  pop rdx
  pop rcx
  pop rax
  mov [r14+04],(float)4
  movss xmm0,[r14+04]
  jmp return1

optB:
  pop rdx
  pop rcx
  pop rax
  mov [r14+04],(float)5
  movss xmm0,[r14+04]
  jmp return1

optC:
  pop rdx
  pop rcx
  pop rax
  mov [r14+04],(float)6
  movss xmm0,[r14+04]
  jmp return1

originalCode:
  movss xmm0,[r14+04]
  jmp return1

yProjectiles:
  jmp newmem1
  nop
return1:
registersymbol(yProjectiles)
registersymbol(retAddress)
registersymbol(rngGen)

[DISABLE]

yProjectiles:
  db F3 41 0F 10 46 04

unregistersymbol(*)
dealloc(*)



Sample Code 1.PNG
 Description:
code
 Filesize:  92.79 KB
 Viewed:  611 Time(s)

Sample Code 1.PNG



Sample Code 2.PNG
 Description:
code continued
 Filesize:  54.79 KB
 Viewed:  611 Time(s)

Sample Code 2.PNG


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 Lua Scripting 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