mirror of
				https://github.com/sqlmapproject/sqlmap.git
				synced 2025-10-31 07:57:47 +03:00 
			
		
		
		
	Speedup of caching for char encoding (non-Unicode chars in page)
This commit is contained in:
		
							parent
							
								
									b3e454d0b1
								
							
						
					
					
						commit
						eeacab0f19
					
				|  | @ -18,7 +18,7 @@ from lib.core.enums import OS | ||||||
| from thirdparty.six import unichr as _unichr | from thirdparty.six import unichr as _unichr | ||||||
| 
 | 
 | ||||||
| # sqlmap version (<major>.<minor>.<month>.<monthly commit>) | # sqlmap version (<major>.<minor>.<month>.<monthly commit>) | ||||||
| VERSION = "1.5.2.26" | VERSION = "1.5.3.0" | ||||||
| TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable" | TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable" | ||||||
| TYPE_COLORS = {"dev": 33, "stable": 90, "pip": 34} | TYPE_COLORS = {"dev": 33, "stable": 90, "pip": 34} | ||||||
| VERSION_STRING = "sqlmap/%s#%s" % ('.'.join(VERSION.split('.')[:-1]) if VERSION.count('.') > 2 and VERSION.split('.')[-1] == '0' else VERSION, TYPE) | VERSION_STRING = "sqlmap/%s#%s" % ('.'.join(VERSION.split('.')[:-1]) if VERSION.count('.') > 2 and VERSION.split('.')[-1] == '0' else VERSION, TYPE) | ||||||
|  |  | ||||||
|  | @ -773,6 +773,9 @@ def cmdLineParser(argv=None): | ||||||
|         parser.add_argument("--dummy", dest="dummy", action="store_true", |         parser.add_argument("--dummy", dest="dummy", action="store_true", | ||||||
|             help=SUPPRESS) |             help=SUPPRESS) | ||||||
| 
 | 
 | ||||||
|  |         parser.add_argument("--yuge", dest="yuge", action="store_true", | ||||||
|  |             help=SUPPRESS) | ||||||
|  | 
 | ||||||
|         parser.add_argument("--murphy-rate", dest="murphyRate", type=int, |         parser.add_argument("--murphy-rate", dest="murphyRate", type=int, | ||||||
|             help=SUPPRESS) |             help=SUPPRESS) | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -259,7 +259,7 @@ def getHeuristicCharEncoding(page): | ||||||
|     """ |     """ | ||||||
| 
 | 
 | ||||||
|     key = hash(page) |     key = hash(page) | ||||||
|     retVal = kb.cache.encoding.get(key) or detect(page[:HEURISTIC_PAGE_SIZE_THRESHOLD])["encoding"] |     retVal = kb.cache.encoding[key] if key in kb.cache.encoding else detect(page[:HEURISTIC_PAGE_SIZE_THRESHOLD])["encoding"] | ||||||
|     kb.cache.encoding[key] = retVal |     kb.cache.encoding[key] = retVal | ||||||
| 
 | 
 | ||||||
|     if retVal and retVal.lower().replace('-', "") == UNICODE_ENCODING.lower().replace('-', ""): |     if retVal and retVal.lower().replace('-', "") == UNICODE_ENCODING.lower().replace('-', ""): | ||||||
|  |  | ||||||
|  | @ -252,6 +252,9 @@ class Connect(object): | ||||||
|                         singleTimeWarnMessage(warnMsg) |                         singleTimeWarnMessage(warnMsg) | ||||||
|                         break |                         break | ||||||
| 
 | 
 | ||||||
|  |         if conf.yuge: | ||||||
|  |             retVal = 100 * retVal | ||||||
|  | 
 | ||||||
|         return retVal |         return retVal | ||||||
| 
 | 
 | ||||||
|     @staticmethod |     @staticmethod | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue
	
	Block a user