I'm trying to find a generic pattern to be able to run a pintool program so it will always give me where is the index
or what is it, and to which value the loop goes to.
For example, here is the assembly of a certain loop:
40c374: 48 8b 55 e8 mov -0x18(%rbp),%rdx
40c378: 8b 45 fc mov -0x4(%rbp),%eax
40c37b: 48 98 cltq
40c37d: 0f b6 84 02 80 00 00 movzbl 0x80(%rdx,%rax,1),%eax
40c384: 00
40c385: 84 c0 test %al,%al
40c387: 74 2a je 40c3b3 <makeMaps_e+0x5b>
40c389: 48 8b 45 e8 mov -0x18(%rbp),%rax
40c38d: 8b 40 7c mov 0x7c(%rax),%eax
40c390: 89 c1 mov %eax,%ecx
40c392: 48 8b 55 e8 mov -0x18(%rbp),%rdx
40c396: 8b 45 fc mov -0x4(%rbp),%eax
40c399: 48 98 cltq
40c39b: 88 8c 02 80 01 00 00 mov %cl,0x180(%rdx,%rax,1)
40c3a2: 48 8b 45 e8 mov -0x18(%rbp),%rax
40c3a6: 8b 40 7c mov 0x7c(%rax),%eax
40c3a9: 8d 50 01 lea 0x1(%rax),%edx
40c3ac: 48 8b 45 e8 mov -0x18(%rbp),%rax
40c3b0: 89 50 7c mov %edx,0x7c(%rax)
40c3b3: 83 45 fc 01 addl $0x1,-0x4(%rbp)
40c3b7: 81 7d fc ff 00 00 00 cmpl $0xff,-0x4(%rbp)
40c3be: 7e b4 jle 40c374 <makeMaps_e+0x1c>
Now I have noticed that the Check CMD
is not always CMP
...
Is there a way of finding out the index
value and total number of iterations?