made algo to extract rings from binaries