<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Hello,<div class=""><br class=""></div><div class="">I decided to try once more with a follow-up email, since my previous one got no responses (I hope itโ€™s not considered rude to send more than one message in a row for a particular question).</div><div class=""><br class=""></div><div class="">To sum up and clarify my previous question, what I need is a way to track memory stores and save both the old and the new value of the memory location being modified.</div><div class=""><br class=""></div><div class="">My thinking so far:</div><div class=""><ol class="MailOutline"><li class="">Recognize the instructions that definitely access memory before they execute, based on their opcode.</li><li class="">Tell whether each operand is a register or a memory location.</li><li class="">If itโ€™s a memory location, check whether it is a load or store destination.</li><li class="">In case it is a store destination, fetch and save current value from memory.</li><li class="">Execute instruction.</li><li class="">Fetch and save new value from memory.</li></ol><div class=""><br class=""></div></div><div class="">However, I was not able to find a cross-architecture API that covers all of the conditions above and more specifically <font face="FiraCode-Regular" class=""><span style="font-style: normal;" class="">Instruction::DoesStore()</span></font> and <font face="FiraCode-Regular" class=""><span style="font-style: normal;" class="">Operand::IsStoreDestination()</span></font>.</div><div class=""><br class=""></div><div class="">Last but not least, I should notice that the target is executed in single-step mode, so I do have control right before and after the execution of every instruction.</div><div class=""><br class=""></div><div class="">Thanks, again, in advance! ๐Ÿ™‚</div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">โ€• Vangelis</div><div class=""><br class=""></div><div class=""><div class=""><div><br class=""><blockquote type="cite" class=""><div class="">On 21 Oct 2019, at 08:54, Vangelis Tsiatsianas <<a href="mailto:vangelists@icloud.com" class="">vangelists@icloud.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html; charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Hello,<div class=""><br class=""></div><div class="">I am looking for a way to identify loads, stores and any other kind of instruction that <b class="">definitely</b> perform memory access and extract the address operand(s), however I was not able to find a cross-architecture API. The closest I stumbled upon are "<font face="FiraCode-Regular" class=""><span style="font-style: normal;" class="">MCInstrDesc::mayLoad()</span></font>" and "<font face="FiraCode-Regular" class=""><span style="font-style: normal;" class="">MCInstrDesc::mayStore()</span></font>", but I understand that their results are just a hint, so I would then need to examine the instruction name or opcode in order to find out whether itโ€™s actually a load or store and which operand(s) is (are) memory address(es) and also do so for each architecture separately, which I would really like to avoid.</div><div class=""><br class=""></div><div class="">Is there a way to identify such instructions either by examining them through the disassembler (e.g. "<font face="FiraCode-Regular" class=""><span style="font-style: normal;" class="">DoesLoad()</span></font>" | "<font face="FiraCode-Regular" class=""><span style="font-style: normal;" class="">DoesStore()</span></font>") before they execute or right after they perform any kind of memory access?</div><div class=""><br class=""></div><div class="">Thank you very much, in advance! ๐Ÿ™‚</div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">โ€• Vangelis</div><div class=""><br class=""></div><div class=""><br class=""></div></div></div></blockquote></div><br class=""></div></div></body></html>