Skip to content

Commit

Permalink
Disable cache in asm caching test
Browse files Browse the repository at this point in the history
  • Loading branch information
peace-maker committed Oct 3, 2024
1 parent 2875468 commit f871f56
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pwnlib/asm.py
Original file line number Diff line number Diff line change
Expand Up @@ -765,9 +765,10 @@ def asm(shellcode, vma = 0, extract = True, shared = False):
The output is cached:
>>> start = time.time()
>>> asm("lea rax, [rip+0]", arch = 'amd64')
>>> asm("lea rax, [rip+0]", arch = 'amd64', cache_dir = None) # force uncached time
b'H\x8d\x05\x00\x00\x00\x00'
>>> uncached_time = time.time() - start
>>> asm("lea rax, [rip+0]", arch = 'amd64') # cache it
>>> start = time.time()
>>> asm("lea rax, [rip+0]", arch = 'amd64')
b'H\x8d\x05\x00\x00\x00\x00'
Expand Down

0 comments on commit f871f56

Please sign in to comment.