is there a way to generate a xor pad fast in qickbms.
it starts at 0 and keeps going higher till the size of the file every 16 bytes like this.
generate xor pad
-
- Site Admin
- Posts: 12984
- Joined: Wed Jul 30, 2014 9:32 pm
Re: generate xor pad
Fast? uhmmm no.
It depends by how long it should be your xor pad, if it has a limited short size you can build it by hand but if that is supposed to be unlimited (as I think) then it's complicated.
It depends by how long it should be your xor pad, if it has a limited short size you can build it by hand but if that is supposed to be unlimited (as I think) then it's complicated.
-
- Posts: 388
- Joined: Thu Aug 07, 2014 10:28 pm
Re: generate xor pad
fastest way would be initialize as 0 the file size then use c program to modify values?
-
- Site Admin
- Posts: 12984
- Joined: Wed Jul 30, 2014 9:32 pm
Re: generate xor pad
A C function for performing the decryption would be good.
Do you mean something like the following?
Do you mean something like the following?
Code: Select all
set MEMORY_FILE10 string "
void decrypt(unsigned char *data, int size) {
int i, c;
for(i = 0; i < size; i++) {
c = i >> 4;
switch(i & 15) {
case 0: break;
case 1: c >>= 8; break;
case 2: c >>= 16; break;
case 3: c >>= 24; break;
default: c = 0;
}
data[i] ^= c;
}
}
"
get SIZE asize
log MEMORY_FILE 0 SIZE
calldll MEMORY_FILE10 decrypt tcc RET MEMORY_FILE SIZE
log "dump.dat" 0 SIZE MEMORY_FILE