Skip to content

Instantly share code, notes, and snippets.

@OsandaMalith
Last active Jun 14, 2016
Embed
What would you like to do?
Solution 1 for hasharazade's birthday crackme :)
#include "stdafx.h"
#include <string>
#include <iostream>
#include <fstream>
/*
* Author : Osanda Malith Jayathissa (@OsandaMalith)
*/
using namespace std;
int valid( char *str) {
char String[100];
strcpy_s(String, str);
unsigned int var;
_asm {
lea esi, [String]
xor eax, eax
mov[var], eax
mov ebx, 0
mov ecx, 4
_loop:
test ecx, ecx
jz _finish
xor byte ptr[var + 1], ah
lodsw
dec ecx
add[var], eax
jmp _loop
_finish :
}
return var;
}
int main(int argc, char const *argv[]) {
string line;
ifstream myfile("my1.txt");
if (myfile.is_open())
{
while (getline(myfile, line))
if (valid((char *)line.c_str()) == 0x39a)
cout << line.c_str() << endl;
myfile.close();
}
else cout << "Unable to open file";
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment