HGGitLab

Commit e3c9d1f8 authored by luoliangyi's avatar luoliangyi

在mips64上编译

parent 5f9864ac
......@@ -46,20 +46,41 @@ static void list_files(const char *dir_path)
if (NULL != strstr(newPath, ".o"))
{
FILE *file = fopen(newPath, "wb");
unsigned char *data = NULL;
int size = 0;
FILE *file = fopen(newPath, "rb");
if (NULL != file)
{
printf("handle %s\n", newPath);
fseek(file, 48, SEEK_SET);
fseek(file, 0, SEEK_END);
size = ftell(file);
fseek(file, 0, SEEK_SET);
unsigned char data[4] = {0x07, 0x00, 0x00, 0x80};
fwrite(data, 1, 4, file);
if (size > 0)
{
data = new unsigned char [size];
fread(data, 1, size, file);
data[48] = 0x07;
data[49] = 0x00;
data[50] = 0x00;
data[51] = 0x80;
}
fclose(file);
}
else
file = fopen(newPath, "wb");
if (NULL != file)
{
fseek(file, 0, SEEK_SET);
fwrite(data, 1, size, file);
fclose(file);
}
if (NULL != data)
{
printf("open file %s failed\n", newPath);
delete [] data;
data = NULL;
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment