diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/generic/dumb_ptr.py | 2 | ||||
-rw-r--r-- | src/map/script-parse.py | 6 |
2 files changed, 6 insertions, 2 deletions
diff --git a/src/generic/dumb_ptr.py b/src/generic/dumb_ptr.py index b7973a7..c31b1e7 100644 --- a/src/generic/dumb_ptr.py +++ b/src/generic/dumb_ptr.py @@ -7,7 +7,7 @@ class dumb_ptr(object): self._value = value def to_string(self): - return '0x%x' % long(self._value['impl'].cast(gdb.parse_and_eval('(long *)0').type)) + return '0x%x' % int(self._value['impl'].cast(gdb.parse_and_eval('(long *)0').type)) def children(self): try: diff --git a/src/map/script-parse.py b/src/map/script-parse.py index 0309f54..199e348 100644 --- a/src/map/script-parse.py +++ b/src/map/script-parse.py @@ -20,6 +20,8 @@ class ScriptBuffer(object): FUNC_REF, '''.replace(',', '').split() ci = int(b[i]) + if ci < 0: + ci += 256 if ci >= 0x80: rv = 0 sh = 0 @@ -35,6 +37,8 @@ class ScriptBuffer(object): i = next(r) ci = int(b[i]) + if ci < 0: + ci += 256 rv += (ci & 0x7f) << sh sh += 6 if not (ci >= 0xc0): @@ -81,7 +85,7 @@ class ScriptBuffer(object): if ci == 0: break buf.append(ci) - return 'STR "%s"' % str(buf).replace('\\', '\\\\').replace('"', '\\"') + return 'STR "%s"' % bytes(buf).decode("utf-8").replace('\\', '\\\\').replace('"', '\\"') elif cs == 'EOL': return cs + '\n' return cs |