Monday, August 7, 2017

More improvements to the P/Invoke tool

Though I can't bring to mind a specific Windows API task that requires it, it might occasionally be necessary to dereference a received pointer multiple times. The current slot functionality provides for one automatic wrapping and unwrapping, but there was previously no way to manually take a pointer stored in a slot and put the data there into another slot. So today, I extended the copyslot command to add a dereferenced mode that interprets the source slot's value as a pointer and returns the data there.

newslot block somePtr = blockptr(int 8); 
newslot int target; 
copyslot target = somePtr dereferenced; 
readslot target

As expected, that produces 8.

I also adjusted the parser a bit to not crash unnecessarily when a line is blank.

No comments:

Post a Comment