Skip to content

Commit 423fefa

Browse files
committed
Use release versions...
Improve disassembler output Add funding
1 parent 484f004 commit 423fefa

3 files changed

Lines changed: 27 additions & 6 deletions

File tree

.circleci/config.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,10 @@ jobs:
1414
password: $DOCKERHUB_PASSWORD
1515
steps:
1616
- checkout # checkout source code to working directory
17-
- run: pip install --local -e git+https://github.com/rocky/python-xdis.git#egg=xdis
17+
- run: pip install xdis
1818
- run: pip install --local -e git+https://github.com/rocky/pytracer.git#egg=tracer
19-
- run: pip install --local -e git+https://github.com/rocky/python-filecache.git#egg=pyficache
19+
- run: pip install pyficache
20+
- run: pip install uncompyle6
2021
- run: pip install --local -e git+https://github.com/rocky/python-decompile3.git#egg=decompyle3
2122
- run: pip install --local -e .
2223
- run: pip install -r requirements-dev.txt

.github/FUNDING.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# These are supported funding model platforms
2+
3+
github: [rocky]
4+
patreon: # Replace with a single Patreon username
5+
open_collective: # Replace with a single Open Collective username
6+
ko_fi: # Replace with a single Ko-fi username
7+
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
8+
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
9+
liberapay: rocky
10+
issuehunt: # Replace with a single IssueHunt username
11+
otechie: # Replace with a single Otechie username
12+
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']

trepan/lib/disassemble.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
get_instructions_bytes,
1818
get_opcode,
1919
)
20+
from xdis.instruction import Instruction
2021
from xdis.std import distb
2122
from xdis.version_info import PYTHON_VERSION_TRIPLE
2223

@@ -368,11 +369,17 @@ def null_print(x):
368369
hasattr(opc, "opcode_extended_fmt")
369370
and opc.opname[op] in opc.opcode_extended_fmt
370371
):
371-
result= opc.opcode_extended_fmt[opc.opname[op]](
372+
tos_str, start_offset = opc.opcode_extended_fmt[opc.opname[op]](
372373
opc, list(reversed(instructions))
373374
)
374-
if result is not None:
375-
argrepr = result[0]
375+
if start_offset is not None:
376+
argrepr = tos_str
377+
new_instruction = list(instructions[-1])
378+
new_instruction[-2] = tos_str
379+
new_instruction[-1] = start_offset
380+
del instructions[-1]
381+
instructions.append(Instruction(*new_instruction))
382+
376383
pass
377384
elif asm_format in ("extended", "extended-bytes"):
378385
# Note: instr.arg is also None
@@ -432,7 +439,8 @@ def section(msg_str):
432439
# dis(msg, msg_nocr, errmsg, section, curframe,
433440
# start_offset=10, end_offset=20, highlight='dark')
434441
print("-" * 40)
435-
for asm_format in ("extended", "bytes", "extended-bytes", "std"):
442+
# for asm_format in ("std", "extended", "bytes", "extended-bytes"):
443+
for asm_format in ("extended", "bytes", "extended-bytes"):
436444
print("Format is", asm_format)
437445
dis(msg, msg_nocr, section, errmsg, disassemble, asm_format=asm_format)
438446
print("=" * 30)

0 commit comments

Comments
 (0)