CoSMOS Gamehacking Tool

Page 1 of 1
Signup or Login to Post
How to find and alter random return?
  • Current rank: 1 Star. Next Rank at 100 Posts.
    Send a message to Xive
    ELITE
    Xive posted on Jan 09, 2020 9:09:12 AM - Report post
     
    I'm currently trying to find out how to get the address of the base random function and what it returns. In many games you have a random seed that return 0...1 value and uses that to calculate what you get as drop ( range value for hits or anything really).

    Now how can i find that random function and alter what it returns to say a set value, like I want it to always return 1 which means "Heads" in a flip coin game for instance.
    How would i go about finding this value when there is no indicators or anything showing so I don't quite know where to start?
  • Trainer Maker
    Send a message to 0x90
    STAFF
    0x90 posted on Jan 09, 2020 10:31:02 AM - Report post
     
    Depends on how the random value is generated. If you're luckily it uses an existing random function instead of its own. Then you can set a breakpoint at the return function to see where its getting accessed from (might be getting accessed a lOT).

    Example for Borderlands 3:
    Open disassembly and go to "ucrtbase.rand"
    Set breakpoint on the ret instruction (likely better using 'Find out what access' on this)
    Ingame trigger the function. If you are looking for loot dropped by enemies then kill an enemy for example.

    It is your job then to figure out the actual spot that access these random function and manipulate it this way to always return the same.

    A quick way to see if the game uses that function is to write an injection script at the ret instruction and always return a fixed value instead. Then see if your loot for example is always the same or not.
  • Current rank: 1 Star. Next Rank at 100 Posts.
    Send a message to Xive
    ELITE
    Xive posted on Jan 09, 2020 12:55:58 PM - Report post
     
    quote:
    originally posted by 0x90

    Depends on how the random value is generated. If you're luckily it uses an existing random function instead of its own. Then you can set a breakpoint at the return function to see where its getting accessed from (might be getting accessed a lOT).

    Example for Borderlands 3:
    Open disassembly and go to "ucrtbase.rand"
    Set breakpoint on the ret instruction (likely better using 'Find out what access' on this)
    Ingame trigger the function. If you are looking for loot dropped by enemies then kill an enemy for example.

    It is your job then to figure out the actual spot that access these random function and manipulate it this way to always return the same.

    A quick way to see if the game uses that function is to write an injection script at the ret instruction and always return a fixed value instead. Then see if your loot for example is always the same or not.

    Thank you for the tips, going to load up borderlands 3 and see if I get it right. Current game I was trying to find the random function on uses unity engine, but could never get a breakpoint to go off on the usual functions used for random so guessing it uses a custom version or some other framework that will take a bit of digging to figure out.

Page 1 of 1
Signup or Login to Post
All times are (GMT -06:00) Central Time (US & Canada). Current time is 10:41:05 PM