Radare2: __objc_selrefs section is empty on latest version

Created on 9 Jan 2018  路  3Comments  路  Source: radareorg/radare2

The ___objc_selrefs_ section is empty after getting the latest version of r2.
I noticed it, because alvarofes script cannot find any xrefs more. This section is crucial for the analysis.

radare2 2.3.0-git 16987 @ darwin-x86-64 git.2.2.0-176-g5402c5938
commit: 5402c5938de925996a43b157994c6e5dfaec02c7 build: 2018-01-09__17:56:32
RAnal bug

All 3 comments

This problem has been introduced by this commit: https://github.com/radare/radare2/commit/3d8833f47cd930167b3e110ac822421887b6dd96 which detects the S_ZEROFILL flag to zero out the __bss section.

The cause was a wrong comparison with the S_ZEROFILL flag which attributed it to sections which shouldn't be actually zero filled, like the case of __objc_selrefs. The zeroing-out of the section happened because putting phisical size different from virtual size makes the io layer fill the gaps with zeroes, and phisical size 0 means all section is zeroed out.

It has been fixed in this commit by @lowlyw : https://github.com/radare/radare2/commit/7da0d9f3015889c351e1f547db60ac6ba36e8006 which fixes the flag comparison. And now __bss is zeroed out while __objc_selrefs retains its content.

@mrmacete Great explanation and fast fix, thank you!

馃槃 full credit for the fix goes to @lowlyw

Was this page helpful?
0 / 5 - 0 ratings

Related issues

crowell picture crowell  路  8Comments

radare picture radare  路  8Comments

XVilka picture XVilka  路  3Comments

securitykitten picture securitykitten  路  4Comments

YugoCode picture YugoCode  路  6Comments