Skip to content
This repository has been archived by the owner on Jul 21, 2020. It is now read-only.

Errors in RarVM #26

Open
tycoeur opened this issue Mar 3, 2014 · 0 comments
Open

Errors in RarVM #26

tycoeur opened this issue Mar 3, 2014 · 0 comments

Comments

@tycoeur
Copy link

tycoeur commented Mar 3, 2014

In com.github.junrar.unpack.vm.RarVM, opcodes likes VM_INC, VM_INCB, VM_INCD, VM_DEC, VM_DECB, VM_DECD, VM_ADC, VM_SBB, VM_MUL... contains an errors:

In java operator '+', '-', '*' have priority over bitwise '&'.
So: (v & 0xffffffff + 1) becomes: (v & (0xffffffff + 1)), ie always 0
So: (v & 0xffffffff - 1) becomes: (v & (0xffffffff - 1))

ref: http://docs.oracle.com/javase/tutorial/java/nutsandbolts/operators.html

regards
Tyco :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant