[GLOBAL]Generate QBkeys

Tutorials for all THUG+ games goes here.
Forum rules
This forum is only for posting tutorials.
Specify what game it is for, and please take a look at this Template.
Post Reply
ProHad
VIP
Posts: 45
Joined: Wed Mar 03, 2010 10:10 pm

[GLOBAL]Generate QBkeys

Post by ProHad » Wed Mar 17, 2010 6:53 pm

Credit to Roq:
QBKeys are simply the CRC-32 hash product of the qb key text; i.e. if I wanna make a key for the text "qbkey" I run it through the crc-32 algorithm to get a valid key. Try it in hex workshop, highlight the text, click on generate checksum and use crc-32. By the way, the text must be all lowercase before running the algorithm. For those of you that are confused.... here's some source code:

Algorithm to generate QB Keys (modified crc-32):

Code: Select all

unsigned long crc32f(unsigned char * buf, int len)
{
    unsigned char * p;
    unsigned long crc;

    crc = 0xFFFFFFFF;

    for(p = buf; len > 0; ++p, --len)
    {
        if(*p >= 'A' && *p <= 'Z')
        {
            *p += 32;
        }
        crc = (crc << 8) ^ crc32_table[(crc >> 24) ^ *p];
    }

    return ~crc;
}
Real crc-32 algorithm, no modification:

Code: Select all

unsigned long crc32(unsigned char * buf, int len)
{
    unsigned char * p;
    unsigned long crc;

    crc = 0xFFFFFFFF;

    for(p = buf; len > 0; ++p, --len)
    {
        crc = (crc << 8) ^ crc32_table[(crc >> 24) ^ *p];
    }

    return ~crc;
}

And the crc-table code:

Code: Select all

#define CRC32_POLY 0x04c11db7

void init_crc32()
{
    int i, j;
    unsigned long c;

    for(i = 0; i < 256; ++i)
    {
        for(c = i << 24, j = 8; j > 0; --j)
        {
            c = c & 0x80000000 ? (c << 1) ^ CRC32_POLY : (c << 1);
        }

        crc32_table[i] = c;
    }
}

If this is confusing I can try to help you out, one thing you should know is that Blub's tools DO NOT GENERATE VALID QB KEYS, he did not use this method so all of the custom keys you add to files made w/ blub's tools are not the values they should be.

I'll post a program to generate the keys from input text later

qwertysind
Posts: 117
Joined: Sun Mar 14, 2010 9:07 am

Re: Generate QBkeys(Roq)

Post by qwertysind » Mon Mar 29, 2010 1:07 am

"later"
when?
my roq.exe can't compile :i switch or :i case , i can't understand but he can't compile :(

ProHad
VIP
Posts: 45
Joined: Wed Mar 03, 2010 10:10 pm

Re: Generate QBkeys(Roq)

Post by ProHad » Mon Mar 29, 2010 10:32 pm

This is from the old forum, the program was posted, check the program lists it's called QBkey.exe

%.gone.
Global Moderator
Posts: 390
Joined: Sun Mar 07, 2010 5:12 pm

Re: Generate QBkeys(Roq)

Post by %.gone. » Tue Mar 30, 2010 2:15 am

if you're working with queenbee just do this...
create a new, anything, i use sectionscript's
then type in whatever your key is, example: create_my_menu
then change from "string" to "hex" via the button next to the text field.
if you plan on using the key to do a search in say thug2 then reverse the hex key given and search using the reversed hex key

the above method can also be used to covert other values such as integers or floats.

CHC
Site Admin
Posts: 54
Joined: Sun Feb 28, 2010 9:43 pm

Re: Generate QBkeys(Roq)

Post by CHC » Thu Jul 29, 2010 11:05 am

credits to reap are due for this actually

Morten1337
Site Admin
Posts: 322
Joined: Mon Mar 01, 2010 2:23 pm
Location: Norway

Re: Generate QBkeys(Roq)

Post by Morten1337 » Thu Jul 29, 2010 11:18 am

CHC wrote:credits to reap are due for this actually
i think he's referring to the post/quote, but i guess it could be misleading

ProHad
VIP
Posts: 45
Joined: Wed Mar 03, 2010 10:10 pm

Re: Generate QBkeys(Roq)

Post by ProHad » Thu Jul 29, 2010 1:30 pm

Yeah I was just refering to the orgional post.

Post Reply