Added file check to icon changing.
This commit is contained in:
parent
3d44b1f071
commit
6eb2006269
1 changed files with 4 additions and 0 deletions
4
pe.py
4
pe.py
|
|
@ -1222,10 +1222,14 @@ class PEFile(Printable):
|
||||||
of the file, but that did not work. Comments were left as history
|
of the file, but that did not work. Comments were left as history
|
||||||
to what I attempted.
|
to what I attempted.
|
||||||
"""
|
"""
|
||||||
|
icon_path = os.path.expanduser(icon_path)
|
||||||
|
|
||||||
if pm is None:
|
if pm is None:
|
||||||
raise Exception('PythonMagick is required to run this function.')
|
raise Exception('PythonMagick is required to run this function.')
|
||||||
|
|
||||||
|
if not os.path.exists(icon_path):
|
||||||
|
raise Exception('Icon {} does not exist'.format(icon_path))
|
||||||
|
|
||||||
resource_section = self.sections['.rsrc']
|
resource_section = self.sections['.rsrc']
|
||||||
|
|
||||||
g_icon_dir = self.get_directory_by_type(ResourceTypes.Group_Icon)
|
g_icon_dir = self.get_directory_by_type(ResourceTypes.Group_Icon)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue