/* IDC script for swapping the low order nibble and the high order nibble of a byte Uncomment one, or both of the functions at the bottom of the script --Message() will just print the decoded strings to the messages window but will not patch the DB --PatchByte() is self explanatory Script by Chris Sia eon.bass@gmail.com */ #include static revbyte(void) { auto start, end, ptr, X, Y, Z; start = SelStart(); end = SelEnd(); end = end - 1; Message("Reversing Byte Order\n"); for (ptr = start; ptr <= end; ptr++) { X = Byte(ptr); Y = Byte(ptr); { X = (X & 0xFF); X = X << 4; } { Y = (Y & 0xFF); Y = Y >> 4; } Z = (X | Y); /* Uncomment below to enable decoded strings to be printed in Messages Window */ /*Message(Z);*/ /* Uncomment below to enable swapped bytes to be patched back to the DB */ /*PatchByte(ptr, Z);*/ } }