5 UInt32 PPC_B_Convert(Byte *data, UInt32 size, UInt32 nowPos, int encoding)
8 for (i = 0; i + 4 <= size; i += 4)
10 /* PowerPC branch 6(48) 24(Offset) 1(Abs) 1(Link) */
11 if ((data[i] >> 2) == 0x12 &&
13 (data[i + 3] & 3) == 1
14 /* || (data[i+3] & 3) == 3 */
18 UInt32 src = ((data[i + 0] & 3) << 24) |
25 dest = nowPos + i + src;
27 dest = src - (nowPos + i);
28 data[i + 0] = (Byte)(0x48 | ((dest >> 24) & 0x3));
29 data[i + 1] = (Byte)(dest >> 16);
30 data[i + 2] = (Byte)(dest >> 8);