URL
https://opencores.org/ocsvn/mlite/mlite/trunk
[/] [mlite/] [trunk/] [tools/] [convert.c] - Diff between revs 178 and 191
Go to most recent revision |
Show entire file |
Details |
Blame |
View Log
Rev 178 |
Rev 191 |
Line 1... |
Line 1... |
//convert.c by Steve Rhoads 4/26/01
|
//convert.c by Steve Rhoads 4/26/01
|
//Now uses the ELF format (get gccmips_elf.zip)
|
//Now uses the ELF format (get gccmips_elf.zip)
|
//set $gp and zero .sbss and .bss
|
//set $gp and zero .sbss and .bss
|
//Reads test.exe and creates code.txt
|
//Reads test.axf and creates code.txt
|
#include <stdio.h>
|
#include <stdio.h>
|
#include <stdlib.h>
|
#include <stdlib.h>
|
#include <string.h>
|
#include <string.h>
|
|
|
#define BUF_SIZE (1024*1024*4)
|
#define BUF_SIZE (1024*1024*4)
|
Line 98... |
Line 98... |
ELF_RegInfo *elfRegInfo;
|
ELF_RegInfo *elfRegInfo;
|
Elf32_Shdr *elfSection;
|
Elf32_Shdr *elfSection;
|
(void)argc;
|
(void)argc;
|
(void)argv;
|
(void)argv;
|
|
|
printf("test.exe -> code.txt & test.bin\n");
|
printf("test.axf -> code.txt & test.bin\n");
|
infile = fopen("test.exe", "rb");
|
infile = fopen("test.axf", "rb");
|
if(infile == NULL)
|
if(infile == NULL)
|
{
|
{
|
printf("Can't open test.exe");
|
printf("Can't open test.axf");
|
return 0;
|
return 0;
|
}
|
}
|
buf = (unsigned char *)malloc(BUF_SIZE);
|
buf = (unsigned char *)malloc(BUF_SIZE);
|
size = (int)fread(buf, 1, BUF_SIZE, infile);
|
size = (int)fread(buf, 1, BUF_SIZE, infile);
|
fclose(infile);
|
fclose(infile);
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.