[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[no subject]
- <!--x-content-type: text/plain -->
- <!--x-date: Wed Nov 17 17:51:35 2004 -->
- <!--x-from-r13: wxvaarl ng ybpnyargfbyhgvbaf.pbz (Xnzrf B. Yvaarl WWW) -->
- <!--x-message-id: [email protected] -->
- <!--x-reference: [email protected] -->
- <!--x-reference: [email protected] -->
- <!--x-reference: [email protected] --> "http://www.w3.org/TR/html4/loose.dtd">
- <!--x-subject: [ale] Binary Grep -->
- <li><em>date</em>: Wed Nov 17 17:51:35 2004</li>
- <li><em>from</em>: jkinney at localnetsolutions.com (James P. Kinney III)</li>
- <li><em>in-reply-to</em>: <<a href="msg00757.html">[email protected]</a>></li>
- <li><em>references</em>: <[email protected]> <<a href="msg00756.html">[email protected]</a>> <<a href="msg00757.html">[email protected]</a>></li>
- <li><em>subject</em>: [ale] Binary Grep</li>
> $ perl -le 'print "a" x 2047, "\xff" x 16, "b" x 512' > foo
> $ perl -lne 'BEGIN{$/=\1024}$o=($.-1)*1024-length$b;$b.=$_;print "hit byte ", $o + $-[0] if $b =~ /\xff{16}/;$b=substr($b,-15,15)' foo
> hit byte 2047
> $ perl -le 'print "a" x 2040, "\xff" x 16, "b" x 512' > foo
> $ perl -lne 'BEGIN{$/=\1024}$o=($.-1)*1024-length$b;$b.=$_;print "hit byte ", $o + $-[0] if $b =~ /\xff{16}/;$b=substr($b,-15,15)' foo
> hit byte 2040
There are days I truly hate perl....
I'm hoping that Perl 7 will include the Psionics module and just read my
mind...
--
James P. Kinney III \Changing the mobile computing world/
CEO & Director of Engineering \ one Linux user /
Local Net Solutions,LLC \ at a time. /
770-493-8244 \.___________________________./
<a rel="nofollow" href="http://www.localnetsolutions.com">http://www.localnetsolutions.com</a>
GPG ID: 829C6CA7 James P. Kinney III (M.S. Physics)
<jkinney at localnetsolutions.com>
Fingerprint = 3C9E 6366 54FC A3FE BA4D 0659 6190 ADC3 829C 6CA7
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
</pre>
<!--X-Body-of-Message-End-->
<!--X-MsgBody-End-->
<!--X-Follow-Ups-->
<hr>
<!--X-Follow-Ups-End-->
<!--X-References-->
<ul><li><strong>References</strong>:
<ul>
<li><strong><a name="00753" href="msg00753.html">[ale] Binary Grep</a></strong>
<ul><li><em>From:</em> joe at madewell.com (Joe Steele)</li></ul></li>
<li><strong><a name="00756" href="msg00756.html">[ale] Binary Grep</a></strong>
<ul><li><em>From:</em> greg.freemyer at gmail.com (Greg Freemyer)</li></ul></li>
<li><strong><a name="00757" href="msg00757.html">[ale] Binary Grep</a></strong>
<ul><li><em>From:</em> fletch at phydeaux.org (Fletch)</li></ul></li>
</ul></li></ul>
<!--X-References-End-->
<!--X-BotPNI-->
<ul>
<li>Prev by Date:
<strong><a href="msg00764.html">[ale] FC3 On USB HDD</a></strong>
</li>
<li>Next by Date:
<strong><a href="msg00766.html">[ale] Binary Grep</a></strong>
</li>
<li>Previous by thread:
<strong><a href="msg00757.html">[ale] Binary Grep</a></strong>
</li>
<li>Next by thread:
<strong><a href="msg00766.html">[ale] Binary Grep</a></strong>
</li>
<li>Index(es):
<ul>
<li><a href="maillist.html#00765"><strong>Date</strong></a></li>
<li><a href="threads.html#00765"><strong>Thread</strong></a></li>
</ul>
</li>
</ul>
<!--X-BotPNI-End-->
<!--X-User-Footer-->
<!--X-User-Footer-End-->
</body>
</html>