# Return argument for ida 9 ida\_bytes.bin\_search are not as documented

**URL:** https://community.hex-rays.com/t/return-argument-for-ida-9-ida-bytes-bin-search-are-not-as-documented/69
**Category:** Support
**Tags:** idapython
**Created:** [January 22, 2025, 11:45pm UTC](https://community.hex-rays.com/t/return-argument-for-ida-9-ida-bytes-bin-search-are-not-as-documented/69 "2025-01-22T23:45:45Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![mistahmikey](https://avatars.discourse-cdn.com/v4/letter/m/58f4c7/32.png) [@mistahmikey](https://community.hex-rays.com/u/mistahmikey)
#### Post date: [January 22, 2025, 11:45pm UTC](https://community.hex-rays.com/t/return-argument-for-ida-9-ida-bytes-bin-search-are-not-as-documented/69/1 "2025-01-22T23:45:45Z")

</div>

The documentation says this should be the matching address if the search is successful, otherwise ida\_idaapi.BADADDR. But for some reason when I call this, it returns a tuple.

![image](https://us1.discourse-cdn.com/flex002/uploads/rays_hex/original/1X/a30bc3357b68ae83f8d62d2630b78c55f48c8436.png)

Is this a bug? It looks like the first tuple value is the hit address, no idea what the second value is. Any information to clear this up would be appreciated.

---

<div class="post-metadata">

### Author: ![igor](https://sea2.discourse-cdn.com/flex002/user_avatar/community.hex-rays.com/igor/32/35_2.png) [@igor](https://community.hex-rays.com/u/igor)
#### Post date: [January 24, 2025, 3:02pm UTC](https://community.hex-rays.com/t/return-argument-for-ida-9-ida-bytes-bin-search-are-not-as-documented/69/2 "2025-01-24T15:02:43Z")

</div>

Hi,

The second value is the index of the matched pattern in the binpat vector. We’ll try to improve the documentation.  
BTW, depending on your use case, `find_bytes` or `find_string` might be more suitable.

---

<div class="post-metadata">

### Author: ![igor](https://sea2.discourse-cdn.com/flex002/user_avatar/community.hex-rays.com/igor/32/35_2.png) [@igor](https://community.hex-rays.com/u/igor)
#### Post date: [January 27, 2025, 11:44am UTC](https://community.hex-rays.com/t/return-argument-for-ida-9-ida-bytes-bin-search-are-not-as-documented/69/3 "2025-01-27T11:44:11Z")

</div>

2 posts were split to a new topic: [Parsing templated types](https://community.hex-rays.com/t/parsing-templated-types/100)
