Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Created by h4344, more of to test and practice my coding skills more than trying to make a popular program
- #include <iostream>
- #include <fstream>
- #include <string>
- #include <cstdlib>
- #include <windows.h>
- #include <sstream>
- using namespace std;
- string sign(string bank,string aan,string pan){
- string Bank = bank; //set this to the string that contains the whole bank before signing.
- string AuthorAccountNumber = aan; //set this to the author's account number.
- string UserAccountNumber = pan; //you know what to do...
- string BankName = "UA3"; //the name of the bank. If the filename was "CheeZecake.SC2Bank", this would be "CheeZecake".
- string AfterSign = ""; //hmmm... I wonder what this is...
- typedef void (*SignFunc)(const char*, const char*, const char*, const char*, char*, int); //tells the compiler the exact type of function pointer we want later
- SignFunc Sign = NULL;
- HINSTANCE hBankSign = LoadLibrary("BankSign.dll"); //assuming it's in the same folder
- if (hBankSign != NULL) //we don't want to assume it loaded when it might not have
- {
- Sign = (SignFunc)GetProcAddress(hBankSign, "Sign");
- if (Sign != NULL) //make sure we actually got the function
- {
- char* buffer = new char[Bank.length() + 100]; //making sure it's big enough. If the bank already has a signature, the length probably won't change, but if not, it could gain 60+ characters.
- Sign(AuthorAccountNumber.c_str(), UserAccountNumber.c_str(), BankName.c_str(), Bank.c_str(), buffer, (int)Bank.length() + 100); //better hope Bank.length() + 100 isn't over 2147483647!
- AfterSign = buffer;
- delete[] buffer; //no memory leaks allowed!
- }
- else
- {
- cout << "Failed to find the function for signing the bank!";
- }
- //FreeLibrary(BankSign);
- }
- else
- {
- std::cout << "BankSign.dll Failed To Load!" << std::endl;
- }
- if (AfterSign != "") //make sure it's not just an empty string
- {
- return(AfterSign);
- }
- }
- int main(){
- //All my variables
- int option;
- int ee = 0;
- int we = 0;
- int oe = 0;
- int games = 0;
- int gametime = 0;
- int camocheck = 0;
- int decalcheck = 0;
- int abilcheck = 0;
- int revives = 0;
- bool decal = false;
- bool camo = false;
- bool abil = false;
- string camobool = ("Locked");
- string decalbool = ("Locked");
- string abilbool = ("Locked");
- string aan =("1-S2-1-1086513");
- string pan =("guy.000@1");
- string bankstring;
- //While loop to keep the numbers from setting to 0 everytime the user comes back from choosing an option
- while(1){
- system("CLS");
- ofstream FFile;
- stringstream File (stringstream::in | stringstream::out);
- if(decal == false){
- decalbool = ("Locked");
- decalcheck = 0;
- }else if(decal != false){
- decalbool = ("Unlocked");
- decalcheck = 1;
- }
- if(camo == false){
- camobool = ("Locked");
- camocheck = 0;
- }else if(camo != false){
- camobool = ("Unlocked");
- camocheck = 1;
- }
- if(abil == false){
- abilbool = ("Locked");
- abilcheck = 0;
- }else if(abil != false){
- abilbool = ("Unlocked");
- abilcheck = 1;
- }
- cout << "---------------------------------------------------------" << endl;
- cout << "Undead Assault 3 Bank Generator V0.6, Created by h4344" << endl;
- cout << "---------------------------------------------------------" << endl;
- cout << "99:Player Account #: " << pan << " ***Folder right under Starcraft 2" << endl << endl;
- cout << "98:Author's Account #: " << aan << " ***Should be this by default" << endl;
- cout << "---------------------------------------------------------" << endl;
- cout << " ---Stat--- ---Value---" << endl;
- cout << "1:Enlisted Experience " << ee << endl << endl;
- cout << "2:Warrant Officer Experience " << we << endl << endl;
- cout << "3:Officer Experience " << oe << endl << endl;
- cout << "4:Games Played " << games << endl << endl;
- cout << "5:Average Game Time " << gametime << endl << endl;
- cout << "6:Revives " << revives << endl << endl;
- cout << "7:All Decals " << decalbool << endl << endl;
- cout << "8:All Camo " << camobool << endl << endl;
- cout << "9:All Abilites " << abilbool << endl << endl;
- cout << "---------------------------------------------------------" << endl;
- cout << "0:Done, Generate My Bank File" << endl;
- cout << "---------------------------------------------------------" << endl;
- cin >> option;
- //Switch for all the options
- switch (option) {
- case 1:
- system("CLS");
- cout << "Enter desired value for Enlisted Experience" << endl;
- cout << "***Note This value is currently broken and cannot go above 189999 (Max Rank) or else your game will break at the start" << endl << endl;
- cout << "PVT- 0" << endl;
- cout << "PV2- 400" << endl;
- cout << "PFC- 1000" << endl;
- cout << "SPC- 1550" << endl;
- cout << "CPL- 2600" << endl;
- cout << "SGT- 3800" << endl;
- cout << "SSG- 5500" << endl;
- cout << "SFC- 11000" << endl;
- cout << "MSG- 17000" << endl;
- cout << "1SG- 25000" << endl;
- cout << "SGM- 65000" << endl;
- cout << "CSM- 95000" << endl;
- cout << "SMA- 190000" << endl << endl;
- cin >> ee;
- break;
- case 2:
- system("CLS");
- cout << "Enter desired value for Warrant Officer Experience" << endl;
- cout << "***Note This value is currently broken and cannot go above 119999 (Max Rank) or else your game will break at the start" << endl << endl;
- cout << "WO1- 0" << endl;
- cout << "WO2- 8000" << endl;
- cout << "WO3- 25000" << endl;
- cout << "WO4- 65000" << endl;
- cout << "WO5- 120000" << endl << endl;
- cin >> we;
- break;
- case 3:
- system("CLS");
- cout << "Enter desired value for Officer Experience" << endl;
- cout << "***Note This value is currently broken and cannot go above 249999 (Max Rank) or else your game will break at the start" << endl << endl;
- cout << "2LT- 0" << endl;
- cout << "1LT- 3500" << endl;
- cout << "CPT- 12000" << endl;
- cout << "MAJ- 18000" << endl;
- cout << "LTCOL- 30000" << endl;
- cout << "COL- 65000" << endl;
- cout << "BGEN- 100000" << endl;
- cout << "MGEN- 130000" << endl;
- cout << "LTGEN- 180000" << endl;
- cout << "GEN- 250000" << endl << endl;
- cin >> oe;
- break;
- case 4:
- system("CLS");
- cout << "Enter desired value for Games Played" << endl;
- cin >> games;
- break;
- case 5:
- system("CLS");
- cout << "Enter desired value for Average Game Time" << endl;
- cin >> gametime;
- break;
- case 6:
- system("CLS");
- cout << "Enter desired value for Revives" << endl;
- cin >> revives;
- break;
- case 7:
- system("CLS");
- if(decal != true){
- decal = true;
- }else if(decal != false){
- decal = false;
- }
- break;
- case 8:
- if(camo != true){
- camo = true;
- }else if(camo != false){
- camo = false;
- }
- break;
- case 9:
- if(abil != true){
- abil = true;
- }else if(abil != false){
- abil = false;
- }
- break;
- case 0:
- File << "<?xml version=\"1.0\" encoding=\"utf-8\"?>" << endl;
- File << "<Bank version=\"1\">" << endl;
- File << " <Section name=\"officer\">" << endl;
- File << " <Key name=\"experience\">" << endl;
- File << " <Value int=\"" << oe <<"\"/>" << endl;
- File << " </Key>" << endl;
- File << " </Section>" << endl;
- File << " <Section name=\"SIs\">" << endl;
- File << " <Key name=\"INT\">" << endl;
- File << " <Value flag=\"" << abilcheck <<"\"/>" << endl;
- File << " </Key>" << endl;
- File << " <Key name=\"HE\">" << endl;
- File << " <Value flag=\"" << abilcheck <<"\"/>" << endl;
- File << " </Key>" << endl;
- File << " <Key name=\"TT\">" << endl;
- File << " <Value flag=\"" << abilcheck <<"\"/>" << endl;
- File << " </Key>" << endl;
- File << " <Key name=\"RF\">" << endl;
- File << " <Value flag=\"" << abilcheck <<"\"/>" << endl;
- File << " </Key>" << endl;
- File << " <Key name=\"INST\">" << endl;
- File << " <Value flag=\"" << abilcheck <<"\"/>" << endl;
- File << " </Key>" << endl;
- File << " <Key name=\"BARB\">" << endl;
- File << " <Value flag=\"" << abilcheck <<"\"/>" << endl;
- File << " </Key>" << endl;
- File << " <Key name=\"DS\">" << endl;
- File << " <Value flag=\"" << abilcheck <<"\"/>" << endl;
- File << " </Key>" << endl;
- File << " <Key name=\"QT\">" << endl;
- File << " <Value flag=\"" << abilcheck <<"\"/>" << endl;
- File << " </Key>" << endl;
- File << " <Key name=\"TAN\">" << endl;
- File << " <Value flag=\"" << abilcheck <<"\"/>" << endl;
- File << " </Key>" << endl;
- File << " <Key name=\"EN\">" << endl;
- File << " <Value flag=\"" << abilcheck <<"\"/>" << endl;
- File << " </Key>" << endl;
- File << " <Key name=\"AR\">" << endl;
- File << " <Value flag=\"" << abilcheck <<"\"/>" << endl;
- File << " </Key>" << endl;
- File << " <Key name=\"BL\">" << endl;
- File << " <Value flag=\"" << abilcheck <<"\"/>" << endl;
- File << " </Key>" << endl;
- File << " </Section>" << endl;
- File << " <Section name=\"camo\">" << endl;
- File << " <Key name=\"ACUPAT\">" << endl;
- File << " <Value flag=\"" << camocheck <<"\"/>" << endl;
- File << " </Key>" << endl;
- File << " <Key name=\"SAS\">" << endl;
- File << " <Value flag=\"" << camocheck <<"\"/>" << endl;
- File << " </Key>" << endl;
- File << " <Key name=\"Olive\">" << endl;
- File << " <Value flag=\"" << camocheck <<"\"/>" << endl;
- File << " </Key>" << endl;
- File << " <Key name=\"Night\">" << endl;
- File << " <Value flag=\"" << camocheck <<"\"/>" << endl;
- File << " </Key>" << endl;
- File << " <Key name=\"Woodland Tiger\">" << endl;
- File << " <Value flag=\"" << camocheck <<"\"/>" << endl;
- File << " </Key>" << endl;
- File << " <Key name=\"Red Tiger\">" << endl;
- File << " <Value flag=\"" << camocheck <<"\"/>" << endl;
- File << " </Key>" << endl;
- File << " <Key name=\"Woodland\">" << endl;
- File << " <Value flag=\"" << camocheck <<"\"/>" << endl;
- File << " </Key>" << endl;
- File << " <Key name=\"MARPAT\">" << endl;
- File << " <Value flag=\"" << camocheck <<"\"/>" << endl;
- File << " </Key>" << endl;
- File << " <Key name=\"CADPAT\">" << endl;
- File << " <Value flag=\"" << camocheck <<"\"/>" << endl;
- File << " </Key>" << endl;
- File << " </Section>" << endl;
- File << " <Section name=\"general\">" << endl;
- File << " <Key name=\"avg game time\">" << endl;
- File << " <Value int=\"" << gametime <<"\"/>" << endl;
- File << " </Key>" << endl;
- File << " <Key name=\"games played\">" << endl;
- File << " <Value int=\"" << games <<"\"/>" << endl;
- File << " </Key>" << endl;
- File << " <Key name=\"revives\">" << endl;
- File << " <Value int=\"" << revives <<"\"/>" << endl;
- File << " </Key>" << endl;
- File << " </Section>" << endl;
- File << " <Section name=\"enlisted\">" << endl;
- File << " <Key name=\"experience\">" << endl;
- File << " <Value int=\"" << ee <<"\"/>" << endl;
- File << " </Key>" << endl;
- File << " </Section>" << endl;
- File << " <Section name=\"decals\">" << endl;
- File << " <Key name=\"RA\">" << endl;
- File << " <Value flag=\"" << decalcheck <<"\"/>" << endl;
- File << " </Key>" << endl;
- File << " <Key name=\"Outlaw\">" << endl;
- File << " <Value flag=\"" << decalcheck <<"\"/>" << endl;
- File << " </Key>" << endl;
- File << " <Key name=\"Combat Medic Badge\">" << endl;
- File << " <Value flag=\"" << decalcheck <<"\"/>" << endl;
- File << " </Key>" << endl;
- File << " <Key name=\"Bear Claw\">" << endl;
- File << " <Value flag=\"" << decalcheck <<"\"/>" << endl;
- File << " </Key>" << endl;
- File << " <Key name=\"Blue Diamond\">" << endl;
- File << " <Value flag=\"" << decalcheck <<"\"/>" << endl;
- File << " </Key>" << endl;
- File << " <Key name=\"Cavalry Sabers\">" << endl;
- File << " <Value flag=\"" << decalcheck <<"\"/>" << endl;
- File << " </Key>" << endl;
- File << " <Key name=\"Ravensword\">" << endl;
- File << " <Value flag=\"" << decalcheck <<"\"/>" << endl;
- File << " </Key>" << endl;
- File << " </Section>" << endl;
- File << " <Section name=\"warrant officer\">" << endl;
- File << " <Key name=\"experience\">" << endl;
- File << " <Value int=\"" << we <<"\"/>" << endl;
- File << " </Key>" << endl;
- File << " </Section>" << endl;
- File << " <Signature value=\"60BADBB1BAA7F3C1209C7AB3F71DDA4822095B2A\"/>" << endl;
- File << "</Bank>" << endl;
- //Variable to store the entire bank and send it through the signer
- bankstring = sign(File.str(),aan,pan);
- FFile.open("UA3.SC2Bank");
- FFile << bankstring;
- FFile.close();
- system("CLS");
- cout << "***Bank File Generated, you should backup your old Bank File before switching" << endl;
- cout << "***Dont forget to sign the bank file with Mr.Nukes bank signer before using it" << endl;
- system("PAUSE");
- exit(1);
- break;
- case 99:
- system("CLS");
- cout << "Enter your player account number under Documents>Starcraft 2" << endl;
- cin >> pan;
- break;
- case 98:
- system("CLS");
- cout << "Enter the authors account number ***This value should be what it was by default" << endl;
- cin >> aan;
- break;
- default:
- system("CLS");
- cout << "You have entered an invalid option, please try again" << endl;
- system("PAUSE");
- break;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment