cppファイルにジャンクコードを追加する



Add Junk Code Cpp File



一部のプロジェクトは二次開発であるため、繰り返し肌を変えるプロジェクトとしてiosによってレビューされ、却下される可能性があります。

プログラムの最後にガベージコードを追加すると、出力バイナリファイルが変更される可能性があります。 C ++がいつコンパイルされるか、そのような呼び出されていないメソッドと宣言された変数がコンパイルに追加されるかどうかはよくわかりません。以前に拒否されたプロジェクト、後でこれを使用するメソッドは2回送信されましたが、コードが途中で難読化されました



コードはc#で記述され、vsで新しいコンソールプログラムを直接作成し、使用するクラスを置き換えます。

class Program { //config //Random code block static int _blockCount = 50 //Declare parameters static int _argCount = 100 static void Main(string[] args) { string path = '' while (true) { Console.WriteLine('input the cpp file path:') path = Console.ReadLine() path = path.Trim() if(path.Length == 0) { continue } List files = GetFilesInDic(path) int count = 0 foreach (FileInfo file in files) { if (file.Extension == '.cpp') { Console.WriteLine('Write:' + file.FullName) StreamWriter sw = new StreamWriter(file.FullName, true) string writeStr = GetMethodAllStr() sw.WriteLine(writeStr) sw.Close() count += writeStr.Length } } Console.WriteLine('Complete! ' + 'Total write:' + count.ToString() + 'word') } } static List GetFilesInDic(string path) { List list = new List() DirectoryInfo root = new DirectoryInfo(path) FileInfo[] files = root.GetFiles() DirectoryInfo[] dics = root.GetDirectories() list.AddRange(files) foreach(DirectoryInfo info in dics) { list.AddRange(GetFilesInDic(info.FullName)) } return list } static string lineStr = ' ' static string specialStr = '_' static Random rd = new Random() static List strList = new List() { 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z' } static List argTypeList = new List() { 'float' , 'int' ,'string' } static List blockMethod = new List() { 'if(!true){}', 'if(!false){}', 'if(true){}', 'if(false){}' } static string GetMethodAllStr() { string randomType = GetRandomType() string str = randomType + ' ' //Method name str += GetName() //Method parameters str += '(' + GetRandomType() + ' ' + GetName() + ' )' + lineStr str += '{' + lineStr //Get random code block str += GetRandomBlock(GetRandomNum(_blockCount)) //Define random variables List namelist = new List() string argContent = '' int argCount = GetRandomNum(_argCount) for (int i = 0 i

出力コード:



Giteeの住所