Re: why my program segmentation fault?
Quoting Star Liu <email@example.com>:
I wrote a program to copy the memory content of FFFF0000-FFFFFFFF to a
file, but it says "Segmentation fault", (i use AMD64 lenny, so the
address is long), how could i fix it? thanks!
you should only fclose() if Memory != NULL, so your function would be
better off like this:
void CopyMemoryToFile(char* FilePath, long StartAddress, long OffSet)
Memory=fopen (FilePath, "w");
fwrite(Start, 1, OffSet, Memory);