Try to fix some host warnings.

svn path=/trunk/; revision=63512
This commit is contained in:
Timo Kreuzer 2014-05-31 15:29:10 +00:00
parent 96f0120d3a
commit 4289bcee64
5 changed files with 23 additions and 26 deletions

View file

@ -14,8 +14,8 @@ HvpWriteLog(
PHHIVE RegistryHive) PHHIVE RegistryHive)
{ {
ULONG FileOffset; ULONG FileOffset;
ULONG BufferSize; UINT BufferSize;
ULONG BitmapSize; UINT BitmapSize;
PUCHAR Buffer; PUCHAR Buffer;
PUCHAR Ptr; PUCHAR Ptr;
ULONG BlockIndex; ULONG BlockIndex;

View file

@ -5,19 +5,16 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <stdint.h>
#define IMAGE_FILE_MACHINE_I386 0x014c #define IMAGE_FILE_MACHINE_I386 0x014c
#define IMAGE_FILE_MACHINE_AMD64 0x8664 #define IMAGE_FILE_MACHINE_AMD64 0x8664
#define IMAGE_FILE_MACHINE_ARMNT 0x01c4 #define IMAGE_FILE_MACHINE_ARMNT 0x01c4
#ifdef _WIN32 #ifdef _MSC_VER
#define PRIx64 "I64x" #define PRIx64 "I64x"
typedef unsigned __int16 uint16_t;
typedef unsigned __int32 uint32_t;
typedef unsigned __int64 uint64_t;
#else #else
#include <stdint.h> #include <inttypes.h>
#define PRIx64 "llx"
#define _stricmp strcasecmp #define _stricmp strcasecmp
#endif #endif

View file

@ -20,7 +20,7 @@
* is inserted, so the string looks right on the console but still * is inserted, so the string looks right on the console but still
* contains the original string, plus other garbage: * contains the original string, plus other garbage:
*/ */
static char static char
*backSpaceEdit(char *s) *backSpaceEdit(char *s)
{ {
char c; char c;
@ -58,7 +58,7 @@ handle_switch(FILE *outFile, int *sw, char *arg, char *desc)
*sw = x; *sw = x;
changed = 1; changed = 1;
} }
} }
if (desc) if (desc)
{ {
esclog(outFile, "%s is %d (%s)\n", desc, *sw, changed ? "changed":"unchanged"); esclog(outFile, "%s is %d (%s)\n", desc, *sw, changed ? "changed":"unchanged");
@ -90,14 +90,14 @@ handle_switch_str(FILE *outFile, char *sw, char *arg, char *desc)
changed = 1; changed = 1;
} }
} }
} }
if (desc) if (desc)
{ {
esclog(outFile, "%s is \"%s\" (%s)\n", desc, sw, changed ? "changed":"unchanged"); esclog(outFile, "%s is \"%s\" (%s)\n", desc, sw, changed ? "changed":"unchanged");
if (!arg) if (!arg)
esclog(outFile, "(readonly)\n"); esclog(outFile, "(readonly)\n");
} }
return changed; return changed;
} }
@ -132,14 +132,14 @@ handle_switch_pstr(FILE *outFile, char **psw, char *arg, char *desc)
} }
} }
} }
} }
if (desc) if (desc)
{ {
esclog(outFile, "%s is \"%s\" (%s)\n", desc, *psw, changed ? "changed":"unchanged"); esclog(outFile, "%s is \"%s\" (%s)\n", desc, *psw, changed ? "changed":"unchanged");
if (!arg) if (!arg)
esclog(outFile, "(readonly)\n"); esclog(outFile, "(readonly)\n");
} }
return changed; return changed;
} }
@ -155,7 +155,7 @@ handle_address_cmd(FILE *outFile, char *arg)
if(( s = strchr(arg, ':') )) if(( s = strchr(arg, ':') ))
{ {
*s = ' '; *s = ' ';
if ( (cnt = sscanf(arg,"%20s %lx", Image, &Offset)) == 2) if ( (cnt = sscanf(arg,"%20s %x", Image, &Offset)) == 2)
{ {
if (( plm = entry_lookup(&cache, Image) )) if (( plm = entry_lookup(&cache, Image) ))
{ {
@ -292,7 +292,7 @@ handle_escape_cmd(FILE *outFile, char *Line, char *path, char *LineOut)
{ {
memset(&summ, 0, sizeof(SUMM)); memset(&summ, 0, sizeof(SUMM));
esclog(outFile, "Statistics cleared\n"); esclog(outFile, "Statistics cleared\n");
} }
else else
stat_print(outFile, &summ); stat_print(outFile, &summ);
break; break;

View file

@ -32,8 +32,8 @@ static int match_mod(FILE *outFile, char *Line, int processed)
{ {
static int state = 0; static int state = 0;
char Image[NAMESIZE]; char Image[NAMESIZE];
DWORD Base; UINT Base;
DWORD Size; UINT Size;
PLIST_MEMBER plm; PLIST_MEMBER plm;
int cnt; int cnt;
@ -48,13 +48,13 @@ static int match_mod(FILE *outFile, char *Line, int processed)
switch (state) switch (state)
{ {
case 1: case 1:
if ( (cnt = sscanf(Line,"%lx %lx %20s", &Base, &Size, Image)) == 3 ) if ( (cnt = sscanf(Line,"%x %x %20s", &Base, &Size, Image)) == 3 )
{ {
if (( plm = entry_lookup(&cache, Image) )) if (( plm = entry_lookup(&cache, Image) ))
{ {
plm->RelBase = Base; plm->RelBase = Base;
plm->Size = Size; plm->Size = Size;
l2l_dbg(1, "Relocated: %s %08x -> %08x\n", Image, plm->ImageBase, plm->RelBase); l2l_dbg(1, "Relocated: %s %p -> %p\n", Image, (void*)plm->ImageBase, (void*)plm->RelBase);
} }
return 0; return 0;
} }

View file

@ -52,8 +52,8 @@ RelocateSection(
break; break;
default: default:
printf("Unknown relocatation type %d, address 0x%lx\n", printf("Unknown relocatation type %u, address 0x%x\n",
pReloc->Type, pReloc->VirtualAddress); pReloc->Type, (unsigned)pReloc->VirtualAddress);
} }
pReloc++; pReloc++;
@ -99,7 +99,7 @@ int main(int argc, char *argv[])
if (!pData) if (!pData)
{ {
fclose(pSourceFile); fclose(pSourceFile);
fprintf(stderr, "Failed to allocate %ld bytes\n", nFileSize); fprintf(stderr, "Failed to allocate %lu bytes\n", nFileSize);
return -3; return -3;
} }
@ -108,7 +108,7 @@ int main(int argc, char *argv[])
{ {
free(pData); free(pData);
fclose(pSourceFile); fclose(pSourceFile);
fprintf(stderr, "Failed to read %ld bytes from source file\n", nFileSize); fprintf(stderr, "Failed to read %lu bytes from source file\n", nFileSize);
return -4; return -4;
} }
@ -147,8 +147,8 @@ int main(int argc, char *argv[])
{ {
free(pData); free(pData);
fclose(pDestFile); fclose(pDestFile);
fprintf(stderr, "Failed to write %ld bytes to destination file\n", fprintf(stderr, "Failed to write %u bytes to destination file\n",
pSectionHeader->SizeOfRawData); (unsigned int)pSectionHeader->SizeOfRawData);
return -6; return -6;
} }