Hi,
I am a beginner with perl, and have very little understandin of the language at the moment. I need to find a text string in a binary file, but am not sure how to do this. My basic idea is to read the file in binary mode, convert the text string to binary, and search for the converted binary string in the file.
To convert text string to perl, I am trying to use the pack function.
$binaryString = pack("B*", $textString);
But, I am not sure if this is the right way to go. Can someone plz give me some feedback on this, or tell me wut wuld b better or more correct approach to this problem..
Thanks in advance!
I am a beginner with perl, and have very little understandin of the language at the moment. I need to find a text string in a binary file, but am not sure how to do this. My basic idea is to read the file in binary mode, convert the text string to binary, and search for the converted binary string in the file.
To convert text string to perl, I am trying to use the pack function.
$binaryString = pack("B*", $textString);
But, I am not sure if this is the right way to go. Can someone plz give me some feedback on this, or tell me wut wuld b better or more correct approach to this problem..
Thanks in advance!