写个游戏修改器

Kuye2002yx 2002-10-09 11:04:55
请给一段代码:
其实很简单:
以 2进制读取某个文件中的内容,然后写入另一个文件的指定地址。
读取 File1 后,将 File1 的内容依次写入 File2 的 0be120 及其后面的地址里里,该怎么做呢?

希望 下午可以结帖
...全文
110 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
szbug 2002-10-09
  • 打赏
  • 举报
回复
参考这一段:
int iFileHandle;
int iFileSeek;
int iFileWrite;
short Buf[]={0x568B, 0xEB78, 0x3412};
iFileHandle = FileOpen("c:\\abc.exe", fmOpenReadWrite);
if ( iFileHandle == -1 )
{
iFileHandle = FileOpen("c:\\123\\abc.exe", fmOpenReadWrite);
if ( iFileHandle == -1 )
{
ShowMessage("没有找到!!!");
}
}
iFileSeek = FileSeek(iFileHandle, 0x230, 0);
iFileWrite = FileWrite(iFileHandle, Buf, sizeof(Buf));
FileClose(iFileHandl);
blue_coco 2002-10-09
  • 打赏
  • 举报
回复

char b;
FILE *fin, *fout;

if (NULL == (fout = fopen("File1", "r")))
{
printf("open fail");
return;
}

if (NULL == (fin = fopen("File2", "w")))
{
printf("open fail");
fclose(fout);
return;
}

fseek(fin, 0x0be120, SEEK_CUR);

do
{
fread(&b, sizeof(char), 1, fout);
fwrite(&b, sizeof(char), 1, fin);
}while(!feof(fout))

fclose(fin);
fclose(fout);
blh 2002-10-09
  • 打赏
  • 举报
回复
file1 = fopen(File1, "rb");
file2 = fopen(File2, "ab");
fread(buf, 1, size, file1);
fseek(file2, 0be120, 0);
fwrite(buf, 1, size, file2);

69,373

社区成员

发帖
与我相关
我的任务
社区描述
C语言相关问题讨论
社区管理员
  • C语言
  • 花神庙码农
  • 架构师李肯
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