• Amused
  • Angry
  • Annoyed
  • Awesome
  • Bemused
  • Cocky
  • Cool
  • Crazy
  • Crying
  • Down
  • Drunk
  • Embarrased
  • Enraged
  • Friendly
  • Geeky
  • Godly
  • Happy
  • Hateful
  • Hungry
  • Innocent
  • Meh
  • Piratey
  • Poorly
  • Sad
  • Secret
  • Shy
  • Sneaky
  • Tired
  • Wtf
  • At Work
  • CodenzHub
  • Coding
  • Deejaying
  • Donating
  • Drinking
  • Eating
  • Editing
  • Hacking
  • Hate Mailing
  • Jamin'
  • Lagging
  • Live Streaming
  • Lurking
  • No Status
  • Pawning
  • PC Gaming
  • PS Gaming
  • Raging
  • Reversing
  • Sleeping
  • Steam Gaming
  • Trolling
  • TwitchStreamer
  • Vodka!
  • Watching TV/Movie
  • Xbox Gaming
  • Youtuber
  • Zombies
  • Results 1 to 5 of 5
    1. #1
      Coder
      Learning to hack games!
       
      Feeling Normal
       
      kaz's Avatar
      Join Date
      Apr 2013
      Posts
      166
      Thanks (-->)
      41
      Thanks (<--)
      48

      Best way to save and restore config files

      Silent VPN
      I'm trying to create a configuration file (mine in this case is simply config.txt) that can be saved based on your menu selections and when you relaunch the hack you can click Load config.txt.

      Best way to save and restore config files


      //THIS IS C++, std::boolalpha is to have the bools print as true instead of 1, if I remove std::boolalpha then save>load>save then the text file will print garbage numbers like 204 for bools
      void LoadConfig()
      {
      ifstream in("config.txt");
      in >>std::boolalpha>> espactive >> bunnyactive >> espspecial>> esphumans>> espinfected>> espsnapline >> espmehealth>> esp3D >> esphealth >> espzomhealth>> aimbotactive >> aimbothumans>> aimbotspecial>> aimbotsmooth >> aimbotbounce >> fovdist>>aimbotkey>>triggerkey>>aimFOV>>aimsens;
      in.close();
      }
      void SaveConfig()
      {
      ofstream out("config.txt");
      out <<std::boolalpha<< espactive << bunnyactive << espspecial<< esphumans<< espinfected<< espsnapline << espmehealth<< esp3D << esphealth << espzomhealth<< aimbotactive << aimbothumans<< aimbotspecial<< aimbotsmooth << aimbotbounce << fovdist<<aimbotkey<<triggerkey<<aimFOV<<aimsens;
      out.close();
      }
      }


      everything is booleans until it gets to aimbotkey, triggerkey,aimFOV, aimsens
      aimbotkey,triggerkey are integers
      aimfov,aimsens are float values.

      When I save configuration this is what I usually get saved into my .txt document

      truetruetruefalsefalsefalsefalsetruetruefalsetruef alsetruetruetruefalse12101.25
      aimbotkey = 1
      triggerkey = 2
      aimfov = 10 //uses slider bar
      aimsens = 1.25 //uses slider bar

      Loading the config.txt will set everything back the way it way until after aimbotkey, I think I'm reading the values incorrectly(fstream is new to me) because I'm not sure if using my technique as above is only reading one character or not because my float values can be from 1 char to 4 chars.

      It's not loading as soon as I get to the numbers in the config.txt


      Here's what it will look like, I'll save the hack, then click load afterwards before anything else and you can see the keybindings change which is incorrect
      Best way to save and restore config files|||Best way to save and restore config files

      Thanks so much for reading.

      if there is a better way to do this that you guys can help me with that would be appreciated as well.

    2. #2
      Respected Hacker
      Learning to hack games!
       
      Coding
       
      till0sch's Avatar
      Join Date
      Oct 2012
      Location
      Germany.
      Posts
      1,168
      Thanks (-->)
      179
      Thanks (<--)
      340
      Yeah maybe just save like "01 00 01 00 01 01 00 01 01" then load the file while every byte there stand for on or off (you might have done it like that but it's too much text to read and I'm too lazy for that)

    3. #3
      Kim Kong Trasher
      I don't have status.
       
      Raging
       
      c5's Avatar
      Join Date
      Jul 2012
      Location
      Mankei Iland
      Posts
      1,221
      Thanks (-->)
      97
      Thanks (<--)
      492
      Use .ini or .xml, .. eg. WriteProfileString/ReadProfileString or some simple xml parser. I got my menu separated into tabs, each tab will be a app name in ini and each menu element is a key. I iterate over all the menu items and based on type format the value accordingly.
      Best way to save and restore config files

    4. #4
      Hacker
      ^.^
       
      Eating
       
      NTvalk's Avatar
      Join Date
      Jul 2013
      Location
      Your RAM
      Posts
      512
      Thanks (-->)
      176
      Thanks (<--)
      146
      Yeah as c5 said you should try to parse it from some structured format

    5. #5
      Newbie
      Marijuana'in
       
      At Work
       
      MJZombieMan's Avatar
      Join Date
      Jul 2014
      Posts
      11
      Thanks (-->)
      13
      Thanks (<--)
      5
      Silent VPN
      Just make the format be separated by a new line '\n'. Simplest way there is. Read in a line, that's the first option's value. read in the second line, that's the second option's value, etc. Super simple. And depending on the line you could parse it differnetly - boolean, or integer.

    Similar Game Hacker Threads

    1. [Discuss] Hooking function to grab register in assembly and save it for use
      By Rekker in forum Hacking Help
      Replies: 5
      Last Post: 05-15-2016, 03:14 PM
    2. Replies: 18
      Last Post: 01-12-2016, 02:00 PM
    3. Rehashing Save Game (not xbox)
      By EricFerel in forum Hacking Help
      Replies: 7
      Last Post: 12-02-2012, 11:34 AM

    Tags for this Thread