Skip to content

Commit

Permalink
fix bug in asmliteral
Browse files Browse the repository at this point in the history
  • Loading branch information
Penkace committed Jan 24, 2025
1 parent 6b73071 commit e90768d
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions ohre/abcre/dis/AsmLiteral.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,21 @@ def _process_normal_literal(self, lines: List[str]):
if 'method' in element_content and 'method_affiliate' in element_content:
cnt = 0
while cnt < len(array_split_list):
if 'string' in array_split_list[cnt]:
if 'string' in array_split_list[cnt] and 'method' in array_split_list[cnt+1]:
method_string = array_split_list[cnt].split(':')[
1].strip()[1:-1]
method_name = array_split_list[cnt + 1].split(':')[1].strip()
method_aff = array_split_list[cnt + 2].split(':')[1].strip()
method_dict[method_string] = {
'method': method_name, 'method_affiliate': method_aff}
cnt += 3
elif 'string' in array_split_list[cnt] and 'method' not in array_split_list[cnt+1]:
variable_string = array_split_list[cnt].split(':')[1].replace('"', '').strip()
variable_value = array_split_list[cnt+1].split(':')[1].replace('"', '').strip()
if 'null_value' in array_split_list[cnt+1]:
variable_value = 'null_value'
method_dict[variable_string] = variable_value
cnt += 2
else:
cnt += 1
method_amount = array_split_list[-1].split(':')[1]
Expand All @@ -73,9 +80,10 @@ def _process_normal_literal(self, lines: List[str]):
if element_amount % 2 == 1:
array_len -= 1
while cnt < array_len:
variable_string = array_split_list[cnt].split(':')[1].strip()
if '"' in variable_string:
variable_string = variable_string.replace('"', '')
variable_string = array_split_list[cnt].split(':')[1].strip().replace('"', '')
if len(variable_string) == 0:
cnt += 2
continue
variable_value = array_split_list[cnt + 1]
if 'null_value' in variable_value:
variable_value = 'null_value'
Expand Down

0 comments on commit e90768d

Please sign in to comment.