Results 1 to 8 of 8
  1. #1
    ♪~ ᕕ(ᐛ)ᕗ's Avatar
    Join Date
    Jun 2010
    Gender
    male
    Location
    Uterus
    Posts
    9,119
    Reputation
    1096
    Thanks
    1,970
    My Mood
    Doh

    [Help]WriteFloat

    is there a method to write a float value to a address...I'm talking about Mw2..I want to edit the 'jump_height' value which is a float value by the way.The address is correct cause with TSearch it worked.
    So i have:
    Code:
    BYTE Jump[1] = {(float)1000};
    BYTE Bg[1] = {(float)9999};
    
    VirWrite(jmp, Jump, sizeof(Jump));
    VirWrite(bgfall, Bg, sizeof(Bg));
    With 4Byte addresses, it worked fine.
    The default value is 39.But after edited it's 39.000009 (or something like this)
    So please help me I' want to learn
    Last edited by ♪~ ᕕ(ᐛ)ᕗ; 03-10-2011 at 07:01 AM.

  2. #2
    Hell_Demon's Avatar
    Join Date
    Mar 2008
    Gender
    male
    Location
    I love causing havoc
    Posts
    3,976
    Reputation
    343
    Thanks
    4,320
    My Mood
    Cheeky
    thats because floats are not 100% precise.
    Last edited by Hell_Demon; 03-10-2011 at 07:22 AM.
    Ah we-a blaze the fyah, make it bun dem!

  3. #3
    ♪~ ᕕ(ᐛ)ᕗ's Avatar
    Join Date
    Jun 2010
    Gender
    male
    Location
    Uterus
    Posts
    9,119
    Reputation
    1096
    Thanks
    1,970
    My Mood
    Doh
    Quote Originally Posted by Hell_Demon View Post
    thats because floats are not 100% precise.
    so what can I do to write the precise value?

  4. #4
    Hell_Demon's Avatar
    Join Date
    Mar 2008
    Gender
    male
    Location
    I love causing havoc
    Posts
    3,976
    Reputation
    343
    Thanks
    4,320
    My Mood
    Cheeky
    Quote Originally Posted by 3Li0 View Post


    so what can I do to write the precise value?
    Nothing =)
    and the .000009 difference won't matter
    Ah we-a blaze the fyah, make it bun dem!

  5. #5
    ♪~ ᕕ(ᐛ)ᕗ's Avatar
    Join Date
    Jun 2010
    Gender
    male
    Location
    Uterus
    Posts
    9,119
    Reputation
    1096
    Thanks
    1,970
    My Mood
    Doh
    Quote Originally Posted by Hell_Demon View Post
    Nothing =)
    and the .000009 difference won't matter
    well so I'm fucked up at this
    Also I know that it doesn't matter, but I wanted to show you the difference between the old and the new value

    OMG? So what method should I follow to write the float?

  6. #6
    Hell_Demon's Avatar
    Join Date
    Mar 2008
    Gender
    male
    Location
    I love causing havoc
    Posts
    3,976
    Reputation
    343
    Thanks
    4,320
    My Mood
    Cheeky
    A float is still 4 bytes long, so do something along the lines of

    Code:
    float newValue = 39.0f;
    WriteProcessMemory(....&newValue, 4);
    Ah we-a blaze the fyah, make it bun dem!

  7. The Following User Says Thank You to Hell_Demon For This Useful Post:

    ♪~ ᕕ(ᐛ)ᕗ (03-10-2011)

  8. #7
    ♪~ ᕕ(ᐛ)ᕗ's Avatar
    Join Date
    Jun 2010
    Gender
    male
    Location
    Uterus
    Posts
    9,119
    Reputation
    1096
    Thanks
    1,970
    My Mood
    Doh
    Quote Originally Posted by Hell_Demon View Post
    A float is still 4 bytes long, so do something along the lines of

    Code:
    float newValue = 39.0f;
    WriteProcessMemory(....&newValue, 4);
    well, I'm gonna try it, gonna report back for any result...

    Edit:
    WAAAAAAW! FFS! You're amazing!!!!
    Thx 1K Times dudeeeee!
    Last edited by ♪~ ᕕ(ᐛ)ᕗ; 03-10-2011 at 12:33 PM.

  9. #8
    Hell_Demon's Avatar
    Join Date
    Mar 2008
    Gender
    male
    Location
    I love causing havoc
    Posts
    3,976
    Reputation
    343
    Thanks
    4,320
    My Mood
    Cheeky
    No problem
    Ah we-a blaze the fyah, make it bun dem!

  10. The Following User Says Thank You to Hell_Demon For This Useful Post:

    ♪~ ᕕ(ᐛ)ᕗ (03-11-2011)