frida / frida-java-bridge

Java runtime interop from Frida
324 stars 120 forks source link

bug in function recompileExceptionClearForArm #308

Open cr4zyserb opened 8 months ago

cr4zyserb commented 8 months ago

There is a small logic issue in recompileExceptionClearForArm as when there is end of block, and relocator.readOne(); returns 0, it will throw exception, while it should break

    do {
      const offset = relocator.readOne();
      if (offset === 0) {
        throw new Error('Unexpected end of block');
      }

it should be:

    do {
      const offset = relocator.readOne();
      if (offset === 0) {
        break;
      }

As same logic is followed in recompileExceptionClearForArm64