Skip to content

Commit

Permalink
Fixed bugs in unused functions, rem unused dep
Browse files Browse the repository at this point in the history
  • Loading branch information
ydkhatri committed Aug 1, 2021
1 parent 82c3ec3 commit 7e4cbc3
Show file tree
Hide file tree
Showing 13 changed files with 9 additions and 15 deletions.
2 changes: 1 addition & 1 deletion plugins/applist.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def Plugin_Start(mac_info):
if deserialized_plist:
parse_appList_plist(deserialized_plist, apps, user_name, source_path)
else:
log.error('Could not open file {}'.format(path))
log.error('Could not open file {}'.format(source_path))

if len(apps) > 0:
PrintAll(apps, mac_info.output_params, '')
Expand Down
2 changes: 1 addition & 1 deletion plugins/domains.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def Plugin_Start_Standalone(input_files_list, output_params):
success, plist, error = CommonFunctions.ReadPlist(input_path)
if success:
ProcessActiveDirectoryPlist(input_path, plist)
WriteList('domain details', 'Domain_ActiveDirectory', ad_details, ad_info, mac_info.output_params, input_path)
WriteList('domain details', 'Domain_ActiveDirectory', ad_details, ad_info, output_params, input_path)
else:
log.error("Failed to read plist " + input_path + " Error was: " + error)

Expand Down
2 changes: 1 addition & 1 deletion plugins/helpers/aff4_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def get_sha1_hash(self):

while data:
hasher.update(data)
data = img.read(unit)
data = self.read(unit)
if data:
pos += len(data)
print(f'Read {pos/(1024*1024)} MB, {pos} bytes')
Expand Down
1 change: 1 addition & 0 deletions plugins/helpers/darwin_path_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
# under /var/folders/
#

import struct

def GetDarwinPath(uuid, uid):
'''Returns DARWIN_USER_FOLDER path constructed from UUID and UID for
Expand Down
2 changes: 1 addition & 1 deletion plugins/helpers/hfs_alt.py
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ def getXattrsByPath(self, path):

def getXattrByPath(self, path, name):
file_id = self.getCnidForPath(path)
return self.getXattr(fileID, name)
return self.getXattr(file_id, name)

''' Compression type in Xattr as per apple:
Source: https://opensource.apple.com/source/copyfile/copyfile-138/copyfile.c.auto.html
Expand Down
2 changes: 1 addition & 1 deletion plugins/helpers/spotlight_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ def ParseItem(self, properties, categories, indexes_1, indexes_2):
if len(all_translations) > 2:
log.warning('Encountered more than one control sequence in single translation'
'string.')
log.debug('Found this list: {}', other)
#log.debug('Found this list: {}', other)
value = all_translations[0].decode('utf8', 'backslashreplace')
break # only get first, rest are language variants!
elif prop_type & 0x2 == 0x2: #== 0x4A: # ContentTypeTree ItemUserTags
Expand Down
2 changes: 1 addition & 1 deletion plugins/installhistory.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def ReadInstallHistoryPlist(plist, history):

def ParseInstallHistoryFile(input_file):
history = []
success, plist, error = CommonFunctions.ReadPlist(input_path)
success, plist, error = CommonFunctions.ReadPlist(input_file)
if success:
ReadInstallHistoryPlist(plist, history)
else:
Expand Down
1 change: 0 additions & 1 deletion plugins/networking.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
'''

import binascii
import logging
import os
import re
Expand Down
5 changes: 1 addition & 4 deletions plugins/spotlightshortcuts.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,7 @@
'''

import os
import sys
import logging
import struct

from plugins.helpers.common import CommonFunctions
from plugins.helpers.macinfo import *
Expand Down Expand Up @@ -38,7 +35,7 @@ def PrintAll(shortcut_items, output_params, source_path):
WriteList("spotlight shortcut information", "SpotlightShortcuts", shortcut_items, shortcut_info, output_params, source_path)

def ParseShortcutFile(input_file, shortcuts):
success, plist, error = CommonFunctions.ReadPlist(input_path)
success, plist, error = CommonFunctions.ReadPlist(input_file)
if success:
ReadShortcutPlist(plist, shortcuts, input_file)
else:
Expand Down
2 changes: 1 addition & 1 deletion plugins/sudo_lastrun.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def Plugin_Start_Standalone(input_files_list, output_params):
for input_path in input_files_list:
log.debug("Input file passed was: " + input_path)
## Process the input file here ##
f = open(file_path)
f = open(input_path)
if f:
ProcessTsFile(f, os.path.basename(input_path), input_path, os.path.getsize(input_path), sudo_logs)
f.close()
Expand Down
1 change: 0 additions & 1 deletion plugins/term_sessions.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
'''


import os
import binascii
import logging
from plugins.helpers.macinfo import *
Expand Down
1 change: 0 additions & 1 deletion plugins/users.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
'''

import os
import logging
from plugins.helpers.macinfo import *
from plugins.helpers.writer import *
Expand Down
1 change: 0 additions & 1 deletion plugins/utmpx.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
'''

import os
import sys
import time
from construct import *

Expand Down

0 comments on commit 7e4cbc3

Please sign in to comment.