ZenHAX

Free Game Research Forum | Official QuickBMS support | twitter @zenhax | SSL HTTPS://zenhax.com
It is currently Sat Oct 23, 2021 12:55 am

All times are UTC




Post new topic  Reply to topic  [ 1 post ] 
Author Message
PostPosted: Sun Oct 17, 2021 1:23 pm 

Joined: Sun Feb 09, 2020 11:35 am
Posts: 8
Sorry this is kinda a noob question but the only code I could somewhat understand is QuickBMS so i'm trying make this one work on QuickBMS...

Code:
let mRandom;

function getNextRandom() {
    mRandom ^= mRandom << 21;
    mRandom ^= mRandom >>> 35;
    mRandom ^= mRandom << 4;
   
    if (mRandom < 0)
        mRandom &= 2147483647;
   
    return mRandom / 2147483647;
}

function decryptPackage(bytes) {
    let view = new DataView(bytes);
   
    mRandom = 56895 & 25147 >> 1;
   
    for (let i = Math.min(view.byteLength, 65536) - 1; i >= 0; i -= 2)
        view.setInt8(i, view.getInt8(i) - Math.floor(getNextRandom() * 255));
   
    for (let i = view.byteLength - 1; i >= 0; i -= Math.floor(getNextRandom() * 255))
        view.setInt8(i, view.getInt8(i) - Math.floor(getNextRandom() * 255));
   
    for (let i = view.byteLength - 1; i >= Math.max(view.byteLength, 65536) - 65536; i -= 2)
        view.setInt8(i, view.getInt8(i) - Math.floor(getNextRandom() * 255));
   
    mRandom = 0;
    return bytes;
}


This code from Angry Birds Flash, I don't know how to convert


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 1 post ] 

All times are UTC


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Limited