Go Back   Winamp Forums > Developer Center > NSIS Discussion

Reply
Thread Tools Search this Thread Display Modes
Old 27th November 2008, 02:33   #1
nsnb
Senior Member
 
Join Date: Jul 2008
Posts: 157
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 is offline   Reply With Quote
Old 27th November 2008, 02:41   #2
nsnb
Senior Member
 
Join Date: Jul 2008
Posts: 157
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 is offline   Reply With Quote
Old 27th November 2008, 02:47   #3
nsnb
Senior Member
 
Join Date: Jul 2008
Posts: 157
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 )
nsnb is offline   Reply With Quote
Reply
Go Back   Winamp Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump