-
Notifications
You must be signed in to change notification settings - Fork 0
/
exploitLLR.cc
41 lines (36 loc) · 1.25 KB
/
exploitLLR.cc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#include <list>
#include <string>
#include <vector>
#include <iostream>
#include <fstream>
#include <time.h>
#include <stdlib.h>
#define basemax 50
#define sizek 25
// code base
// explores a lresu file
// sends the found PRPs to cerr and the other ones to sout
using namespace std;
using sint=long unsigned int; // std::vector<std::__cxx11::basic_string<char> >::size_type;
ifstream lresu;
int main(int argc, char *argv[])
{string l,p,exp,ms,prefms,s1,s2; sint i,j; char ss;
ms=argv[1];
prefms="lresu"+ms+"00.txt";lresu.open(prefms.c_str());p="";
while(getline(lresu,l))
{for(i=0;i<l.length();i++)if(l.substr(i,5)==":ABC ")
{cout<<p;p=l.substr(0,i)+"\n";break;}
for(i=0;i<l.length();i++)if((l.substr(i,14)=="Frobenius PRP!")||(l.substr(i,9)=="is prime!"))
{for(j=0;j<l.length();j++)if(l[j]=='^')
{exp="^";for(j=j+1;j<l.length();j++)if(l[j]=='+'||l[j]=='-')break;else exp+=l[j];
for(j=0;j<p.length();j++)if(p[j]=='}')
{l=p.substr(0,j)+exp+p.substr(j,p.length());
for(i=0;i<l.length();i++)if(l[i]=='{')l[i]='(';else if(l[i]=='}')l[i]=')';
cerr<<l;
}
p="";break;
}
}
}
cout<<p;
} // end main