Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect ARB indices for Recovery ZIPs #2

Open
IgorEisberg opened this issue May 16, 2019 · 4 comments

Comments

Projects
None yet
3 participants
@IgorEisberg
Copy link

commented May 16, 2019

From your source code:

def main():
    """
    check anti-rollback index in xbl file
    """
    file_type = check_file()
    makedirs("tmp", exist_ok=True)
    file = argv[1]
    if file_type == 'zip':
        print('Checking ARB from Recovery ROM')
        extract_zip(file)
        **check_file()**
    elif file_type == 'tgz':
        print('Checking ARB from Fastboot ROM')
        extract_tar(file)
        check_flash_script()
    else:
        print("Something went wrong!")
    rmtree("tmp/")
  1. You sure about that line? Shouldn't it be check_xbl(), which isn't used anywhere in the script?
  2. Even if replaced with check_xbl(), the returned value is incorrect. Returns false indexes for known "anti: 4" ROMs: 3 for whyred and 1 for dipper. Only indicates that the check_xbl() looks for the wrong thing.
  3. Besides xbl.* (xbl.elf and xbl.img) there's also sbl1.mbn on sakura (known "anti: 4" device as well), and if modified check_xbl() to read that too, returns: 2
@yshalsager

This comment has been minimized.

Copy link
Member

commented May 16, 2019

Hello @IgorEisberg, Thanks for reporting.

  1. It's my mistake. I've fixed in the last commit.
  2. To be honest, I don't know why it gives a wrong index. As you see, it checks for arb string inside xbl file, which returns in case of whyred ['0000000300000000']. If you have a better idea for checking feel free to suggest it.
  3. I didn't know about it, thanks for explaining.
@IgorEisberg

This comment has been minimized.

Copy link
Author

commented May 16, 2019

  1. My team looks into a method for checking ARB index from Recovery ROMs as well (as we got no use for Fastboot ROMs), so we've got no solution as of yet. Just curious as to why do you think that that string is the ARB index and not something entirely unrelated. As we can see it, while the Fastboot ROMs of affected devices all have index of 4 in their flashing script, the fact that these strings don't match that would indicate that they are unrelated to ARB.
@yshalsager

This comment has been minimized.

Copy link
Member

commented May 16, 2019

@IgorEisberg, according to this guide ARB offset is 148B. But seems this is not a standard for every ARB enabled device.

@ale8530

This comment has been minimized.

Copy link

commented May 21, 2019

I have considered the arb question better, this tool probably cannot give the correct "anti" value in all the cases but it allows to identify if it has had an increase from 2.
If this 2,3 or 4 arb tool is active

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.