Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Win10 compilation ok #32

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 4 additions & 5 deletions README
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
Install latest JDK
set JAVA_HOME and JDK_HOME system variable
PUT libiberty.a to C:\MunGW\lib

********************************************************************

As of 6/27/2013 Scalpel has been released under the Apache 2.0 License
Expand Down Expand Up @@ -71,13 +75,8 @@ int the future.

COMPILE INSTRUCTIONS ON SUPPORTED PLATFORMS:

Linux/Mac OS X:
% ./bootstrap
% ./configure
% make

Windows (mingw):
cd src
mingw32-make -f Makefile.win


Expand Down
6 changes: 3 additions & 3 deletions jni/libscalpel_jni.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,7 @@ static unsigned long long tskDataSourceTellO(ScalpelInputReader * const reader)

detachThread();

fprintf(stdout, "tskDataSourceTellO() ret %"PRIu64 "\n", joff );
fprintf(stdout, "tskDataSourceTellO() ret %" PRIu64 "\n", joff );

return (unsigned long long) joff;
}
Expand Down Expand Up @@ -535,13 +535,13 @@ static int tskDataSourceOpen(ScalpelInputReader * const reader) {
fprintf(stdout, "tskDataSourceOpen() WARNING stream already open\n");
//already open, should really close first, reset
jlong zerOff = env->CallLongMethod(tskData->jInputStream, tskData->jSeekMethodId, (jlong)0);
fprintf(stdout, "tskDataSourceOpen() rewinded, new offset: %"PRI64 "\n", (long long) zerOff);
fprintf(stdout, "tskDataSourceOpen() rewinded, new offset: %" PRI64 "\n", (long long) zerOff);
}
else if (!tskData->firstOpen) {
//closed but had already been open, so need to rewind to start
//const jlong jnewOff =
jlong zerOff = env->CallLongMethod(tskData->jInputStream, tskData->jSeekMethodId, (jlong)0);
fprintf(stdout, "tskDataSourceOpen() rewinded, new offset: %"PRI64 "\n", (long long) zerOff);
fprintf(stdout, "tskDataSourceOpen() rewinded, new offset: %" PRI64 "\n", (long long) zerOff);
}


