begin work on parsing library

This commit is contained in:
Emile Clark-Boman 2025-09-27 13:29:54 +10:00
parent 607cac9b42
commit 76a2390861
2 changed files with 30 additions and 0 deletions

21
parsebin/file.c Normal file
View file

@ -0,0 +1,21 @@
#define _USE_GNU
#include <sys/types.h>
#include <sys/stat.h>
#ifndef WIN32
# include <unistd.h>
#else
# define stat _stat
#endif
// ssize_t abspath(const char *restrict path, char *restrict buf)
int get_mod_time(const char *restrict path, struct timespec *restrict mtime) {
struct stat result;
if(stat(path, &result) == -1)
return ERR;
*mtime = result.st_mtime;
return OK;
}

9
parsebin/pe/README.md Normal file
View file

@ -0,0 +1,9 @@
# Portable Executable (PE)
## References
1. https://en.wikipedia.org/wiki/Portable_Executable
2. https://en.wikipedia.org/wiki/.exe
3. https://en.wikipedia.org/wiki/DOS_MZ_executable
4. https://learn.microsoft.com/en-us/windows/win32/debug/pe-format
5. https://web.archive.org/web/20180711022043/https://msdn.microsoft.com/en-us/magazine/bb985992.aspx