|
|
|
[求助]我的向pe文件注入一个section,这个节里面添加一个加壳的dll 文件格式可以被exescope正确打开但是不能运行提示不正确的win32格式
sessiondiy ================================ 留个qq交流一下 |
|
[求助]我的向pe文件注入一个section,这个节里面添加一个加壳的dll 文件格式可以被exescope正确打开但是不能运行提示不正确的win32格式
sessiondiy ================================ 借你的网盘一用 我上传exe上去 源代码也上去 |
|
[求助]我的向pe文件注入一个section,这个节里面添加一个加壳的dll 文件格式可以被exescope正确打开但是不能运行提示不正确的win32格式
sessiondiy ================================ 只要看第一帖 下面的都是辅助工具 主要看第一个函数 是流程 |
|
|
|
|
|
[求助]我的向pe文件注入一个section,这个节里面添加一个加壳的dll 文件格式可以被exescope正确打开但是不能运行提示不正确的win32格式
exe scope可以正确打开 因此 资源也能正确访问 因此我怀疑是可以是nt header的那个变量没有调整过来 //调导入表的信息 SelfFileInt(exefil,(char*)&pi_data_dir_import->Size-pmemHandle,sizeof(IMAGE_IMPORT_DESCRIPTOR)); WriteFileInt(exefil,(char*)&(pi_data_dir_import->VirtualAddress)-pmemHandle,NewSection.VirtualAddress); //WriteFileInt(exefil,(char*)&pi_data_dir_import->Size-pmemHandle,desi+1); //调整文件大小 SelfFileInt(exefil,(char*)&pi_nt_header->OptionalHeader.SizeOfImage-pmemHandle,SECTION_ALIG+aligSize(olddwFileSize,0x1000)); //调整段数目 SelfFileInt(exefil,(char*)&pi_nt_header->FileHeader.NumberOfSections-pmemHandle,1); WriteFileInt(exefil,(char*)&pi_nt_header->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_BOUND_IMPORT].VirtualAddress-pmemHandle,0); WriteFileInt(exefil,(char*)&pi_nt_header->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_BOUND_IMPORT].Size-pmemHandle,0); |
|
[求助]我的向pe文件注入一个section,这个节里面添加一个加壳的dll 文件格式可以被exescope正确打开但是不能运行提示不正确的win32格式
unsigned long LoadPEFile(const char *FileName, char **Buffer) { FILE *fp = fopen(FileName, "rb"); fseek(fp, 0, SEEK_END); unsigned long len = ftell(fp); fseek(fp, 0, SEEK_SET); char* bbuff = new char[len + 4]; char*plog=bbuff; *Buffer=bbuff; //memset(*Buffer, 0x0, len + 4); unsigned long i = 0; int ret=0; while(i < len) { ret=fread(bbuff , 1, len-i, fp); i+=ret; bbuff+=ret; } fclose(fp); return len; } void InsertFile(const char* file,int offset,char* data,char size) { FILE *fp = fopen(file, "r+b"); fseek(fp, 0, SEEK_END); long i = 0; long len = ftell(fp); if(offset==-1){ fwrite(data,1,size,fp); }else if(offset>len){ char fillc=0; for(i=0;i<offset-len;i++){ fwrite(&fillc,1,1,fp); } fwrite(data,1,size,fp); } else{ fseek(fp, offset, SEEK_SET); char*pBuffer = new char[len -offset+ 4]; // memset(pBuffer, 0x0, len + 4); while(i < len -offset) { fread(pBuffer + i, 4, 1, fp); i+=4; } //fclose(fp); fseek(fp, offset, SEEK_SET); int ret; ret=fwrite(data,1,size,fp); ret=GetLastError(); ret=fwrite(pBuffer,1,len -offset,fp); } fflush(fp); fclose(fp); } int InsertFileLoop(const char*exefil,int offset1,char* buf,int buffsize,int loops) { int i; for(i=0;i<loops;i++){ InsertFile(exefil,offset1+i*buffsize,buf,buffsize); } return 0; } void InsertFileEnd(const char* file,char* data,char size) { InsertFile(file,-1,data, size); } int InsertFileEndLoop(const char*exefil,char* buf,int buffsize,int loops) { int i; for(i=0;i<loops;i++){ InsertFileEnd(exefil,buf,buffsize); } return 0; } int InsertFileEnd2(const char* exefil,char* zero,int dw,int times) { int i; for(i=0;i<times;i++){ InsertFileEnd(exefil,zero,dw); } return 0; } //void WriteFileBuffer(char* file,int offset,char* data,char* size) //{ // FILE *fp = fopen(file, "rwb"); // fseek(fp, offset, SEEK_SET); // fwrite(data,size,1,fp); // fclose(fp); //} int ReadFileInt(const char* file,int offset); void ReadFileBuffer(const char* file,int offset,char*p,int len) { FILE *fp = fopen(file, "r+b"); int v; fseek(fp, offset, SEEK_SET); int ret=fread(p,1,len,fp); fclose(fp); return ; } void WriteFileBuffer(const char* file,int offset,char*dat,int len) { FILE *fp = fopen(file, "r+b"); fseek(fp, offset, SEEK_SET); fwrite(dat,1,len,fp); fflush(fp); fclose(fp); char *p=new char[len]; ReadFileBuffer(file,offset,p,len); if(memcmp(dat,p,len)){ ::MessageBox(0,0,"WriteFileInt",0); } delete p; } void WriteFileInt(const char* file,int offset,int v) { FILE *fp = fopen(file, "r+b"); fseek(fp, offset, SEEK_SET); fwrite(&v,1,sizeof(v),fp); fflush(fp); fclose(fp); int k=ReadFileInt(file,offset); if(v!=k){ v=v; ::MessageBox(0,0,"WriteFileInt",0); } } void WriteFileChar(const char* file,int offset,char v) { FILE *fp = fopen(file, "r+b"); fseek(fp, offset, SEEK_SET); fwrite(&v,1,sizeof(v),fp); fflush(fp); fclose(fp); } void WriteFileShort(const char* file,int offset,short v) { FILE *fp = fopen(file, "r+b"); fseek(fp, offset, SEEK_SET); fwrite(&v,1,sizeof(v),fp); fflush(fp); fclose(fp); } int ReadFileInt(const char* file,int offset) { FILE *fp = fopen(file, "r+b"); int v; fseek(fp, offset, SEEK_SET); int ret=fread(&v,1,sizeof(v),fp); fclose(fp); return v; } char ReadFileChar(const char* file,int offset) { FILE *fp = fopen(file, "r+b"); fseek(fp, offset, SEEK_SET); char v; fread(&v,1,sizeof(v),fp); fclose(fp); return v; } short ReadFileShort(const char* file,int offset) { FILE *fp = fopen(file, "r+b"); fseek(fp, offset, SEEK_SET); short v; fread(&v,1,sizeof(v),fp); fclose(fp); return v; } void SelfFileInt(const char* file,int offset,int sec) { int v=ReadFileInt(file,offset); v+=sec; WriteFileInt(file,offset,v); } void SelfFileShort(const char* file,int offset,short sec) { short v=ReadFileShort(file,offset); v+=sec; WriteFileShort(file,offset,v); } void SelfFileChar(const char* file,int offset,char sec) { char v=ReadFileChar(file,offset); v+=sec; WriteFileChar(file,offset,v); } |
操作理由
RANk
{{ user_info.golds == '' ? 0 : user_info.golds }}
雪币
{{ experience }}
课程经验
{{ score }}
学习收益
{{study_duration_fmt}}
学习时长
基本信息
荣誉称号:
{{ honorary_title }}
能力排名:
No.{{ rank_num }}
等 级:
LV{{ rank_lv-100 }}
活跃值:
在线值:
浏览人数:{{ visits }}
最近活跃:{{ last_active_time }}
注册时间:{{ user_info.create_date_jsonfmt }}
勋章
兑换勋章
证书
证书查询 >
能力值