void func(char *datac, guint32 data_len) { int i; int per; char tmp; unsigned __int8 *tar; signed int per2;
per = (data_len - 136 + 3) >> 2;// div 4 tar = (unsigned __int8 *)(datac + 136); //&datac[136] for ( i = 0; i < per; ++i ) { if ( i & 1 ) //condition : odd number {/* exchang data in tar and tar[i+per] */ tmp = tar; tar = *(&tar + per); // = tar[i+per] *(&tar + per) = tmp; } }
per2 = (signed int)(data_len - 136 - 3 * per); for ( i = 0; i < per2; ++i ) { if ( !(i & 1) )//condition : even number {/* exchang data in tar[2 * per + i] and tar[3 * per + i] */ tmp = *(&tar[2 * per] + i); *(&tar[2 * per] + i) = *(&tar[3 * per] + i); *(&tar[3 * per] + i) = tmp; } } }