Skip to content

Commit

Permalink
demux fix
Browse files Browse the repository at this point in the history
  • Loading branch information
doomedraven committed Jan 7, 2025
1 parent bd1397b commit e2e2b2a
Show file tree
Hide file tree
Showing 3 changed files with 98 additions and 70 deletions.
18 changes: 14 additions & 4 deletions lib/cuckoo/common/demux.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,12 +213,21 @@ def demux_sflock(filename: bytes, options: str, check_shellcode: bool = True):
return [], "blacklisted package"
for sf_child in unpacked.children:
if sf_child.to_dict().get("children"):
retlist.extend(_sf_children(ch) for ch in sf_child.children)
for ch in sf_child.children:
tmp_child = _sf_children(ch)
# check if path is not empty
if tmp_child and tmp_child[0]:
retlist.extend(tmp_child)
# child is not available, the original file should be put into the list
if filter(None, retlist):
retlist.append(_sf_children(sf_child))
tmp_child = _sf_children(sf_child)
# check if path is not empty
if tmp_child and tmp_child[0]:
retlist.append(tmp_child)
else:
retlist.append(_sf_children(sf_child))
tmp_child = _sf_children(sf_child)
# check if path is not empty
if tmp_child and tmp_child[0]:
retlist.append(tmp_child)
except Exception as e:
log.error(e, exc_info=True)
return list(filter(None, retlist)), ""
Expand Down Expand Up @@ -347,3 +356,4 @@ def demux_sample(filename: bytes, package: str, options: str, use_sflock: bool =
new_retlist.append((filename, platform))

return new_retlist[:10], error_list

Loading

0 comments on commit e2e2b2a

Please sign in to comment.