mirror of
https://github.com/HyperDbg/HyperDbg.git
synced 2026-08-31 10:07:02 +00:00
add automatic tester for statements
This commit is contained in:
parent
ed10290568
commit
595c2a2d7a
8 changed files with 8167 additions and 5066 deletions
File diff suppressed because it is too large
Load diff
|
|
@ -531,6 +531,8 @@ def NULL():
|
|||
res = ''
|
||||
return res
|
||||
|
||||
def tohex(val, nbits):
|
||||
return hex((val + (1 << nbits)) % (1 << nbits))
|
||||
|
||||
def evaluate(s):
|
||||
s2 = s.replace('0n','').replace('0y','0b').replace('/','//')
|
||||
|
|
@ -538,6 +540,8 @@ def evaluate(s):
|
|||
|
||||
try:
|
||||
v = eval(s2)
|
||||
v = tohex(v, 64)
|
||||
v = v.replace('0x', '')
|
||||
except:
|
||||
pass
|
||||
return v
|
||||
|
|
@ -562,7 +566,6 @@ if __name__ == '__main__':
|
|||
f.write(res+'\n')
|
||||
f.write(str(val)+'\n')
|
||||
f.write('$end$'+'\n')
|
||||
f.write('\n')
|
||||
print(counter)
|
||||
print(res)
|
||||
print(val)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue