Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

-z option hexrand is not work #47

Closed
daxueba opened this issue Jul 19, 2017 · 1 comment
Closed

-z option hexrand is not work #47

daxueba opened this issue Jul 19, 2017 · 1 comment
Labels

Comments

@daxueba
Copy link

daxueba commented Jul 19, 2017

class hexrand:
.....................
def next (self):
self.current = random.SystemRandom().randint(self.minimum,self.maximum)

lgth = len(hex(self.maximum).replace("0x",""))
pl="%"+str(lgth)+"s"
num = hex(self.current).replace("0x","")	
pl = pl % (num)
payl =pl.replace(" ","0")
return payl

should be:

def next (self):
if self.__count==0:                              #add   
	raise StopIteration

self.current = random.SystemRandom().randint(self.minimum,self.maximum)

lgth = len(hex(self.maximum).replace("0x",""))
pl="%"+str(lgth)+"s"
num = hex(self.current).replace("0x","")	
pl = pl % (num)
payl =pl.replace(" ","0")
self.__count+=1                                       #add
return payl
@xmendez xmendez added the bug label Sep 22, 2017
@xmendez
Copy link
Owner

xmendez commented Oct 25, 2019

closing due to inactivity

@xmendez xmendez closed this as completed Oct 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants