Browse code

win32: fixes for sigtool imphash linking

Kevin Lin authored on 2016/07/14 05:26:58
Showing 3 changed files
... ...
@@ -238,8 +238,8 @@ struct pe_image_import_descriptor {
238 238
     uint32_t FirstThunk;
239 239
 };
240 240
 
241
-#define IMAGE_ORDINAL_FLAG32  0x80000000
242
-#define IMAGE_ORDINAL_FLAG64  0x8000000000000000L
241
+#define PE_IMAGEDIR_ORDINAL_FLAG32  0x80000000
242
+#define PE_IMAGEDIR_ORDINAL_FLAG64  0x8000000000000000L
243 243
 
244 244
 struct pe_image_thunk32 {
245 245
     union {
... ...
@@ -2301,7 +2301,7 @@ static inline int hash_impfns(cli_ctx *ctx, void **hashctx, uint32_t *impsz, str
2301 2301
 
2302 2302
             thunk32.u.Ordinal = EC32(thunk32.u.Ordinal);
2303 2303
 
2304
-            if (!(thunk32.u.Ordinal & IMAGE_ORDINAL_FLAG32)) {
2304
+            if (!(thunk32.u.Ordinal & PE_IMAGEDIR_ORDINAL_FLAG32)) {
2305 2305
                 offset = cli_rawaddr(thunk32.u.Function, exe_sections, nsections, &err, fsize, hdr_size);
2306 2306
 
2307 2307
                 if (offset >= 0) {
... ...
@@ -2337,7 +2337,7 @@ static inline int hash_impfns(cli_ctx *ctx, void **hashctx, uint32_t *impsz, str
2337 2337
 
2338 2338
             thunk64.u.Ordinal = EC64(thunk64.u.Ordinal);
2339 2339
 
2340
-            if (!(thunk64.u.Ordinal & IMAGE_ORDINAL_FLAG64)) {
2340
+            if (!(thunk64.u.Ordinal & PE_IMAGEDIR_ORDINAL_FLAG64)) {
2341 2341
                 offset = cli_rawaddr(thunk64.u.Function, exe_sections, nsections, &err, fsize, hdr_size);
2342 2342
 
2343 2343
                 if (offset >= 0) {
... ...
@@ -252,8 +252,6 @@ static int hashpe(const char *filename, unsigned int class, int type)
252 252
 	    return -1;
253 253
     }
254 254
 
255
-    cli_debug_flag = 0;
256
-
257 255
     /* THIS MAY BE UNNECESSARY */
258 256
     switch(ret) {
259 257
         case CL_CLEAN:
... ...
@@ -178,6 +178,7 @@ EXPORTS cli_ldbtokenize @44380 NONAME
178 178
 EXPORTS cli_hwp5header @44381 NONAME
179 179
 EXPORTS cli_scanhwp5_stream @44382 NONAME
180 180
 EXPORTS cli_scanhwp3 @44383 NONAME
181
+EXPORTS cli_genhash_pe @44384 NONAME
181 182
 
182 183
 ; compatibility layer, tommath, zlib
183 184
 EXPORTS w32_srand @44269 NONAME