int turnBitOn(int position, int data)
{
int temp = data | (1<<position);
return temp;
}
int example = turnBitOn(4, ; //24
int turnBitOff(int position, int data)
{
int temp = data & ~(1<<position);
return temp;
}
int example = turnBitOff(4, 24); //8
typedef unsigned char* BYTEP;
bool XOREncrypt(BYTEP data, int dataLen, BYTEP key, int keyLen)
{
if(keyLen <= 0) return false;
for( unsigned int index = 0; index < dataLen; index++ )
data[index] = data[index] ^ key[index % keyLen];
return true;
}
XOREncrypt(yourData, yourDatasLength, yourSecretKey, yourSecretKeysLength);
typedef unsigned char* BYTEP;
bool Write(char* fname, BYTEP data, unsigned int dataLen, unsigned long address)
{
if(dataLen <= 0) return false;
ofstream os(fname, ios::binary);
os.seekp(ios::beg);
streamoff addresss = address;
os.seekp(addresss);
for(int x = 0; x<dataLen; ++x)
os<<data[x];
return true;
}
Write("C:\\naggers.exe", datasauce, datasaucelength, 0x69);
unsigned int max = ~0;
printf(max); //0 in binary = 00000000, ~ reverses all bits in a sequence, making all bits on, 11111111, which is the max, this only gives the unsigned int's max.
unsigned int max = ~0;
printf(max); //0 in binary = 00000000, ~ reverses all bits in a sequence, making all bits on, 11111111, which is the max, this only gives the unsigned int's max.
Copyright © 2024, NextGenUpdate.
All Rights Reserved.