Winamp & Shoutcast Forums

Winamp & Shoutcast Forums (http://forums.winamp.com/index.php)
-   NSIS Discussion (http://forums.winamp.com/forumdisplay.php?f=65)
-   -   Finding a string in a stream of bytes (http://forums.winamp.com/showthread.php?t=300368)

nsnb 27th November 2008 02:33

Finding a string in a stream of bytes
 
I know about ${StrStr} in StrFunc.nsh.
I also know about ${WordFind} in appendix E.3.2

The "problem" with those is that they can find a string only within another string. That is, the "container" for the string to be found must be a well behaving, non-special-characters string.

My question now: Is there similar function (or plug-in) in NSIS that find a string within any stream of bytes?

Case in question: I am trying to find a certain string inside a binary file. I know how to do this in C/C++. Is this doable from within the NSIS scripting language?

nsnb 27th November 2008 02:41

Ah! Once again, after exhausting all search possibilities, I discovered that I missed one: Google NSIS Search.

I typed "string binary" in the search box and look what I have found:

BinStrSearch
Quote:

"This function will find a text string in a binary file and returns the offset in the file"
I think that this is what I was looking for. :)

nsnb 27th November 2008 02:47

Actually I was too quick to celebrate. The BinStrSearch function finds a string in a binary file.

I need to do that search not in a file but rather in a variable (buffer).

I will keep searching... (no pun intended :))


All times are GMT. The time now is 05:16.

Copyright © 1999 - 2010 Nullsoft. All Rights Reserved.