1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Release [C++] Small Code Thread

Discussion in 'Call of Duty: Black Ops 2 Scripts' started by Pyrex BLJ, Dec 19, 2017.

More codes?

  1. yes

    96.0%
  2. no wtf r u doing

    4.0%
  1. Pyrex BLJ

    Pyrex BLJ Console Section Trial Moderator Staff Member

    469
    288
    378
    Credits:
    2,470
    Hey guys, I'm beginning to release some source functions from my menu
    because I'm feeling generous and i don't like
    keeping information from all you people

    I didn't find these anywhere else (although i didn't look that hard)
    and yes it is gross but idk c++ very well, ok?

    Code:
    char showcard[75] = "xshowgamercardbyclientnumingame ";
    void showgamercard(int client) {
        char buffer[2];
        sprintf(buffer, "%d", client);
        Cbuf_AddText(0, strcat(showcard, buffer));
        buffer[0] = *"";
        buffer[1] = *"";
        buffer[2] = *"";
        showcard[32] = *"";
        showcard[33] = *"";
        showcard[34] = *"";
    }
    Call it like
    Code:
    showgamercard(1);
    [​IMG]

    Code:
    Cbuf_AddText(0, "xstopallparties");
    [​IMG]

    Code:
    Cbuf_AddText(0, "quit");
    [​IMG]

    The First Requested Function:
    this will show errors in vs, but it will still work/build
    Code:
    void dankestMap(uint64_t nothing) {
        int delay = 1500;
        while(var.dankestMapkek) {
            Cbuf_AddText(0, "r_lightTweakSunColor 1 0 0;r_lightTweakSunDirection 100 180 0;r_specularColorScale 1;r_specularmap 1;r_glow \"1\";r_glow_allowed \"1\";r_glowtweakbloomintensity  1;r_glowtweakradius 1;r_glowTweakEnable 1;r_glowUseTweaks 1;r_skyColorTemp 7500;");
            sleep(delay);
            Cbuf_AddText(0, "r_lightTweakSunColor 0.5 1 0");
            sleep(delay);
            Cbuf_AddText(0, "r_lightTweakSunColor 0.5 0.5 0");
            sleep(delay);
            Cbuf_AddText(0, "r_lightTweakSunColor 0 1 0");
            sleep(delay);
            Cbuf_AddText(0, "r_lightTweakSunColor 0 0.5 1");
            sleep(delay);
            Cbuf_AddText(0, "r_lightTweakSunColor 0 0.5 0.5");
            sleep(delay);
            Cbuf_AddText(0, "r_lightTweakSunColor 0 0 1");
            sleep(delay);
            Cbuf_AddText(0, "r_lightTweakSunColor 1 0 0.5");
            sleep(delay);
            Cbuf_AddText(0, "r_lightTweakSunColor 0.5 0 0.5");
            sleep(delay);
        }
        sys_ppu_thread_exit(nothing);
    }
    sys_ppu_thread_t suncolor;
    void startDankestMap() {
        sys_ppu_thread_create(&suncolor, dankestMap, 0, 10, 0x0A, 0, "suncolor");
    }
    [​IMG]

    Code:
    void autocrouch(uint64_t nothing) {
            while (crouch) {
                *(char*)0xee4d30 = 1;
                sleep(1);
                *(char*)0xee4d30 = 0;
                sleep(1);
            }
        sys_ppu_thread_exit(nothing);
    }
    sys_ppu_thread_t startAutoshooting;
    void startAutocrouch() {
        sys_ppu_thread_create(&startAutoshooting, autocrouch, 0, 10, 0x0A, 0, "autotbag");
    }
    [​IMG]

    I just wrote this, may be a bit messy or glitchy but works for the most part
    You need a few things for this to work, ill include them here.
    Code:
    int getFileSize(char *file) {
        int fd;
        int ret;
        uint64_t pos;
        uint64_t nread;
        ret = cellFsOpen(file, 0, &fd, NULL, 0);
        if (!ret) {
            CellFsStat sb;
            ret = cellFsFstat(fd, &sb);
            if (!ret) {
                return sb.st_size;
            }
        }
        return -1;
    }
    void readFile(char *file, char buf[], int size) {
        int fd;
        int ret;
        uint64_t pos;
        uint64_t nread;
        ret = cellFsOpen(file, 0, &fd, NULL, 0);
        if (!ret)
        {
            cellFsLseek(fd, 0, CELL_FS_SEEK_SET, &pos);
            ret = cellFsRead(fd, buf, size, &nread);
            if (!ret)
            {
                cellFsClose(fd);
            }
        }
    }
    
    int ByteLength;
    unsigned int MALLOC = 0x100000;
    unsigned int loc = 0xCAD88480;
    void imginject(char *file) {
        ByteLength = getFileSize(file);
        if (ByteLength != -1) {
            readFile(file, (char*)loc, MALLOC);
        }
        else {
            printf("\nUnable to Inject Image, Make Sure You Have a File In The Perxy Folder & It Has The Correct Name\n");
        }
    }
    void injectimagepls(uint64_t nothing) {
        for (;;) {
                if (imgfirst == false) {
                    sleep(6000);
                    imginject("/dev_hdd0/tmp/Perxy/image.dds");
                    imgfirst = true;
                }
                if (imageinjected == false && DvarGetBool("cl_ingame") == false) {
                    imginject("/dev_hdd0/tmp/Perxy/image.dds");
                    imageinjected = true;
                }
            sleep(3000);
        }
        sys_ppu_thread_exit(nothing);
    }
    sys_ppu_thread_t startimageinject;
    void startimageinjectpls() {
        sys_ppu_thread_create(&startimageinject, injectimagepls, 0, 10, 0x0A, 0, "imageInjector");
    }
    Then Put this somewhere that constantly runs in game. (the image resets when you join a game)
    Code:
    if (DvarGetBool("cl_ingame")) {
            imageinjected = false;
        }
    Here is a tutorial i made on creating injectable images, although i made quite a few that ill release with the next perxy update
    Code:
    https://www.youtube.com/watch?v=AD0qhfgfwNM
    [​IMG]

    This one was submitted by @Harry (thx)
    Optimized by @DevOps
    Code:
    void muteplayer(u32 id) {
       char buffer[100];
       sprintf(buffer, "xmuteplayer %d", id);
       Cbuf_AddText(LOCAL_CLIENT_FIRST, buffer);
       sys_memory_free((sys_addr_t)buffer);
    }
    
    i dont have a pic/vid of this but u know what it does

    If you have any specific things you want from Perxy or one of my programs just ask and ill post them here :smile:

    Enjoy​
     
    Last edited: Feb 22, 2018
  2. Harry

    Harry I'm 'Serious'ly a better Developer

    1,105
    906
    398
    Credits:
    4,950
    Dayum. Nice :grinning:
     
    RosticGamer99 and Pyrex BLJ like this.
  3. Tusta

    Tusta Head Member Donator

    14
    14
    14
    Credits:
    3,155
    Nice :blush:
     
    Pyrex BLJ likes this.
  4. Pyrex BLJ

    Pyrex BLJ Console Section Trial Moderator Staff Member

    469
    288
    378
    Credits:
    2,470
    updated w/ another option
     
  5. Harry

    Harry I'm 'Serious'ly a better Developer

    1,105
    906
    398
    Credits:
    4,950
    Quit BO2 next ^.*
     
    Pyrex BLJ likes this.
  6. Harry

    Harry I'm 'Serious'ly a better Developer

    1,105
    906
    398
    Credits:
    4,950
    I'll drop my InGame Name Changer + Fix Talking here later today
     
    Pyrex BLJ likes this.
  7. Pyrex BLJ

    Pyrex BLJ Console Section Trial Moderator Staff Member

    469
    288
    378
    Credits:
    2,470
    ok, ill add it to the thread
     
    Harry likes this.
  8. Harry

    Harry I'm 'Serious'ly a better Developer

    1,105
    906
    398
    Credits:
    4,950
    I'll PM you when I get home xx
     
    Pyrex BLJ likes this.
  9. Pyrex BLJ

    Pyrex BLJ Console Section Trial Moderator Staff Member

    469
    288
    378
    Credits:
    2,470
    kk bby
     
  10. Pyrex BLJ

    Pyrex BLJ Console Section Trial Moderator Staff Member

    469
    288
    378
    Credits:
    2,470
    added dank map (kek) and auto crouch :smile:
     
  11. Ganjanikos

    Ganjanikos Greek Force Donator

    280
    152
    228
    Credits:
    1,437
    Waiting for more
     
  12. Pyrex BLJ

    Pyrex BLJ Console Section Trial Moderator Staff Member

    469
    288
    378
    Credits:
    2,470
    what u lookin for?
     
  13. Harry

    Harry I'm 'Serious'ly a better Developer

    1,105
    906
    398
    Credits:
    4,950
    Ill send you a better auto crouch
     
    Pyrex BLJ likes this.
  14. Pyrex BLJ

    Pyrex BLJ Console Section Trial Moderator Staff Member

    469
    288
    378
    Credits:
    2,470
    image injector ( ͡° ͜ʖ ͡°)
     
  15. Ganjanikos

    Ganjanikos Greek Force Donator

    280
    152
    228
    Credits:
    1,437
    Wow Im Amazed Best Thing I Have Ever Seen
    Keep Up The Good Work
     
    RosticGamer99 and Pyrex BLJ like this.
  16. oDezire-

    oDezire- Member

    13
    2
    8
    Credits:
    77
    wallhack no blur :wink:
     
  17. Christien

    Christien Trial Moderator Staff Member

    101
    67
    128
    Credits:
    418
    Really nice! First time I saw some of those functions! :smile:
     
    Pyrex BLJ likes this.
  18. Zlink033

    Zlink033 Active Member

    76
    34
    138
    Credits:
    1,389
    If you can make c++ to disable/enable dlc in pre-game :smile:
     
  19. oDezire-

    oDezire- Member

    13
    2
    8
    Credits:
    77
    if you wanna disable your DLC's just take the .dat or .edat fils out of the Game File
     
  20. Harry

    Harry I'm 'Serious'ly a better Developer

    1,105
    906
    398
    Credits:
    4,950
    lmao, disable the RoF offset skid
    Code:
    0x1CBF9F8 - 0x00
    Game looks for files to be existent, dlc files would be existent, searching with DLC enabled could possibly edited but the "in pre-game" part probably won't happen... Ill look for it
     
    Zlink033 likes this.

Share This Page