Page 1 of 2 12 LastLast
Results 1 to 15 of 18
  1. #1
    _corn_'s Avatar
    Join Date
    Jun 2010
    Gender
    male
    Location
    0x0C482BF2
    Posts
    673
    Reputation
    13
    Thanks
    294
    My Mood
    Brooding

    How to make a loader where you select the hacks you want

    Hello everyone,

    I have received numerous PMs asking how I made my loader, in which you can choose the hack options. I thought it would be easier to make a tutorial than reply to everyones PMs.

    This is what my loader looks like: (click the picture to go to the hack download thread)


    So, the idea is for the loader to create a file in the Cross Fire folder which has all the options in it. Then, the hack reads this file, and enables/disables the corresponding hacks.

    In my loader, it created a file that looked like this:
    Code:
    This file is automatically generated by AlphaHack configurator. Do not edit!
    1
    0
    0
    1
    1
    0
    1
    0
    1
    0
    1
    1
    1
    -1
    1 is for ON and 0 is for OFF.
    The hack reads that file, line by line, and sets the hack up. The hack and the loader both know that line 0 is for No Change Delay, and line 1 is for No Reload etc etc etc.

    Very simple... very very simple indeed.

    If you don't know how to read and write to files in C++, keep reading, or if you do go and try to do it. (or you could do it in VB.NET)

    First, we need to include two headers to read and write to files:
    Code:
    #include <windows.h>
    #include <fstream>
    #include <iostream>
    Then, to write the options file, first we have to make a new ofstream (output file stream), and create a file with open()
    Code:
    ofstream file;
    file.open("FileName");
    Then, before we try to write data to the stream, we need to check if the file was successfully created, then we write data to the stream using the << operator.
    Code:
    if(file.good())
    {
        file << "Data To Write To File";
    }
    Then we need to close the file stream:
    Code:
    file.close();
    I will leave it to you to make it loop around and write the correct amount of lines with the correct values... should be very easy.

    Now that we know how to create the file, we need to make the hack read from it.

    First we include the headers
    Code:
    #include <windows.h>
    #include <fstream>
    #include <iostream>
    Then we need to create an ifstream (input file stream) and open the file:
    Code:
    ifstream file;
    file.open("FileName");
    Before we try to read data from it we need to check if it has successfully opened the file:
    Code:
    if(file.good())
    {
    Then we need to read a line with getline, and covert it to an integer with atoi()
    Code:
    int option = -1;
    string line;
    std::getline(file, line);
    option = atoi(line.c_str());
    Now we need to loop while the line is either 0 or 1 (at the end of file it is -1, so it will stop there), set the correct bool to the correct value, get the next line, and increment the counter by 1:
    note: the counter is the line number
    Code:
     while((option == 1) || (option == 0))
                {
                    if(option == 0)
                    {
                        switch(counter)
                        {
                        case 0:
                            nochange = false;
                            break;
                        case 1:
                            noreload = false;
                            break;
                        case 2:
                            seeghosts = false;
                            break;
                        case 3:
                            weaponhack = false;
                            break;
                        case 4:
                            noweaponweight = false;
                            break;
                        case 5:
                            nonadedamage = false;
                            break;
                        case 6:
                            nofalldamage = false;
                            break;
                        }
                    }
                    std::getline(file, line);
                    option = atoi(line.c_str());
                    counter++;
                }
    NOTE: You may want to add some try catches in case of an error...
    Code:
    try
    {
    //CODE
    //error happens
    throw 1;
    }
    catch(int e)
    {
        string errornumber = "";
        string str = "Error ";
        itoa(e, errornumber, 10);
        str.append(errornumber);
        MessageBoxA(NULL, str, "Hack", MB_OK | MB_ICONERROR);
    }
    NOTE: In my hack, i set all the bool values to true, and only change them if the corresponding value in file is 0 (simpler)

    Full Code for writing to file:
    Code:
    #include <windows.h>
    #include <fstream>
    #include <iostream>
    
    ofstream file;
    file.open("FileName");
    
    if(file.good())
    {
        if(noreload)
        file << "1\n";
        else
        file << "0\n";
    }
    file.close()
    Full Code for reading file:
    Code:
    #include <windows.h>
    #include <fstream>
    #include <iostream>
    
    ifstream file;
    file.open("FileName");
    
    if(file.good())
    {
    int option = -1;
    string line;
    std::getline(file, line);
    option = atoi(line.c_str());
    
    while((option == 1) || (option == 0))
                {
                    if(option == 0)
                    {
                        switch(counter)
                        {
                        case 0:
                            nochange = false;
                            break;
                        case 1:
                            noreload = false;
                            break;
                        case 2:
                            seeghosts = false;
                            break;
                        case 3:
                            weaponhack = false;
                            break;
                        case 4:
                            noweaponweight = false;
                            break;
                        case 5:
                            nonadedamage = false;
                            break;
                        case 6:
                            nofalldamage = false;
                            break;
                        }
                    }
                    std::getline(file, line);
                    option = atoi(line.c_str());
                    counter++;
                }
    }
    So, that's it!
    Please thanks me/give credits if you use this.

    Btw, I nearly lost all this, LUCKY IT HAS AUTO-SAVE

    If you are having trouble with this, use common sense lol.
    Last edited by _corn_; 01-13-2012 at 02:35 PM.

  2. The Following 4 Users Say Thank You to _corn_ For This Useful Post:

    cttbot89 (02-16-2012),Dragon(H)ell (01-18-2012),giniyat101 (01-13-2012),poru (01-20-2012)

  3. #2
    goold1's Avatar
    Join Date
    Oct 2009
    Gender
    male
    Posts
    152
    Reputation
    10
    Thanks
    76
    My Mood
    Busy
    error C3861: 'getline': identifier not found

    getline(file, line);
    InComing V6 GoldHack

  4. #3
    _corn_'s Avatar
    Join Date
    Jun 2010
    Gender
    male
    Location
    0x0C482BF2
    Posts
    673
    Reputation
    13
    Thanks
    294
    My Mood
    Brooding
    Oh sorry, you need to do std::getline or put using namespace std; at the top... ill edit it

    thanks for pointing that out


    ---------- Post added at 09:29 PM ---------- Previous post was at 09:25 PM ----------

    And you may need to include <windows.h>

  5. #4
    uarethebest's Avatar
    Join Date
    Nov 2011
    Gender
    male
    Posts
    45
    Reputation
    10
    Thanks
    0
    My Mood
    Daring
    sry for noob quest @_corn_ but when u make windows forms application...u put the code in
    AssemblyInfo.cpp or name.cpp or resource .h?
    i never made a loader

  6. #5
    goold1's Avatar
    Join Date
    Oct 2009
    Gender
    male
    Posts
    152
    Reputation
    10
    Thanks
    76
    My Mood
    Busy
    error C2039: 'getline' : is not a member of 'std'

    ---------- Post added at 05:01 AM ---------- Previous post was at 03:58 AM ----------

    i finish make the loader(Writer) with C#
    but the problem in reading with c++
    InComing V6 GoldHack

  7. #6
    Janitor's Avatar
    Join Date
    Aug 2011
    Gender
    male
    Location
    MPGH Reports
    Posts
    16,255
    Reputation
    3259
    Thanks
    7,214
    Nice +TuT+
    Its not for viusal basic ?

  8. #7
    Assassin's Creed's Avatar
    Join Date
    Dec 2011
    Gender
    male
    Posts
    1,210
    Reputation
    54
    Thanks
    1,408
    My Mood
    Worried
    Quote Originally Posted by MatrixXx View Post
    Nice +TuT+
    Its not for viusal basic ?
    it's C++.....
     

    Contributer Since 20/2/2012
    MPGH Member Since December 2011

     





     

    offical thread> Assassin V15<

    To all People who thinks am a leecher,hate me,are jelly from me....
    Refer to this thread...
    https://www.mpgh.net/forum/232-crossf...stop-hate.html

  9. #8
    DevilGhost's Avatar
    Join Date
    Nov 2011
    Gender
    male
    Posts
    66
    Reputation
    10
    Thanks
    0
    My Mood
    Dead
    ya u need to put full code and explain it.....if u are afraid of leeching...then put a leech protect like delete some letters or smthing...

  10. #9
    goold1's Avatar
    Join Date
    Oct 2009
    Gender
    male
    Posts
    152
    Reputation
    10
    Thanks
    76
    My Mood
    Busy
    Yes Add Full Code

    now i build without any error BUt not working
    it still false + not working any hack

    edit : the problem from last line i forget add -1
    Last edited by goold1; 01-13-2012 at 11:13 AM.
    InComing V6 GoldHack

  11. #10
    Swag's Avatar
    Join Date
    Jul 2011
    Gender
    male
    Location
    Netherlands
    Posts
    1,619
    Reputation
    19
    Thanks
    1,865
    My Mood
    Amused
    Nice tutorial

  12. #11
    mustafafm's Avatar
    Join Date
    Jun 2011
    Gender
    male
    Posts
    108
    Reputation
    10
    Thanks
    7
    My Mood
    Inspired
    thanked ^^

  13. #12
    _corn_'s Avatar
    Join Date
    Jun 2010
    Gender
    male
    Location
    0x0C482BF2
    Posts
    673
    Reputation
    13
    Thanks
    294
    My Mood
    Brooding
    Quote Originally Posted by uarethebest View Post
    sry for noob quest @_corn_ but when u make windows forms application...u put the code in
    AssemblyInfo.cpp or name.cpp or resource .h?
    i never made a loader
    Idk, I used Code::Blocks with wxWidgets.... ask someone else

  14. #13
    _corn_'s Avatar
    Join Date
    Jun 2010
    Gender
    male
    Location
    0x0C482BF2
    Posts
    673
    Reputation
    13
    Thanks
    294
    My Mood
    Brooding
    Quote Originally Posted by Swag View Post
    Nice tutorial
    hi michielr

  15. #14
    Swag's Avatar
    Join Date
    Jul 2011
    Gender
    male
    Location
    Netherlands
    Posts
    1,619
    Reputation
    19
    Thanks
    1,865
    My Mood
    Amused
    Quote Originally Posted by _corn_ View Post


    hi michielr
    Its Swag now haha

  16. #15
    _corn_'s Avatar
    Join Date
    Jun 2010
    Gender
    male
    Location
    0x0C482BF2
    Posts
    673
    Reputation
    13
    Thanks
    294
    My Mood
    Brooding
    Quote Originally Posted by Swag View Post
    Its Swag now haha
    hi Swag

Page 1 of 2 12 LastLast

Similar Threads

  1. [Request] How to make a Loader? [solved]
    By CrossRaiders in forum Visual Basic Programming
    Replies: 15
    Last Post: 12-03-2011, 08:27 PM
  2. How to make a Loader in VB.NET
    By Killer12agh in forum Combat Arms Coding Help & Discussion
    Replies: 7
    Last Post: 08-08-2011, 03:27 PM
  3. How do you install the hacks
    By Drag0nkillz in forum General Hacking
    Replies: 20
    Last Post: 04-21-2009, 11:42 AM
  4. Dave how did you find the hacks in the pub?
    By ploxide in forum Combat Arms Hacks & Cheats
    Replies: 1
    Last Post: 12-21-2008, 03:36 PM
  5. how to i make a bypass in vb6 with the hack?
    By Oneirish in forum Visual Basic Programming
    Replies: 13
    Last Post: 03-31-2008, 12:53 PM