Expand Down
Binary file added libscalpel_jni.dll
Binary file not shown.
Binary file added libscalpel_jni.lib
Binary file not shown.
8 changes: 0 additions & 8 deletions pthreads-win32/pthread.h
Original file line number Diff line number Diff line change
Expand Up @@ -302,14 +302,6 @@ enum {
#endif
#endif

#ifndef HAVE_STRUCT_TIMESPEC
#define HAVE_STRUCT_TIMESPEC 1
struct timespec {
long tv_sec;
long tv_nsec;
};
#endif /* HAVE_STRUCT_TIMESPEC */

#ifndef SIG_BLOCK
#define SIG_BLOCK 0
#endif /* SIG_BLOCK */
Expand Down
48 changes: 24 additions & 24 deletions src/dig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -378,10 +378,10 @@ static int setupAuditFile(struct scalpelState *state) {


if(state->skip) {
fprintf(state->auditFile, "\nSkipped the first %"PRIu64 "bytes of %s...\n",
fprintf(state->auditFile, "\nSkipped the first %" PRIu64 "bytes of %s...\n",
state->skip, scalpelInputGetId(state->inReader));
if(state->modeVerbose) {
fprintf(stdout, "\nSkipped the first %"PRIu64 "bytes of %s...\n",
fprintf(stdout, "\nSkipped the first %" PRIu64 "bytes of %s...\n",
state->skip, scalpelInputGetId(state->inReader));
}
}
Expand Down Expand Up @@ -448,7 +448,7 @@ digBuffer(struct scalpelState *state, unsigned long long lengthofbuf,
// found a header--record location in header offsets database
if(state->modeVerbose) {

fprintf(stdout, "A %s header was found at : %"PRIu64 "\n",
fprintf(stdout, "A %s header was found at : %" PRIu64 "\n",
currentneedle->suffix,
positionUseCoverageBlockmap(state, startLocation));

Expand Down Expand Up @@ -478,7 +478,7 @@ digBuffer(struct scalpelState *state, unsigned long long lengthofbuf,

if(state->modeVerbose) {
fprintf(stdout,
"Memory reallocation performed, total header storage = %"PRIu64 "\n",
"Memory reallocation performed, total header storage = %" PRIu64 "\n",
currentneedle->offsets.headerstorage);
}
}
Expand All @@ -494,7 +494,7 @@ digBuffer(struct scalpelState *state, unsigned long long lengthofbuf,
// found a footer--record location in footer offsets database
if(state->modeVerbose) {

fprintf(stdout, "A %s footer was found at : %"PRIu64 "\n",
fprintf(stdout, "A %s footer was found at : %" PRIu64 "\n",
currentneedle->suffix,
positionUseCoverageBlockmap(state, startLocation));

Expand Down Expand Up @@ -524,7 +524,7 @@ digBuffer(struct scalpelState *state, unsigned long long lengthofbuf,
if(state->modeVerbose) {

fprintf(stdout,
"Memory reallocation performed, total footer storage = %"PRIu64 "\n",
"Memory reallocation performed, total footer storage = %" PRIu64 "\n",
currentneedle->offsets.footerstorage);
}
}
Expand Down Expand Up @@ -618,7 +618,7 @@ digBuffer(struct scalpelState *state, unsigned long long lengthofbuf,
// found a header--record location in header offsets database
if(state->modeVerbose) {

fprintf(stdout, "A %s header was found at : %"PRIu64 "\n",
fprintf(stdout, "A %s header was found at : %" PRIu64 "\n",
currentneedle->suffix,
positionUseCoverageBlockmap(state, startLocation));
}
Expand Down Expand Up @@ -647,7 +647,7 @@ digBuffer(struct scalpelState *state, unsigned long long lengthofbuf,
if(state->modeVerbose) {

fprintf(stdout,
"Memory reallocation performed, total header storage = %"PRIu64 "\n",
"Memory reallocation performed, total header storage = %" PRIu64 "\n",
currentneedle->offsets.headerstorage);

}
Expand Down Expand Up @@ -756,7 +756,7 @@ digBuffer(struct scalpelState *state, unsigned long long lengthofbuf,
startLocation = offset + (foundat[needlenum][i] - readbuffer);
if(state->modeVerbose) {

fprintf(stdout, "A %s footer was found at : %"PRIu64 "\n",
fprintf(stdout, "A %s footer was found at : %" PRIu64 "\n",
currentneedle->suffix,
positionUseCoverageBlockmap(state, startLocation));
}
Expand Down Expand Up @@ -784,7 +784,7 @@ digBuffer(struct scalpelState *state, unsigned long long lengthofbuf,
if(state->modeVerbose) {

fprintf(stdout,
"Memory reallocation performed, total footer storage = %"PRIu64 "\n",
"Memory reallocation performed, total footer storage = %" PRIu64 "\n",
currentneedle->offsets.footerstorage);
}
}
Expand Down Expand Up @@ -991,7 +991,7 @@ void *streaming_reader(void *sss) {
state->inReader)) > longestneedle - 1) {

if(state->modeVerbose) {
fprintf(stdout, "Read %"PRIu64 " bytes from image file.\n", bytesread);
fprintf(stdout, "Read %" PRIu64 " bytes from image file.\n", bytesread);
}

if((err = scalpelInputGetError(state->inReader))) {
Expand Down Expand Up @@ -1106,7 +1106,7 @@ int digImageFile(struct scalpelState *state) {


if(state->modeVerbose) {
fprintf(stdout, "Total file size is %"PRIu64 " bytes\n", filesize);
fprintf(stdout, "Total file size is %" PRIu64 " bytes\n", filesize);
}


Expand Down Expand Up @@ -1537,7 +1537,7 @@ int carveImageFile(struct scalpelState *state) {
fprintf(stdout, "%s", currentneedle->endtext);
}

fprintf(stdout, "\" --> %"PRIu64 " files\n", currentneedle->numfilestocarve);
fprintf(stdout, "\" --> %" PRIu64 " files\n", currentneedle->numfilestocarve);


}
Expand Down Expand Up @@ -1915,7 +1915,7 @@ static int
(unsigned long
long)(ceil((double)filesize / (double)state->coverageblocksize));

fprintf(stdout, "# of blocks in coverage blockmap is %"PRIu64 ".\n",
fprintf(stdout, "# of blocks in coverage blockmap is %" PRIu64 ".\n",
state->coveragenumblocks);


Expand Down Expand Up @@ -1970,7 +1970,7 @@ static int
(unsigned long long)ceil((double)filesize /
(double)state->coverageblocksize);

fprintf(stdout, "# of blocks in coverage blockmap is %"PRIu64 ".\n",
fprintf(stdout, "# of blocks in coverage blockmap is %" PRIu64 ".\n",
state->coveragenumblocks);

fprintf(stdout, "Allocating and clearing in-core coverage bitmap.\n");
Expand Down Expand Up @@ -2374,7 +2374,7 @@ static off64_t ftello_use_coverage_map(struct scalpelState *state, ScalpelInputR

if(state->modeVerbose && state->useCoverageBlockmap) {
fprintf(stdout,
"Coverage map decreased current file position by %"PRIu64 " bytes.\n",
"Coverage map decreased current file position by %" PRIu64 " bytes.\n",
(unsigned long long)decrease);
}
}
Expand All @@ -2399,7 +2399,7 @@ fread_use_coverage_map(struct scalpelState *state, void *ptr,
if(state->useCoverageBlockmap) {
if(state->modeVerbose) {
fprintf(stdout,
"Issuing coverage map-based READ, wants %"PRIu64 " bytes.\n",
"Issuing coverage map-based READ, wants %" PRIu64 " bytes.\n",
neededbytes);
}

Expand All @@ -2425,7 +2425,7 @@ fread_use_coverage_map(struct scalpelState *state, void *ptr,

if(state->modeVerbose) {
fprintf(stdout,
"fread using coverage map to skip %"PRIu64 " bytes.\n", bytestoskip);
"fread using coverage map to skip %" PRIu64 " bytes.\n", bytestoskip);
}

scalpelInputSeeko(inReader, (off64_t) bytestoskip, SCALPEL_SEEK_CUR);
Expand All @@ -2450,7 +2450,7 @@ fread_use_coverage_map(struct scalpelState *state, void *ptr,

if(state->modeVerbose) {
fprintf(stdout,
"fread using coverage map found %"PRIu64 " consecutive bytes.\n",
"fread using coverage map found %" PRIu64 " consecutive bytes.\n",
bytestoread);
}

Expand All @@ -2465,7 +2465,7 @@ fread_use_coverage_map(struct scalpelState *state, void *ptr,
curpos += bytestoread;

if(state->modeVerbose) {
fprintf(stdout, "fread using coverage map read %"PRIu64 " bytes.\n",
fprintf(stdout, "fread using coverage map read %" PRIu64 " bytes.\n",
bytesread);
}
}
Expand Down Expand Up @@ -2879,7 +2879,7 @@ static int writeHeaderFooterDatabase(struct scalpelState *state) {
}

// # of headers
if(fprintf(dbfile, "%"PRIu64 "\n", currentneedle->offsets.numheaders)
if(fprintf(dbfile, "%" PRIu64 "\n", currentneedle->offsets.numheaders)
<= 0) {

fprintf(stderr,
Expand All @@ -2893,7 +2893,7 @@ static int writeHeaderFooterDatabase(struct scalpelState *state) {
for(i = 0; i < currentneedle->offsets.numheaders; i++) {
#ifdef _WIN32
if(fprintf
(dbfile, "%"PRIu64 "\n",
(dbfile, "%" PRIu64 "\n",
positionUseCoverageBlockmap(state,
currentneedle->offsets.
headers[i])) <= 0) {
Expand All @@ -2913,7 +2913,7 @@ static int writeHeaderFooterDatabase(struct scalpelState *state) {
}

// # of footers
if(fprintf(dbfile, "%"PRIu64 "\n", currentneedle->offsets.numfooters)
if(fprintf(dbfile, "%" PRIu64 "\n", currentneedle->offsets.numfooters)
<= 0) {
fprintf(stderr,
"Error writing to header/footer database file: %s\n", fn);
Expand All @@ -2925,7 +2925,7 @@ static int writeHeaderFooterDatabase(struct scalpelState *state) {
// all footer positions for current suffix
for(i = 0; i < currentneedle->offsets.numfooters; i++) {
if(fprintf
(dbfile, "%"PRIu64 "\n",
(dbfile, "%" PRIu64 "\n",
positionUseCoverageBlockmap(state,
currentneedle->offsets.
footers[i])) <= 0) {
Expand Down
4 changes: 2 additions & 2 deletions src/helpers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,7 @@ int skipInFile(struct scalpelState *state, ScalpelInputReader * inReader)
if((scalpelInputSeeko(inReader, state->skip, SCALPEL_SEEK_SET))) {

fprintf(stderr,
"ERROR: Couldn't skip %"PRIu64 " bytes at the start of input file %s\n",
"ERROR: Couldn't skip %" PRIu64 " bytes at the start of input file %s\n",
state->skip, inputId);


Expand All @@ -543,7 +543,7 @@ int skipInFile(struct scalpelState *state, ScalpelInputReader * inReader)
}
else {

fprintf(stderr, "\nSkipped the first %"PRIu64 " bytes of %s...\n",
fprintf(stderr, "\nSkipped the first %" PRIu64 " bytes of %s...\n",
state->skip, inputId);


Expand Down
4 changes: 2 additions & 2 deletions src/scalpel_exec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ int main(int argc, char **argv) {
}

fprintf(stdout,
"\nScalpel is done, files carved = %"PRIu64 ", elapsed = %ld secs.\n",
"\nScalpel is done, files carved = %" PRIu64 ", elapsed = %ld secs.\n",
state.fileswritten, (int)time(0) - starttime);

destroy_threading_model(&state);
Expand Down Expand Up @@ -348,7 +348,7 @@ void processCommandLineArgs(int argc, char **argv, struct scalpelState *state) {
numopts++;
state->skip = strtoull(optarg, NULL, 10);
fprintf(stdout,
"Skipping the first %"PRIu64 " bytes of each image file.\n", state->skip);
"Skipping the first %" PRIu64 " bytes of each image file.\n", state->skip);
break;

case 'c':
Expand Down