Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Adding support for FileStructure exploitation #1218
This is in reference to #1217.
The functioning of this class is similar to srop.py. One has to create an object of this class and then assign member variables, similar to the C fashion. The python class basically emulate's the C
The python file itself contains a full documentation. Please refer here for a detailed overview of the features.
Overall this looks good, and most of the heavy lifting is done! Cool stuff!
I've added some comments about convention (
If you can clean this up a bit, we can get this merged!
Are the fields not enumerable before runtime? Keeping a list of fields we care about, and using getattr() would be equivalent.
On Wed, Oct 31, 2018 at 4:43 PM Vignesh S Rao ***@***.***> wrote: ***@***.**** commented on this pull request. ------------------------------ In pwnlib/FilePointer.py <#1218 (comment)>: > + return '' + structure='' + for val in self.vars_: + if isinstance(self[val],str): + if self.arch=='i386': + structure+=self[val].ljust(4,'\x00') + else: + structure+=self[val].ljust(8,'\x00') + else: + structure+=packit(self[val],self.length[val]) + if val==v: + break + return structure[:len(structure)-1] + + def write(self,addr=0,size=0): + self['flags'] &=~8 While setting the default data we update the dict. Also, the str and struntil functions involve checking the type of the value of each key, while iterating through the list of fields. I am not quite sure how we can iterate through the list of fields while checking the type of the value they hold if all the fields are set as independent class attributes. — You are receiving this because you commented. Reply to this email directly, view it on GitHub <#1218 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AAG0GAlwtDOGADs-GTL3WJdZR8iOIl7Bks5uqhmMgaJpZM4X9lfL> .
-- *Zach Riggle*