Skip to content

Commit

Permalink
12/04/2024 16:13:34:211
Browse files Browse the repository at this point in the history
  • Loading branch information
invalid committed Dec 4, 2024
1 parent 543fed8 commit eb2e3dc
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,17 +138,20 @@ set /O2 on

#### vm sample and x-full sample
```c++
__attribute((__annotate__(("x-vm,x-full,x-cfg")))) void crypt_func1(uint8_t *var,uint8_t*key,size_t var_size,size_t key_size){
[[clang::annotate("x-vm,x-full,x-cfg")]]
void crypt_func1(uint8_t *var,uint8_t*key,size_t var_size,size_t key_size){
for(auto i=0;i<var_size;i++){
var[i]^=key[i%key_size];
}
}
[[clang::annotate("x-cfg,ind-br,alias-access")]]
__attribute((__annotate__(("x-cfg,ind-br,alias-access")))) void crypt_func2(uint8_t *var,uint8_t*key,size_t var_size,size_t key_size){
for(auto i=0;i<var_size;i++){
var[i]^=key[i%key_size];
}
}
__attribute((__annotate__(("x-cfg,x-vm,ind-br,alias-access")))) void crypt_func3(uint8_t *var,uint8_t*key,size_t var_size,size_t key_size){
[[clang::annotate("x-cfg,x-vm,ind-br,alias-access")]]
void crypt_func3(uint8_t *var,uint8_t*key,size_t var_size,size_t key_size){
for(auto i=0;i<var_size;i++){
var[i]^=key[i%key_size];
}
Expand All @@ -159,15 +162,16 @@ __attribute((__annotate__(("x-cfg,x-vm,ind-br,alias-access")))) void crypt_func3
#### combine sample
```c++
__attribute((__annotate__(("combine_func[tag1]")))) int a1(int a, int b)
[[clang::annotate("combine_func[tag1]")]]
int a1(int a, int b)
{
printf("%d , %d\r\n", a, b);
printf("%x\r\n", a ^ b);
return a + b;
}
__attribute((__annotate__(("combine_func[tag1]")))) int a2(int a, int b)
[[clang::annotate("combine_func[tag1]")]]
int a2(int a, int b)
{
std::cout << "hello1" << std::endl;
for (auto i = std::min(a, b);i < std::max(a, b);i++)
Expand All @@ -179,8 +183,8 @@ __attribute((__annotate__(("combine_func[tag1]")))) int a2(int a, int b)
return a * b+ a1(a, b);
}
__attribute((__annotate__(("combine_func[tag2]")))) int a3(int a,int b)
[[clang::annotate("combine_func[tag2]")]]
int a3(int a,int b)
{
printf("%d , %d\r\n", a+1, b+2);
printf("%x\r\n", a ^ b);
Expand Down

0 comments on commit eb2e3dc

Please sign in to comment.