[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r2509 - Extractor/src/plugins/wordleaker
From: |
grothoff |
Subject: |
[GNUnet-SVN] r2509 - Extractor/src/plugins/wordleaker |
Date: |
Tue, 14 Mar 2006 21:25:45 -0800 (PST) |
Author: grothoff
Date: 2006-03-14 21:25:44 -0800 (Tue, 14 Mar 2006)
New Revision: 2509
Modified:
Extractor/src/plugins/wordleaker/wordextractor.cc
Log:
better
Modified: Extractor/src/plugins/wordleaker/wordextractor.cc
===================================================================
--- Extractor/src/plugins/wordleaker/wordextractor.cc 2006-03-15 05:24:17 UTC
(rev 2508)
+++ Extractor/src/plugins/wordleaker/wordextractor.cc 2006-03-15 05:25:44 UTC
(rev 2509)
@@ -308,6 +308,8 @@
struct
EXTRACTOR_Keywords * prev) {
char ver[16];
char product[128];
+ unsigned char buffer[256];
+
if ( (size < 512 + 898) || (filename == NULL) )
return prev;
@@ -318,6 +320,54 @@
return prev;
}
+ POLE::Stream * stream = storage->stream( "SummaryInformation" );
+ if (! stream) {
+ delete storage;
+ return prev;
+ }
+
+ // ClassID & Offset
+ stream->seek(28);
+ if (20 != stream->read(buffer, 20)) {
+ delete storage;
+ return prev;
+ }
+
+ // beginning of section
+ unsigned long begin = stream->tell();
+ // skip length of section
+ stream->read(buffer, 4);
+ // number of properties
+ if (4 == stream->read(buffer, 4)) {
+ unsigned int nproperties = buffer[0] + (buffer[1] << 8) + (buffer[2] <<
16) + (buffer[3] << 24);
+ // properties
+ for (unsigned int i = 0; i < nproperties; i++) {
+ if (8 != stream->read(buffer, 8))
+ break;
+ unsigned int propertyID = buffer[0] + (buffer[1] << 8) + (buffer[2] <<
16) + (buffer[3] << 24);
+ unsigned int offsetProp = buffer[4] + (buffer[5] << 8) + (buffer[6] <<
16) + (buffer[7] << 24);
+ if (propertyID > 1 && propertyID < 20) {
+ unsigned long offsetCur = stream->tell();
+ stream->seek(offsetProp + begin);
+ if (propertyID == 10) {
+ /* FIXME: how is editing time encoded? */
+ } if (propertyID == 19) {
+ /* FIXME: how to interpret the security integer? */
+ } else {
+ char * prop = getProperty(stream);
+ if (prop != NULL) {
+ prev = addKeyword(SummaryProperties[propertyID],
+ prop,
+ prev);
+ free(prop);
+ }
+ }
+ stream->seek(offsetCur);
+ }
+ }
+ }
+
+
const unsigned char * buffer = (const unsigned char*) &data[512];
unsigned int wIdent = buffer[0] + (buffer[1] << 8);
unsigned int nProduct = buffer[4] + (buffer[5] << 8);
@@ -365,50 +415,6 @@
prev);
}
- POLE::Stream * stream = storage->stream( "SummaryInformation" );
- if (stream) {
- unsigned char buffer[256];
-
- // ClassID & Offset
- stream->seek(28);
- if (20 != stream->read(buffer, 20)) {
- delete storage;
- return prev;
- }
- // beginning of section
- unsigned long begin = stream->tell();
- // skip length of section
- stream->read(buffer, 4);
- // number of properties
- if (4 == stream->read(buffer, 4)) {
- unsigned int nproperties = buffer[0] + (buffer[1] << 8) + (buffer[2] <<
16) + (buffer[3] << 24);
- // properties
- for (unsigned int i = 0; i < nproperties; i++) {
- if (8 != stream->read(buffer, 8))
- break;
- unsigned int propertyID = buffer[0] + (buffer[1] << 8) + (buffer[2]
<< 16) + (buffer[3] << 24);
- unsigned int offsetProp = buffer[4] + (buffer[5] << 8) + (buffer[6]
<< 16) + (buffer[7] << 24);
- if (propertyID > 1 && propertyID < 20) {
- unsigned long offsetCur = stream->tell();
- stream->seek(offsetProp + begin);
- if (propertyID == 10) {
- /* FIXME: how is editing time encoded? */
- } if (propertyID == 19) {
- /* FIXME: how to interpret the security integer? */
- } else {
- char * prop = getProperty(stream);
- if (prop != NULL) {
- prev = addKeyword(SummaryProperties[propertyID],
- prop,
- prev);
- free(prop);
- }
- }
- stream->seek(offsetCur);
- }
- }
- }
- }
unsigned int where = 0;
stream = storage->stream("1Table");
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r2509 - Extractor/src/plugins/wordleaker,
grothoff <=