Skip to content

Conversation

@AndrewJLockhart
Copy link

@AndrewJLockhart AndrewJLockhart commented Feb 9, 2024

Closes #838


if check == 0x0016:
# REFERENCENAME
REFERENCENAME = "REFERENCENAME"
Copy link
Author

@AndrewJLockhart AndrewJLockhart Feb 9, 2024

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?

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)))
Copy link
Author

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

unused = referenceproject_id
unused = referenceproject_size
unused = referenceproject_libidabsolute
unused = referenceproject_libidrelative
Copy link
Author

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.

Copy link
Author

@AndrewJLockhart AndrewJLockhart left a 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.

@AndrewJLockhart AndrewJLockhart changed the title Initial version for feedback on approach Expose References via VBA Parser object Feb 9, 2024
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)))
Copy link
Author

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

@decalage2 decalage2 self-requested a review February 12, 2024 15:16
@decalage2 decalage2 self-assigned this Feb 12, 2024
@decalage2 decalage2 added this to the Next Release milestone Feb 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make VBA Tools->References Information available

2 participants