Browse code

Apply y0da cryptor patch sent in by Sebastian Andrzej Siewior.

Steven Morgan authored on 2015/03/04 06:37:08
Showing 1 changed files
... ...
@@ -81,6 +81,7 @@ static int yc_poly_emulator(cli_ctx *ctx, char *base, unsigned int filesize, cha
81 81
   unsigned char al;
82 82
   unsigned char cl = ecx & 0xff;
83 83
   unsigned int j,i;
84
+  unsigned int max_jmp_loop = 100000;
84 85
 
85 86
   for(i=0;i<ecx&&i<max_emu;i++) /* Byte looper - Decrypts every byte and write it back */
86 87
     {
... ...
@@ -103,6 +104,9 @@ static int yc_poly_emulator(cli_ctx *ctx, char *base, unsigned int filesize, cha
103 103
             if (yc_bounds_check(ctx, base, filesize, decryptor_offset, j)) {
104 104
                 return 2;
105 105
             }
106
+	      if (!max_jmp_loop)
107
+	          return 2;
108
+	      max_jmp_loop--;
106 109
 	      j = j + decryptor_offset[j];
107 110
 	      break;
108 111