Results 1 to 8 of 8
  1. #1
    strangerdanger's Avatar
    Join Date
    Feb 2010
    Gender
    male
    Posts
    93
    Reputation
    10
    Thanks
    454
    My Mood
    Aggressive

    [Help] How to write Float C#

    Hey guys, I'm trying to write to a Float address using Jorndel's Class, but I keep getting an error "Argument 1: cannot convert 'long' to 'int' "

    Here is the code:

    Code:
    if (Process_Handle("*process*"))
                {
                    Write(0x14570F990, 80);
                }

    Any help will be much appreciated, thanks.
    My Rig: i7 3930K. Asus Rampage Formula x79. Corsair Vengeance 16GB 1600mhz. MSI GTX 480 and Asus GTX 480 .Asus VE278Q monitor(primary) BenQ G2220HD(secondary). Thermaltake toughpower XT 875W. Corsair Force GT 120GB (OS) Seagate barracuda 500GB (Programs) Western Digital Caviar Blue 1TB (Games) Western Digital Caviar Green 3TB (Storage) .

  2. #2
    Lovroman's Avatar
    Join Date
    Sep 2012
    Gender
    male
    Posts
    9,417
    Reputation
    611
    Thanks
    11,989
    My Mood
    Cheerful
    Code:
     private void Write(int Address, float Value)
            {
                byte[] Buffer = BitConverter.GetBytes(Value);
                IntPtr Zero = IntPtr.Zero;
                WriteProcessMemory(pHandel, (IntPtr)Address, Buffer, (UInt32)Buffer.Length, out Zero);
            }
    Code:
        public void WriteFloat(int Address, float Value)
            {
                Write(Address, Value);
            }

    Also, long != float, problem is address related, you have to change optimize memory class to work with 64 bit process..
    Last edited by Lovroman; 11-08-2013 at 06:19 AM.

  3. #3
    strangerdanger's Avatar
    Join Date
    Feb 2010
    Gender
    male
    Posts
    93
    Reputation
    10
    Thanks
    454
    My Mood
    Aggressive
    Quote Originally Posted by Lovroman View Post
    Code:
     private void Write(int Address, float Value)
            {
                byte[] Buffer = BitConverter.GetBytes(Value);
                IntPtr Zero = IntPtr.Zero;
                WriteProcessMemory(pHandel, (IntPtr)Address, Buffer, (UInt32)Buffer.Length, out Zero);
            }
    Code:
        public void WriteFloat(int Address, float Value)
            {
                Write(Address, Value);
            }

    Also, long != float, problem is address related, you have to change optimize memory class to work with 64 bit process..

    Thanks for replying. How would I be able to do that?
    My Rig: i7 3930K. Asus Rampage Formula x79. Corsair Vengeance 16GB 1600mhz. MSI GTX 480 and Asus GTX 480 .Asus VE278Q monitor(primary) BenQ G2220HD(secondary). Thermaltake toughpower XT 875W. Corsair Force GT 120GB (OS) Seagate barracuda 500GB (Programs) Western Digital Caviar Blue 1TB (Games) Western Digital Caviar Green 3TB (Storage) .

  4. #4
    Lovroman's Avatar
    Join Date
    Sep 2012
    Gender
    male
    Posts
    9,417
    Reputation
    611
    Thanks
    11,989
    My Mood
    Cheerful
    Quote Originally Posted by strangerdanger View Post
    Thanks for replying. How would I be able to do that?
    Change every int to long and change project settings to x64(change it where it says x86)..
    A.K.A. Every Int32/UInt32 to Int64/UInt64

  5. #5
    strangerdanger's Avatar
    Join Date
    Feb 2010
    Gender
    male
    Posts
    93
    Reputation
    10
    Thanks
    454
    My Mood
    Aggressive
    Quote Originally Posted by Lovroman View Post


    Change every int to long and change project settings to x64(change it where it says x86)..
    A.K.A. Every Int32/UInt32 to Int64/UInt64
    Thanks heaps man, that worked (sorta) I can compile the program fine but instead of writing 80 to the address it writes 1.121038771E-43
    Last edited by strangerdanger; 11-08-2013 at 09:44 AM.
    My Rig: i7 3930K. Asus Rampage Formula x79. Corsair Vengeance 16GB 1600mhz. MSI GTX 480 and Asus GTX 480 .Asus VE278Q monitor(primary) BenQ G2220HD(secondary). Thermaltake toughpower XT 875W. Corsair Force GT 120GB (OS) Seagate barracuda 500GB (Programs) Western Digital Caviar Blue 1TB (Games) Western Digital Caviar Green 3TB (Storage) .

  6. #6
    strangerdanger's Avatar
    Join Date
    Feb 2010
    Gender
    male
    Posts
    93
    Reputation
    10
    Thanks
    454
    My Mood
    Aggressive
    bump

    /10char
    My Rig: i7 3930K. Asus Rampage Formula x79. Corsair Vengeance 16GB 1600mhz. MSI GTX 480 and Asus GTX 480 .Asus VE278Q monitor(primary) BenQ G2220HD(secondary). Thermaltake toughpower XT 875W. Corsair Force GT 120GB (OS) Seagate barracuda 500GB (Programs) Western Digital Caviar Blue 1TB (Games) Western Digital Caviar Green 3TB (Storage) .

  7. #7
    n4n033's Avatar
    Join Date
    Jan 2010
    Gender
    male
    Location
    Windows
    Posts
    1,090
    Reputation
    43
    Thanks
    2,425
    My Mood
    Cool
    Quote Originally Posted by Lovroman View Post
    Code:
     private void Write(int Address, float Value)
            {
                byte[] Buffer = BitConverter.GetBytes(Value);
                IntPtr Zero = IntPtr.Zero;
                WriteProcessMemory(pHandel, (IntPtr)Address, Buffer, (UInt32)Buffer.Length, out Zero);
            }
    Code:
        public void WriteFloat(int Address, float Value)
            {
                Write(Address, Value);
            }

    Also, long != float, problem is address related, you have to change optimize memory class to work with 64 bit process..
    if you tell him to change to x64 don't give him source with x32 value :P

    try change the UInt32 to UInt64


    The Only Bests :


    R3d_L!n3(Fares)
    Aeroman (Brent)
    TheCamels8 (Ori)


  8. #8
    hkKenshin's Avatar
    Join Date
    Oct 2013
    Gender
    male
    Posts
    301
    Reputation
    28
    Thanks
    340
    OR....
    You could've done this:
    Code:
    if (Process_Handle("*process*"))
                {
                    Write(0x14570F990, 80.f);
                }

Similar Threads

  1. [Solved] help help how do i write ] and [ keywords
    By remon97 in forum CrossFire Help
    Replies: 9
    Last Post: 09-10-2012, 02:03 PM
  2. [Help Request] Help! How to fix changemap_to_current_random_sector
    By tyrexsolo in forum Vindictus Help
    Replies: 5
    Last Post: 04-02-2012, 08:38 AM
  3. [Help Request] Help! How to break Ahn Hack shield program?
    By leekang in forum Vindictus Help
    Replies: 1
    Last Post: 06-02-2011, 10:38 AM
  4. [help] How to write to INI file on FTP ?
    By wezljkz in forum Visual Basic Programming
    Replies: 7
    Last Post: 04-09-2011, 12:01 PM
  5. [Help] How to write value NOP
    By jaqq3000 in forum Visual Basic Programming
    Replies: 9
    Last Post: 12-02-2007, 11:46 AM