Skip to content
View in the app

A better way to browse. Learn more.

ResHax

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.
Help us keep the site running.

calldll

Featured Replies

  • Author
  • Localization

chrrox, posted Mon Aug 02, 2021 11:14 am (65459)


What is the correct conversion types to add to a dll function in quickbms?


unit8_t -- unsigned char?
unit16_t -- ?
unit32_t -- unsigned int?
unit64_t -- ?
  • Author
  • Localization

atom0s, posted Mon Aug 02, 2021 7:37 pm (65463)


Pretty sure all of the calldll and similar stuff makes use of the 'tcc' (TinyC Compiler) library, so you just need to match what C expects type-wise.

uint8_t - unsigned char
uint16_t - unsigned short
uint32_t - unsigned int
uint64_t - unsigned long long
  • Author
  • Localization

chrrox, posted Tue Aug 03, 2021 10:00 am (65473)


Thanks for your help that worked.

Can someone help with converting this function
Code:
void create_decrypt_vector(uint8_t* key, uint8_t* encrypted_data, uint64_t encrypted_size, uint8_t* output, uint64_t output_size)
.

I am getting stuck here I think I added the Mersenne-Twister correctly?

its memory file MEMORY_FILE11

blkstuff.7z

  • Author
  • Localization

chrrox, posted Tue Aug 03, 2021 10:10 pm (65484)


this might be easier to clean up to help with?

Code:
set MEMORY_FILE11 string "

typedef unsigned char      u8;
typedef unsigned int       u32;
typedef unsigned long long u64;

#define NN 312
#define MM 156
#define MATRIX_A 0xB5026F5AA96619E9ULL
#define UM 0xFFFFFFFF80000000ULL /* Most significant 33 bits */
#define LM 0x7FFFFFFFULL /* Least significant 31 bits */

struct mt19937_64 {
   unsigned long long mt[NN];
   unsigned long long mti;
};

void init_genrand64(struct mt19937_64* context, unsigned long long seed)
{
    context->mt[0] = seed;
    for (context->mti=1; context->mtimti )
        context->mt[context->mti] =  (6364136223846793005ULL * (context->mt[context->mti-1] ^ (context->mt[context->mti-1] >> 62)) context->mti);
}


unsigned long long genrand64_int64(struct mt19937_64* context)
{

       unsigned long long i;
       unsigned long long j;
       unsigned long long result;

       if (context->mti >= NN) {/* generate NN words at one time */
         unsigned long long mid = NN / 2;
         unsigned long long stateMid = context->mt[mid];
         unsigned long long x;
         unsigned long long y;

         for (i = 0, j = mid; i != mid - 1; i , j ) {
            x = (context->mt[i] & UM) | (context->mt[i 1] & LM);
            context->mt[i] = context->mt[i mid] ^ (x >> 1) ^ ((context->mt[i 1] & 1) * MATRIX_A);
            y = (context->mt[j] & UM) | (context->mt[j 1] & LM);
            context->mt[j] = context->mt[j - mid] ^ (y >> 1) ^ ((context->mt[j 1] & 1) * MATRIX_A);
         }
         x = (context->mt[mid - 1] & UM) | (stateMid & LM);
         context->mt[mid - 1] = context->mt[NN - 1] ^ (x >> 1) ^ ((stateMid & 1) * MATRIX_A);
         y = (context->mt[NN - 1] & UM) | (context->mt[0] & LM);
         context->mt[NN - 1] = context->mt[mid - 1] ^ (y >> 1) ^ ((context->mt[0] & 1) * MATRIX_A);

         context->mti = 0;
       }
      
       result = context->mt[context->mti];
       context->mti = context->mti 1;

       result ^= (result >> 29) & 0x5555555555555555ULL;
       result ^= (result << 17) & 0x71D67FFFEDA60000ULL;
       result ^= (result << 37) & 0xFFF7EEE000000000ULL;
       result ^= (result >> 43);
       return result;
}



void create_decrypt_vector(u8 *key, u8 *encrypted_data, u64 block_size, u64 encrypted_size, u8 *output, u64 output_size, u64 size) {
    u32 v9 = 0;
    u64 i;
    u64 v12;

    for (i = -1; ; i = v12) {
        if (v9 >= (int)(encrypted_size >> 3))
            break;
        //v12 = ((u64*)encrypted_data)[v9] ^ i;
        v9;
    }

    u64* key_qword = (u64*)key;
    u64 seed = key_qword[1] ^ 0x567BA22BABB08098 ^ i ^ key_qword[0];
    struct mt19937_64 context;
    init_genrand64(&context, seed);
    for (u64 i = 0; i < 10 >> 3; i )
        genrand64_int64(&context);
    //auto mt_rand = std::mt19937_64(seed);
    //for (uint64_t i = 0; i < output_size >> 3; i )
    //    ((uint64_t*)output)[i] = mt_rand();

}
"
Guest
This topic is now closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.