Write into shared memory space?

Discussion in 'Apps' started by legar, Dec 31, 2021.

  1. legar

    legar New Member

    Joined:
    Dec 31, 2021
    Messages:
    3
    Likes Received:
    0
    Hi,

    I would like the change the value of normalizedCarPosition. Is it possible to change the values in the shared memory?
     
  2. fughettaboutit

    fughettaboutit aka leBluem

    Joined:
    Jul 21, 2014
    Messages:
    1,117
    Likes Received:
    379
    thats read only values, what you wanna achieve? is this for replays?
     
  3. legar

    legar New Member

    Joined:
    Dec 31, 2021
    Messages:
    3
    Likes Received:
    0
    I just wanted to make a single player teleportation mod to easily practice some corners. I guess it's not possible without reverse engineering (and assuming it's not legal...)
     
  4. fughettaboutit

    fughettaboutit aka leBluem

    Joined:
    Jul 21, 2014
    Messages:
    1,117
    Likes Received:
    379
  5. legar

    legar New Member

    Joined:
    Dec 31, 2021
    Messages:
    3
    Likes Received:
    0
    I'm curious how you guys add new functions. I don't really know much about low-level programming or modding in general. For example to change x/y/z position of the car, one of the addresses for the code is (I guess):

    Code:
    acs.exe+353954 - F3 0F11 81 C0000000   - movss [rcx+000000C0],xmm0
    Do you somehow write into the memory address of AC with C (is that even possible?), compile it to pyd and call it from python? Are the any examples for this that I can look into?

    EDIT: Normally you would do some reverse engineering to find the addresses, use pointers to access those from within C/C++, compile it into a DLL and inject it into the executable. Is this similar to what the CSP team did?

    Thanks
     
    Last edited: Jan 15, 2022
  6. fughettaboutit

    fughettaboutit aka leBluem

    Joined:
    Jul 21, 2014
    Messages:
    1,117
    Likes Received:
    379
    CSP hooks away some functions to point to its own, so basically yes.

    Those new python functions are integrated into CSP, no user-defined stuff possible. I cant say if only changing position in memory would work, but i would say just use this be happy:
    ac.ext_takeAStepBack(amount)

    It works with "new ai behaviour" on and a working AI line, Hotlap mode (or Practice too?), maybe its broken with latest csp versions, but should work with 0.1.75 and lower
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice