I want to figure out which instructions are executed differently when a command-line flag is passed to a program on Windows, of which I have the compiled (and optimized) binary, with no debug symbols or anything of the sort. I know the difference will not be more than a handful of instructions.
How would I go about figuring this out? Are there any techniques for logging exactly which instructions a program executes over a certain period of time?
(Note that this does not involve any system calls, just a flag being set in a loop because of the command-line flag.)