Skip to content

Commit 74f635a

Browse files
committed
Merge branch 'queenp-master'
Merged queenp branch into master
2 parents 7adfaf6 + 0516bbc commit 74f635a

File tree

4 files changed

+22
-3
lines changed

4 files changed

+22
-3
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2017-05-01: forked by queenp, adding rudimentary python setuptools script to help install lexer in pygments cache. Also added some unrecognised mnemonics.

r2highlight/__init__.py

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
__all__=['radare2']
2+
3+
from r2highlight.radare2 import Radare2Lexer

radare2.py r2highlight/radare2.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ class Radare2Lexer(RegexLexer):
9393
],
9494

9595
'registers': [
96-
(words(('rsp', 'esp', 'spl', 'rbp', 'ebp', 'bpl', 'rax', 'eax', 'ah', 'al', 'rbx', 'ebx', 'bh', 'bl', 'rcx', 'ecx', 'cx', 'ch', 'cl', 'rdx', 'edx', 'dx', 'dh', 'dl', 'rdi', 'edi', 'dil', 'rsi', 'esi', 'sil', 'r15', 'r14', 'r13', 'r12', 'r10', 'fs:', 'gs:')),
96+
(words(('rsp', 'esp', 'spl', 'rbp', 'ebp', 'bpl', 'rax', 'eax', 'ah', 'al', 'rbx', 'ebx', 'bh', 'bl', 'rcx', 'ecx', 'cx', 'ch', 'cl', 'rdx', 'edx', 'dx', 'dh', 'dl', 'rdi', 'edi', 'dil', 'rsi', 'esi', 'sil', 'r15', 'r14', 'r13', 'r12', 'r10', 'r9', 'r9d', 'r8', 'fs:', 'gs:')),
9797
Keyword)
9898
],
9999

@@ -113,12 +113,12 @@ class Radare2Lexer(RegexLexer):
113113
],
114114

115115
'arithmeticops': [
116-
(words(('leave', 'mov', 'lea', 'add', 'sub', 'imul', 'mul', 'shl', 'shr', 'sar', 'sal'), suffix=r'\b', prefix=r'\b'),
116+
(words(('leave', 'mov', 'movzx', 'movsx', 'lea', 'add', 'sub', 'imul', 'mul', 'shl', 'shr', 'sar', 'sal'), suffix=r'\b', prefix=r'\b'),
117117
Operator)
118118
],
119119

120120
'ipops': [
121-
(words(('jmp', 'jne', 'jae', 'jbe', 'call', 'ret'), suffix=r'\b', prefix=r'\b'),
121+
(words(('je', 'jmp', 'jne', 'jae', 'jbe', 'call', 'ret'), suffix=r'\b', prefix=r'\b'),
122122
Name.Function)
123123
]
124124
}

setup.py

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
from setuptools import setup
2+
3+
entry_points = """
4+
[pygments.lexers]
5+
r2highlight = r2highlight.radare2:Radare2Lexer
6+
"""
7+
8+
setup(
9+
name = "r2highlight",
10+
version = "0.0.0",
11+
description = __doc__,
12+
author = "Tobal Jackson",
13+
packages = ['r2highlight'],
14+
entry_points = entry_points
15+
)

0 commit comments

Comments
 (0)