Change the way of printing logs:
The API calls were not printed in the right order. This commit introduces a string that we fill for each API call so we can return all the information at once.
Outputing arguments in wide strings format still needs to be implemented. For now, only the address is printed.
As you can see in the picture bellow, I had problems in the way the tool prints logs.
I wrote something to correct it and it seems to work for the API calls' names.
As I do not need the information about the arguments, I did not test whether or not they are well printed.
I'm not used to code in C++ so this commit may not follow the good practices. I thought you might be interested anyway.
Thank you for your commit! :) I believe it is a usefull feature but I see that it is not passing build tests. We first need to make sure that the pull request is not breaking anything to move forward.
Hi,
I can't manage to make my code pass the 4th windows test. Do you have an idea why it fails?
I think the problem is this difference between correct and incorrect log printing: Before it was
4: ~~1412~~ MSVCR120.dll!printf
4: arg 0: done
4: (type=char*, size=0x0)
after
4: ~~2952~~ MSVCR120.dll!printf
4: arg 0: done (type=char*, size=0x0)
You can just change expected output regex in the test to reflect the new way of printing. It is here
https://github.com/mxmssh/drltrace/blob/94dc91107dcf10a99a715947494f38c6de11e6b0/drltrace_src/CMakeLists.txt#L465
You need to remove \n after done.
I think the problem is this difference between correct and incorrect log printing: Before it was
4: ~~1412~~ MSVCR120.dll!printf 4: arg 0: done 4: (type=char*, size=0x0)after
4: ~~2952~~ MSVCR120.dll!printf 4: arg 0: done (type=char*, size=0x0)You can just change expected output regex in the test to reflect the new way of printing. It is here
https://github.com/mxmssh/drltrace/blob/94dc91107dcf10a99a715947494f38c6de11e6b0/drltrace_src/CMakeLists.txt#L465
You need to remove
\nafter done.
Ok that was indeed the problem. I changed the code to stick to the tests.
I still have to do some modifications as I have warning during the build. Then, it should be good to be reviewed.
Ok, ping me whenever you are ready for review with this :)
The warnings are due to the usage of %x instead of %p to print pointers. It may behave differently on some systems. Do you know how to fix this warnings properly and keep the same behavior?
I tried to use the PFX and PIFX but it does not output the same string with snprintf() than with dr_fprintf().