Luna/apps/src/sym.c

35 lines
511 B
C
Raw Normal View History

2022-10-12 16:04:27 +00:00
#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;
}