Skip to content

Commit

Permalink
better assets2banks fix (for same bug)
Browse files Browse the repository at this point in the history
[also this is version 2.6.4]
  • Loading branch information
sverx committed May 5, 2022
1 parent cecf7a0 commit e9f684d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
Binary file modified assets2banks/Windows/assets2banks.exe
Binary file not shown.
14 changes: 5 additions & 9 deletions assets2banks/src/assets2banks.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# -*- coding: utf-8 -*-

# Author: sverx
# Version: 2.6.3 (bugfix)
# Version: 2.6.4 (better bugfix)

from __future__ import absolute_import, division, generators, unicode_literals, print_function, nested_scopes
import sys
Expand All @@ -15,11 +15,7 @@ def __init__(self, operator, start, length, values):
self.operator = operator
self.start = start
self.length = length
self.values = []
if isinstance(values, list):
self.values.extend(values)
else:
self.values.append(values)
self.values = values

class Asset:
def __init__(self, name, size):
Expand Down Expand Up @@ -187,7 +183,7 @@ def print_usage():
ovp = ls[11:].split()
try:
if len(ovp) == 2: # if there are two values only, we overwrite just one value
md = Modify('set', int(ovp[0], 0), 1, ovp[1])
md = Modify('set', int(ovp[0], 0), 1, [ovp[1]])
else:
md = Modify('set', int(ovp[0], 0), int(ovp[1], 0), ovp[2:])
except ValueError:
Expand All @@ -199,9 +195,9 @@ def print_usage():
if mdf[0].lower() == 'add' or mdf[0].lower() == 'and' or mdf[0].lower() == 'or' or mdf[0].lower() == 'xor':
try:
if len(mdf) == 2: # if there is one value only after the operator, we modify all array elements
md = Modify(mdf[0].lower(), 0, a.size, mdf[1])
md = Modify(mdf[0].lower(), 0, a.size, [mdf[1]])
elif len(mdf) == 3: # if there are two values only after the operator, we modify one array element only
md = Modify(mdf[0].lower(), mdf[1], 1, mdf[2])
md = Modify(mdf[0].lower(), int(mdf[1], 0), 1, [mdf[2]])
else: # if there are three (or more) values after the operator, we modify *len* array elements from *start*
md = Modify(mdf[0].lower(), int(mdf[1], 0), int(mdf[2], 0), mdf[3:])
except ValueError:
Expand Down

0 comments on commit e9f684d

Please sign in to comment.