Extract codes for finding an index in scan_info_build()