Skip to content

Commit

Permalink
BugFix xphp
Browse files Browse the repository at this point in the history
  • Loading branch information
Th4nat0s committed Feb 7, 2013
1 parent f55c5c5 commit d108060
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ cprint : Column print a file (only ascii printable)
ropval.py : Find values in ELF, usefull for rop like ADD EAX,[EBX]

<b>X</b><br>
xlentro.py : Xor Lenght Entropy - Show Shannon Entropy on a file, Usefull for determining XOR crypted file key lenght.
xlentro.py : Xor Lenght Entropy - Show Shannon Entropy on a file, Usefull for determining XOR crypted file key lenght.<br>
xphp.py: Xtract only php code from any file
12 changes: 6 additions & 6 deletions xphp.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/python
import sys

# v 0.1
# v 0.2

# Copyleft Thanat0s
# http://Thanat0s.trollprod.org
Expand All @@ -25,7 +25,6 @@
Comment = False
CommentType = ''
for byte in range( 0, fileSize ):

# Ignore <? et ?> dans les strings
if ((byteArr[byte] == ord("'")) and (CommentType == '' or CommentType == ord("'"))):
Comment = not Comment # Toggle True to False
Expand All @@ -43,13 +42,14 @@
CommentType = ''

# Prend entre <? et ?>
if Comment == False :
if Comment == False:
if (byteArr[byte] == ord("<")) and (byteArr[byte+1] == ord("?")) :
PenDown = True
if (byteArr[byte] == ord("?")) and (byteArr[byte+1] == ord(">")) :
PenDown = False

if PenDown == True :
Result = Result + chr(byteArr[byte])
Result = Result + chr(byteArr[byte]) + chr(byteArr[byte+1])

if PenDown == True:
Result = Result + chr(byteArr[byte])

print Result

0 comments on commit d108060

Please sign in to comment.