jstrings  1
A tool for finding JIS-based character strings in binary streams
jis_enc.h
1 
7 #ifndef JIS_ENC_H
8 #define JIS_ENC_H
9 #include <iostream>
10 #include <vector>
11 
15 struct found_string {
19  off_t address;
23  std::vector<uint8_t> data;
24 };
25 
29 class jis_enc {
30 protected:
31  std::istream* instream;
35  size_t min_len = 10;
39  bool is_big_endian = true;
43  bool use_jisx0213 = false;
44 
45 public:
46  jis_enc(std::istream* instream);
47  virtual ~jis_enc();
51  virtual std::vector<found_string>* find() = 0;
55  void set_min_len(size_t min_len);
59  size_t get_min_len();
63  void set_is_big_endian(bool is_big_endian);
67  bool get_is_big_endian();
71  void set_use_jisx0213(bool use_jisx0213);
75  bool get_use_jisx0213();
76 };
77 
78 #endif // JIS_ENC_H
std::vector< uint8_t > data
The extracted string data.
Definition: jis_enc.h:23
off_t address
The offset of the beginning of the found string relative to the start of the stream.
Definition: jis_enc.h:19
Abstract class for JIS based encoding classes.
Definition: jis_enc.h:29
POD structure for containing a found string.
Definition: jis_enc.h:15