-
-
[旧帖]
[讨论]哈哈 大家觉得这样异或怎么样
0.00雪花
-
发表于:
2010-10-2 22:07
1239
-
[旧帖] [讨论]哈哈 大家觉得这样异或怎么样
0.00雪花
#include <iostream>
#include <ctime>
#include <cstdlib>
#include <assert.h>
const int M=100;
class somes{
private:
inline int randnum()
{
return rand()%99999+1;
}
inline void randnumInit()
{
srand((unsigned int)time(0));
}
char* Conversion(char* s1,char* s2,int n);
char Mi[M];
public:
somes(char* s);
~somes()
{}
inline char* returnMi()
{
//std::cout << "Mi:len " << strlen(Mi) << std::endl;
//std::cout << "Mi:sizeof " << sizeof(Mi) << std::endl;
return Mi;
}
};
somes::somes(char* s)
{
memset(Mi,0,sizeof(char)*M);
randnumInit();
assert(Conversion(Mi,s,randnum()));
}
char* somes::Conversion(char *s1, char *s2, int n)
{
int i=0;
while (*s2!='\0')
{
s1[i]=*s2^n;
++i;
++s2;
}
s1[i]='\0';
return s1;
}
[招生]科锐逆向工程师培训(2024年11月15日实地,远程教学同时开班, 第51期)