2011-04-30 00:57:30 +00:00
|
|
|
|
|
|
|
#define SYSOPT_PARSABLE 0x1
|
|
|
|
|
|
|
|
#include "hmt.h"
|
|
|
|
|
|
|
|
extern int debug;
|
|
|
|
extern const char *version;
|
|
|
|
extern unsigned long sysopts;
|
|
|
|
|
2019-03-07 21:28:24 +00:00
|
|
|
uint16_t read_uint16(uint8_t *, int);
|
|
|
|
uint32_t read_uint32(uint8_t *, int);
|
|
|
|
void write_uint32(uint8_t *, uint32_t);
|
|
|
|
void write_uint16(uint8_t *, uint16_t);
|
2011-04-30 00:57:30 +00:00
|
|
|
|
|
|
|
void hexdump(uint8_t *, uint32_t, uint32_t);
|
|
|
|
|
|
|
|
struct hmt *open_file(char *, int);
|
|
|
|
void close_file(struct hmt *);
|
|
|
|
|
|
|
|
void display_bookmarks(struct hmt *hmt);
|
|
|
|
void display_hmt(struct hmt *hmt);
|
|
|
|
|
|
|
|
void cmd_protect(struct hmt *, int);
|
|
|
|
void cmd_encrypted(struct hmt *, int);
|
|
|
|
void cmd_shrunk(struct hmt *, int);
|
|
|
|
void cmd_dedup(struct hmt *, int);
|
|
|
|
void cmd_detectads(struct hmt *, int);
|
2019-03-07 21:33:53 +00:00
|
|
|
void cmd_thumbnail(struct hmt *, int);
|
2011-04-30 00:57:30 +00:00
|
|
|
void cmd_new(struct hmt *, int);
|
|
|
|
void cmd_lock(struct hmt *, int);
|
|
|
|
void cmd_guidance(struct hmt *, int);
|
|
|
|
void cmd_setresume(struct hmt *, char *);
|
|
|
|
void cmd_setsynopsis(struct hmt *, char *);
|
2022-04-07 01:54:35 +00:00
|
|
|
void cmd_setguidance(struct hmt *, char *);
|
2011-04-30 00:57:30 +00:00
|
|
|
void cmd_settitle(struct hmt *, char *);
|
|
|
|
void cmd_setgenre(struct hmt *, char *);
|
|
|
|
void cmd_bookmarks(struct hmt *, char *, int);
|
|
|
|
void patch_byte(struct hmt *, uint32_t, uint8_t);
|
|
|
|
void patch_string(struct hmt *, uint32_t, uint32_t, char *);
|
2022-04-07 01:54:35 +00:00
|
|
|
void patch_string_utf8(struct hmt *, uint32_t, uint32_t, char *);
|
2011-04-30 00:57:30 +00:00
|
|
|
void cmd_patch(struct hmt *, char *);
|
|
|
|
void cmd_unpatch(struct hmt *, char *);
|
|
|
|
void cmd_setseries(struct hmt *, char *);
|
|
|
|
|
2019-03-07 21:28:24 +00:00
|
|
|
#ifdef _WIN32
|
|
|
|
#include <io.h>
|
|
|
|
#include <windows.h>
|
|
|
|
|
|
|
|
#define MAXPATHLEN MAX_PATH
|
|
|
|
#define open(a,b,c) _open(a,b,c)
|
|
|
|
#define close(a) _close(a)
|
|
|
|
#define read(a,b,c) _read(a,b,c)
|
|
|
|
#define write(a,b,c) _write(a,b,c)
|
|
|
|
#define lseek(a,b,c) _lseek(a,b,c)
|
|
|
|
#define MAP_FAILED 0
|
|
|
|
#define mmap(a,b,c,d,e,f) MAP_FAILED
|
|
|
|
#define munmap(a,b)
|
|
|
|
#define strncasecmp _strnicmp
|
|
|
|
|
|
|
|
typedef long off_t;
|
|
|
|
|
|
|
|
#else /* _WIN32 */
|
|
|
|
|
|
|
|
#include <sys/mman.h>
|
|
|
|
#include <sys/param.h>
|
|
|
|
#include <unistd.h>
|
|
|
|
|
|
|
|
#endif /* _WIN32 */
|
|
|
|
|
2011-04-30 00:57:30 +00:00
|
|
|
|