Skip to content

Commit e37e7aa

Browse files
authored
Update main.c
1 parent f5221f5 commit e37e7aa

File tree

1 file changed

+13
-22
lines changed

1 file changed

+13
-22
lines changed

AutoPatchMain/src/main.c

Lines changed: 13 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1125,7 +1125,7 @@ void test_c1() {
11251125

11261126
int total = 0;
11271127
int total_not_AutoPatch = 0;
1128-
1128+
dwt_init();
11291129
profile_add_event("EV0");
11301130
for (int i = 0; i < 1000; i++)
11311131
{
@@ -1187,7 +1187,7 @@ void test_c5() {
11871187

11881188
int total = 0;
11891189
int total_not_AutoPatch = 0;
1190-
1190+
dwt_init();
11911191
profile_add_event("EV0");
11921192
for (int i = 0; i < 1000; i++)
11931193
{
@@ -1215,15 +1215,15 @@ void test_c2() {
12151215
/*
12161216
zephyr_cve_2020_10021
12171217
*/
1218-
// printf("Start the evaluation process!\n");
1218+
printf("Start the evaluation process!\n");
12191219

12201220
stack_frame sf;
12211221
sf.r0 = 10; // n
12221222
sf.r1 = 1024; // memory_size
12231223
uint64_t ret1 = 0;
12241224
int total = 0;
12251225
int total_not_AutoPatch = 0;
1226-
1226+
dwt_init();
12271227
profile_add_event("EV0");
12281228
for (int i = 0; i < 1000; i++)
12291229
{
@@ -1245,15 +1245,6 @@ void test_c2() {
12451245
int nanoseconds_cve = (int) ((cycles2us(total / 1000) * 1000));
12461246
printf("[cve_2020_10021] AutoPatch overhead cycles: %d , time: %d nanoseconds\n", total, nanoseconds_cve);
12471247

1248-
// uint32_t testcase = 268435456; //Malicious input
1249-
// // uint32_t testcase = 1; //Normal input
1250-
// sf.r0 = testcase;
1251-
// profile_add_event("EV1");
1252-
// profile_start(EV1);
1253-
// ret1 = filter_10062_2(&sf);
1254-
// profile_end(EV1);
1255-
// profile_dump(EV1);
1256-
// printf("Hello, End!\n");
12571248
}
12581249

12591250
void test_c3() {
@@ -1270,7 +1261,7 @@ void test_c3() {
12701261
sf.r0 = 0;
12711262
int total = 0;
12721263
int total_not_AutoPatch = 0;
1273-
1264+
dwt_init();
12741265
profile_add_event("EV0");
12751266
for (int i = 0; i < 1000; i++)
12761267
{
@@ -1348,7 +1339,7 @@ void test_c4(){
13481339

13491340
int total = 0;
13501341
int total_not_AutoPatch = 0;
1351-
1342+
dwt_init();
13521343
profile_add_event("EV0");
13531344
for (int i = 0; i < 1000; i++)
13541345
{
@@ -1421,7 +1412,7 @@ void test_c6() {
14211412

14221413
int total = 0;
14231414
int total_not_AutoPatch = 0;
1424-
1415+
dwt_init();
14251416
profile_add_event("EV0");
14261417
for (int i = 0; i < 1000; i++)
14271418
{
@@ -1462,7 +1453,7 @@ void test_c7() {
14621453

14631454
int total = 0;
14641455
int total_not_AutoPatch = 0;
1465-
1456+
dwt_init();
14661457
profile_add_event("EV0");
14671458
for (int i = 0; i < 1000; i++)
14681459
{
@@ -1523,7 +1514,7 @@ void test_c8() {
15231514

15241515
int total = 0;
15251516
int total_not_AutoPatch = 0;
1526-
1517+
dwt_init();
15271518
profile_add_event("EV0");
15281519
for (int i = 0; i < 1000; i++)
15291520
{
@@ -1568,7 +1559,7 @@ void test_c9() {
15681559

15691560
int total = 0;
15701561
int total_not_AutoPatch = 0;
1571-
1562+
dwt_init();
15721563
profile_add_event("EV0");
15731564
for (int i = 0; i < 1000; i++)
15741565
{
@@ -1624,7 +1615,7 @@ void test_c10() {
16241615

16251616
int total = 0;
16261617
int total_not_AutoPatch = 0;
1627-
1618+
dwt_init();
16281619
profile_add_event("EV0");
16291620
for (int i = 0; i < 1000; i++)
16301621
{
@@ -1679,7 +1670,7 @@ void test_c11() {
16791670

16801671
int total = 0;
16811672
int total_not_AutoPatch = 0;
1682-
1673+
dwt_init();
16831674
profile_add_event("EV0");
16841675
for (int i = 0; i < 1000; i++)
16851676
{
@@ -1739,7 +1730,7 @@ void test_c12() {
17391730

17401731
int total = 0;
17411732
int total_not_AutoPatch = 0;
1742-
1733+
dwt_init();
17431734
profile_add_event("EV0");
17441735
for (int i = 0; i < 1000; i++)
17451736
{

0 commit comments

Comments
 (0)