-
Notifications
You must be signed in to change notification settings - Fork 567
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Expose References via VBA Parser object #839
base: master
Are you sure you want to change the base?
Conversation
@@ -1858,12 +1860,12 @@ def __init__(self, ole, vba_root, project_path, dir_path, relaxed=True): | |||
break | |||
|
|||
if check == 0x0016: | |||
# REFERENCENAME | |||
REFERENCENAME = "REFERENCENAME" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed the comments to constants because further down I didn't want to duplicate a string. But does have the side effect of changing the log output slightly. Is this OK?
# Specifies a reference to an Automation type library. | ||
referenceregistered_id = check | ||
referenceregistered_size = struct.unpack("<L", dir_stream.read(4))[0] | ||
referenceregistered_sizeof_libid = struct.unpack("<L", dir_stream.read(4))[0] | ||
referenceregistered_libid = dir_stream.read(referenceregistered_sizeof_libid) | ||
log.debug('REFERENCE registered lib id: %s' % unicode2str(self.decode_bytes(referenceregistered_libid))) | ||
referenceregistered_libid = unicode2str(self.decode_bytes(dir_stream.read(referenceregistered_sizeof_libid))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only wanted to call the decode once. Result is used in the log and also sent to the references list
referenceproject_majorversion = struct.unpack("<L", dir_stream.read(4))[0] | ||
referenceproject_minorversion = struct.unpack("<H", dir_stream.read(2))[0] | ||
unused = referenceproject_id | ||
unused = referenceproject_size | ||
unused = referenceproject_libidabsolute | ||
unused = referenceproject_libidrelative |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, I think I need to leave the assignment unused = referenceproject_libidrelative because it isn't being used anywhere else.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Appreciate comments on approach before I go further and add test cases.
# Specifies a reference to a twiddled type library and its extended type library. | ||
referencecontrol_id = check | ||
referencecontrol_sizetwiddled = struct.unpack("<L", dir_stream.read(4))[0] # ignore | ||
referencecontrol_sizeof_libidtwiddled = struct.unpack("<L", dir_stream.read(4))[0] | ||
referencecontrol_libidtwiddled = dir_stream.read(referencecontrol_sizeof_libidtwiddled) | ||
log.debug('REFERENCE control twiddled lib id: %s' % unicode2str(self.decode_bytes(referencecontrol_libidtwiddled))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still can't find an example of a twiddled library
Closes #838