<html>
<head>
</head>
<body class='hmmessage'><div dir='ltr'>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style>
<div dir="ltr"><p style="margin-bottom: 1em; border: 0px; font-size: 15px; clear: both; color: rgb(34, 36, 38); font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; line-height: 19.5px; background-color: rgb(255, 255, 255);">Hi,</p><p style="margin-bottom: 1em; border: 0px; font-size: 15px; clear: both; color: rgb(34, 36, 38); font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; line-height: 19.5px; background-color: rgb(255, 255, 255);"><br></p><p style="margin-bottom: 1em; border: 0px; font-size: 15px; clear: both; color: rgb(34, 36, 38); font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; line-height: 19.5px; background-color: rgb(255, 255, 255);">I want to use LLVM to make a dynamic fault injection. My primary goal is to modify the value of a particular register in a particular instruction and do, for example, bit flipping on that register.</p><p style="margin-bottom: 1em; border: 0px; font-size: 15px; clear: both; color: rgb(34, 36, 38); font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; line-height: 19.5px; background-color: rgb(255, 255, 255);"><br></p><p style="margin-bottom: 1em; border: 0px; font-size: 15px; clear: both; color: rgb(34, 36, 38); font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; line-height: 19.5px; background-color: rgb(255, 255, 255);">I've studying some tutorials and codes about LLVM but I'm still not sure how to begin with. I know that I need to program a LLVM pass that iterates over blocks and check which instruction modify to later check which operand in that instruction modify. Is that the correct?</p><p style="margin-bottom: 1em; border: 0px; font-size: 15px; clear: both; color: rgb(34, 36, 38); font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; line-height: 19.5px; background-color: rgb(255, 255, 255);"><br></p><p style="margin-bottom: 1em; border: 0px; font-size: 15px; clear: both; color: rgb(34, 36, 38); font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; line-height: 19.5px; background-color: rgb(255, 255, 255);">I've seen some examples but all of them seem very complicated (a lot of code) to understand for a beginner like me. I wonder if there is an easier example to understand or if you can provide me with one to start with.</p><p style="margin-bottom: 1em; border: 0px; font-size: 15px; clear: both; color: rgb(34, 36, 38); font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; line-height: 19.5px; background-color: rgb(255, 255, 255);"><br></p><p style="margin-bottom: 1em; border: 0px; font-size: 15px; clear: both; color: rgb(34, 36, 38); font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; line-height: 19.5px; background-color: rgb(255, 255, 255);">Thank you very much for your help!</p><p style="margin-bottom: 1em; border: 0px; font-size: 15px; clear: both; color: rgb(34, 36, 38); font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; line-height: 19.5px; background-color: rgb(255, 255, 255);"><br></p><p style="margin-bottom: 1em; border: 0px; font-size: 15px; clear: both; color: rgb(34, 36, 38); font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; line-height: 19.5px; background-color: rgb(255, 255, 255);">Best,</p><p style="margin-bottom: 1em; border: 0px; font-size: 15px; clear: both; color: rgb(34, 36, 38); font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; line-height: 19.5px; background-color: rgb(255, 255, 255);"><br></p><p style="margin-bottom: 1em; border: 0px; font-size: 15px; clear: both; color: rgb(34, 36, 38); font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; line-height: 19.5px; background-color: rgb(255, 255, 255);">Examples that I haven't understood:</p><p style="margin-bottom: 1em; border: 0px; font-size: 15px; clear: both; color: rgb(34, 36, 38); font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; line-height: 19.5px; background-color: rgb(255, 255, 255);"><a href="https://github.com/aperson40/FlipIt/blob/master/src/pass/faults.cpp" target="_blank">https://github.com/aperson40/FlipIt/blob/master/src/pass/faults.cpp</a></p><p style="margin-bottom: 1em; border: 0px; font-size: 15px; clear: both; color: rgb(34, 36, 38); font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; line-height: 19.5px; background-color: rgb(255, 255, 255);"><a href="https://github.com/uswick/sight/blob/bd07a3c8592cf073366c76961479f25be1f8d83d/widgets/kulfi/faultInj/faults.cpp" target="_blank">https://github.com/uswick/sight/blob/bd07a3c8592cf073366c76961479f25be1f8d83d/widgets/kulfi/faultInj/faults.cpp</a></p></div>
</div></body>
</html>