35 lines
511 B
C
35 lines
511 B
C
|
#include <stdio.h>
|
||
|
#include <string.h>
|
||
|
|
||
|
int main()
|
||
|
{
|
||
|
FILE* syms = fopen("/sys/moon.sym", "r");
|
||
|
if (!syms)
|
||
|
{
|
||
|
perror("fopen");
|
||
|
return 1;
|
||
|
}
|
||
|
|
||
|
char buf[1025];
|
||
|
|
||
|
if (fseek(syms, 8000, SEEK_SET) < 0)
|
||
|
{
|
||
|
perror("fseek");
|
||
|
return 1;
|
||
|
}
|
||
|
|
||
|
size_t nread = fread(buf, 1024, 1, syms);
|
||
|
if (ferror(syms))
|
||
|
{
|
||
|
perror("fread");
|
||
|
return 1;
|
||
|
}
|
||
|
|
||
|
buf[nread] = 0;
|
||
|
|
||
|
printf("%s\n", strchr(buf, '\n') + 1);
|
||
|
|
||
|
fclose(syms);
|
||
|
|
||
|
return 0;
|
||
|
}
|