Mercurial > libpst
comparison src/deltasearch.cpp @ 118:0f1492b7fe8b
patch from Fridrich Strba for building on mingw and general cleanup of autoconf files
add processing for pst files of type 0x0f
start adding support for properly building and installing libpst.so and the header files required to use it.
remove version.h since the version number is now in config.h
more const correctness issues regarding getopt()
author | Carl Byington <carl@five-ten-sg.com> |
---|---|
date | Sat, 31 Jan 2009 12:12:36 -0800 |
parents | 3cb02cb1e6cd |
children | 7f747c8c9d02 |
comparison
equal
deleted
inserted
replaced
117:0a3d854b53f6 | 118:0f1492b7fe8b |
---|---|
40 0xc8, 0xa1, 0x80, 0xa6, 0x99, 0x98, 0xa8, 0x2f, | 40 0xc8, 0xa1, 0x80, 0xa6, 0x99, 0x98, 0xa8, 0x2f, |
41 0x0e, 0x81, 0x65, 0x73, 0xe4, 0xc2, 0xa2, 0x8a, /*0xef*/ | 41 0x0e, 0x81, 0x65, 0x73, 0xe4, 0xc2, 0xa2, 0x8a, /*0xef*/ |
42 0xd4, 0xe1, 0x11, 0xd0, 0x08, 0x8b, 0x2a, 0xf2, | 42 0xd4, 0xe1, 0x11, 0xd0, 0x08, 0x8b, 0x2a, 0xf2, |
43 0xed, 0x9a, 0x64, 0x3f, 0xc1, 0x6c, 0xf9, 0xec}; /*0xff*/ | 43 0xed, 0x9a, 0x64, 0x3f, 0xc1, 0x6c, 0xf9, 0xec}; /*0xff*/ |
44 | 44 |
45 int main(int argc, char *argv[]) { | 45 int main(int argc, char* const* argv) { |
46 if (argc < 4) { | 46 if (argc < 4) { |
47 cout << "usage: " << argv[0] << " filename.pst integer-delta search-string" << endl; | 47 printf("usage: %s filename.pst integer-delta search-string\n", argv[0]); |
48 return 0; | 48 return 0; |
49 } | 49 } |
50 int fd = open(argv[1], O_RDONLY); | 50 int fd = open(argv[1], O_RDONLY); |
51 int d = atoi(argv[2]); | 51 int d = atoi(argv[2]); |
52 string search(argv[3]); | 52 string search(argv[3]); |
53 cout << "using file " << argv[1] << " with delta " << d << " looking for " << search << endl; | 53 printf("using file %s with delta %d looking for %s\n", argv[1], d, argv[3]); |
54 if (fd) { | 54 if (fd) { |
55 struct stat st; | 55 struct stat st; |
56 fstat(fd, &st); | 56 fstat(fd, &st); |
57 off_t size = st.st_size; | 57 off_t size = st.st_size; |
58 char buf[size]; | 58 char buf[size]; |
59 size_t s = read(fd, buf, size); | 59 size_t s = read(fd, buf, size); |
60 pst_debug_hexdumper(stdout, buf, s, 16, 0); | 60 pst_debug_hexdumper(stdout, buf, s, 16, 0); |
61 cout << endl; | 61 printf("\n\n dump decrypted data \n"); |
62 cout << endl; | |
63 cout << " dump decrypted data " << endl; | |
64 for (off_t i=0; i<size; i++) { | 62 for (off_t i=0; i<size; i++) { |
65 buf[i] = comp_enc[(unsigned char)buf[i]]; | 63 buf[i] = comp_enc[(unsigned char)buf[i]]; |
66 } | 64 } |
67 pst_debug_hexdumper(stdout, buf, s, 16, 0); | 65 pst_debug_hexdumper(stdout, buf, s, 16, 0); |
68 close(fd); | 66 close(fd); |