1214 |
|
st_nonrange_search.Start(); |
1215 |
|
//second_tmp_Results = new List<ResultType<object>>(SearchArgs.Results.Count * 1024); |
1216 |
|
////second_tmp_Results.c |
1217 |
< |
|
1218 |
< |
using (SearchResultReader reader = new SearchResultReader()) |
1217 |
> |
try |
1218 |
|
{ |
1219 |
< |
for (int i = 0; i < reader.ResultCount; i += 1) |
1219 |
> |
using (SearchResultReader reader = new SearchResultReader()) |
1220 |
|
{ |
1221 |
< |
if (reader.ReadCurrentAddess) |
1221 |
> |
for (int i = 0; i < reader.ResultCount; i += 1) |
1222 |
|
{ |
1223 |
< |
if (!reader.ReadCurrentValue) |
1223 |
> |
object result_value = 0; |
1224 |
> |
uint address = 0; |
1225 |
> |
#region switch (SearchArgs.DataType) |
1226 |
> |
switch (SearchArgs.DataType) |
1227 |
|
{ |
1228 |
< |
switch (SearchArgs.DataType) |
1227 |
< |
{ |
1228 |
< |
case SearchDataTypes._8bits: if (unsigned) { reader.CurrentResult<byte>(); } else { reader.CurrentResult<sbyte>(); } break; |
1229 |
< |
case SearchDataTypes._16bits: if (unsigned) { reader.CurrentResult<ushort>(); } else { reader.CurrentResult<short>(); } break; |
1230 |
< |
case SearchDataTypes._32bits: if (unsigned) { reader.CurrentResult<uint>(); } else { reader.CurrentResult<int>(); } break; |
1231 |
< |
case SearchDataTypes._64bits: if (unsigned) { reader.CurrentResult<ulong>(); } else { reader.CurrentResult<long>(); } break; |
1232 |
< |
} |
1233 |
< |
} |
1234 |
< |
} |
1235 |
< |
uint address = reader.CurrentAddress(); |
1236 |
< |
if (MemoryRangeStart > 0 && !SearchArgs.IsFirstSearch) { address = address - MemoryRangeStart; } |
1237 |
< |
try |
1238 |
< |
{ |
1239 |
< |
//r_ms.BaseStream.Seek(address, SeekOrigin.Begin); |
1240 |
< |
} |
1241 |
< |
catch (Exception) |
1242 |
< |
{ |
1243 |
< |
throw; |
1244 |
< |
} |
1245 |
< |
switch (SearchArgs.DataType) |
1246 |
< |
{ |
1247 |
< |
#region Comparer Support |
1248 |
< |
#region case SearchDataTypes._8bits: |
1249 |
< |
case SearchDataTypes._8bits: |
1250 |
< |
if (SearchArgs.IsUnsignedDataType) |
1251 |
< |
{ |
1252 |
< |
byte lookup_value = 0; |
1253 |
< |
using (GenericMemoryProvider gmp = new GenericMemoryProvider((IAcceptsProcessAndConfig)this)) { gmp.OpenProvider(); gmp.ReadMemory(address, out lookup_value); gmp.CloseProvider(); } |
1254 |
< |
_8bit_unsigned_comparer_ comparer = new _8bit_unsigned_comparer_(SearchArgs, address); |
1255 |
< |
byte value = 0; |
1256 |
< |
if (SearchArgs.CompareValueType == CompareValueTypes.OldValue) |
1228 |
> |
case SearchDataTypes._8bits: if (unsigned) |
1229 |
|
{ |
1230 |
< |
value = reader.CurrentResult<byte>(); |
1231 |
< |
comparer.Value = value; |
1230 |
> |
using (ResultType<byte> result = reader.GetNextResult<byte>()) |
1231 |
> |
{ |
1232 |
> |
address = result.Address; |
1233 |
> |
result_value = result.Value; |
1234 |
> |
} |
1235 |
|
} |
1236 |
|
else |
1237 |
|
{ |
1238 |
< |
value = Convert.ToByte(SearchArgs.CompareStartValue); |
1239 |
< |
comparer.Value = value; |
1240 |
< |
} |
1241 |
< |
if (comparer.Compare(lookup_value, value)) |
1242 |
< |
{ |
1243 |
< |
ResultType<object> _tmp_result = new ResultType<object>(comparer.Address, comparer.Value); |
1244 |
< |
second_tmp_Results.Add(_tmp_result); |
1245 |
< |
} |
1246 |
< |
comparer = null; // free memory |
1247 |
< |
} |
1248 |
< |
else |
1249 |
< |
{ |
1250 |
< |
sbyte lookup_value = 0; |
1276 |
< |
using (GenericMemoryProvider gmp = new GenericMemoryProvider((IAcceptsProcessAndConfig)this)) { gmp.OpenProvider(); gmp.ReadMemory(address, out lookup_value); gmp.CloseProvider(); } |
1277 |
< |
_8bit_signed_comparer_ comparer = new _8bit_signed_comparer_(SearchArgs, address); |
1278 |
< |
sbyte value = 0; |
1279 |
< |
if (SearchArgs.CompareValueType == CompareValueTypes.OldValue) |
1280 |
< |
{ |
1281 |
< |
value = reader.CurrentResult<sbyte>(); |
1238 |
> |
using (ResultType<sbyte> result = reader.GetNextResult<sbyte>()) |
1239 |
> |
{ |
1240 |
> |
address = result.Address; |
1241 |
> |
result_value = result.Value; |
1242 |
> |
} |
1243 |
> |
} break; |
1244 |
> |
case SearchDataTypes._16bits: if (unsigned) |
1245 |
> |
{ |
1246 |
> |
using (ResultType<ushort> result = reader.GetNextResult<ushort>()) |
1247 |
> |
{ |
1248 |
> |
address = result.Address; |
1249 |
> |
result_value = result.Value; |
1250 |
> |
} |
1251 |
|
} |
1252 |
|
else |
1253 |
|
{ |
1254 |
< |
value = Convert.ToSByte(SearchArgs.CompareStartValue); |
1255 |
< |
} |
1256 |
< |
if (comparer.Compare(lookup_value, value)) |
1257 |
< |
{ |
1258 |
< |
ResultType<object> _tmp_result = new ResultType<object>(comparer.Address, comparer.Value); |
1259 |
< |
second_tmp_Results.Add(_tmp_result); |
1260 |
< |
} |
1261 |
< |
comparer = null; // free memory |
1262 |
< |
} |
1263 |
< |
break; |
1264 |
< |
#endregion |
1265 |
< |
#region case SearchDataTypes._16bits: |
1266 |
< |
case SearchDataTypes._16bits: |
1298 |
< |
if (SearchArgs.IsUnsignedDataType) |
1299 |
< |
{ |
1300 |
< |
ushort lookup_value = 0; |
1301 |
< |
using (GenericMemoryProvider gmp = new GenericMemoryProvider((IAcceptsProcessAndConfig)this)) { gmp.OpenProvider(); gmp.ReadMemory(address, out lookup_value); gmp.CloseProvider(); } |
1302 |
< |
_16bit_unsigned_comparer_ comparer = new _16bit_unsigned_comparer_(SearchArgs, address); |
1303 |
< |
ushort value = 0; |
1304 |
< |
if (SearchArgs.CompareValueType == CompareValueTypes.OldValue) |
1305 |
< |
{ |
1306 |
< |
value = reader.CurrentResult<ushort>(); |
1307 |
< |
comparer.Value = value; |
1254 |
> |
using (ResultType<short> result = reader.GetNextResult<short>()) |
1255 |
> |
{ |
1256 |
> |
address = result.Address; |
1257 |
> |
result_value = result.Value; |
1258 |
> |
} |
1259 |
> |
} break; |
1260 |
> |
case SearchDataTypes._32bits: if (unsigned) |
1261 |
> |
{ |
1262 |
> |
using (ResultType<uint> result = reader.GetNextResult<uint>()) |
1263 |
> |
{ |
1264 |
> |
address = result.Address; |
1265 |
> |
result_value = result.Value; |
1266 |
> |
} |
1267 |
|
} |
1268 |
|
else |
1269 |
|
{ |
1270 |
< |
value = Convert.ToUInt16(SearchArgs.CompareStartValue); |
1271 |
< |
comparer.Value = value; |
1272 |
< |
} |
1273 |
< |
if (comparer.Compare(lookup_value, value)) |
1274 |
< |
{ |
1275 |
< |
ResultType<object> _tmp_result = new ResultType<object>(comparer.Address, comparer.Value); |
1276 |
< |
second_tmp_Results.Add(_tmp_result); |
1277 |
< |
} |
1278 |
< |
comparer = null; // free memory |
1279 |
< |
} |
1280 |
< |
else |
1281 |
< |
{ |
1282 |
< |
short lookup_value = 0; |
1324 |
< |
using (GenericMemoryProvider gmp = new GenericMemoryProvider((IAcceptsProcessAndConfig)this)) { gmp.OpenProvider(); gmp.ReadMemory(address, out lookup_value); gmp.CloseProvider(); } |
1325 |
< |
_16bit_signed_comparer_ comparer = new _16bit_signed_comparer_(SearchArgs, address); |
1326 |
< |
short value = 0; |
1327 |
< |
if (SearchArgs.CompareValueType == CompareValueTypes.OldValue) |
1328 |
< |
{ |
1329 |
< |
value = reader.CurrentResult<short>(); |
1270 |
> |
using (ResultType<int> result = reader.GetNextResult<int>()) |
1271 |
> |
{ |
1272 |
> |
address = result.Address; |
1273 |
> |
result_value = result.Value; |
1274 |
> |
} |
1275 |
> |
} break; |
1276 |
> |
case SearchDataTypes._64bits: if (unsigned) |
1277 |
> |
{ |
1278 |
> |
using (ResultType<ulong> result = reader.GetNextResult<ulong>()) |
1279 |
> |
{ |
1280 |
> |
address = result.Address; |
1281 |
> |
result_value = result.Value; |
1282 |
> |
} |
1283 |
|
} |
1284 |
|
else |
1285 |
|
{ |
1286 |
< |
value = Convert.ToInt16(SearchArgs.CompareStartValue); |
1287 |
< |
} |
1288 |
< |
if (comparer.Compare(lookup_value, value)) |
1289 |
< |
{ |
1290 |
< |
ResultType<object> _tmp_result = new ResultType<object>(comparer.Address, comparer.Value); |
1291 |
< |
second_tmp_Results.Add(_tmp_result); |
1292 |
< |
} |
1340 |
< |
comparer = null; // free memory |
1341 |
< |
} |
1342 |
< |
break; |
1286 |
> |
using (ResultType<long> result = reader.GetNextResult<long>()) |
1287 |
> |
{ |
1288 |
> |
address = result.Address; |
1289 |
> |
result_value = result.Value; |
1290 |
> |
} |
1291 |
> |
} break; |
1292 |
> |
} |
1293 |
|
#endregion |
1294 |
< |
#region case SearchDataTypes._32bits: |
1295 |
< |
case SearchDataTypes._32bits: |
1296 |
< |
if (SearchArgs.IsUnsignedDataType) |
1297 |
< |
{ |
1298 |
< |
uint lookup_value = 0; |
1299 |
< |
using (GenericMemoryProvider gmp = new GenericMemoryProvider((IAcceptsProcessAndConfig)this)) { gmp.OpenProvider(); gmp.ReadMemory(address, out lookup_value); gmp.CloseProvider(); } |
1300 |
< |
_32bit_unsigned_comparer_ comparer = new _32bit_unsigned_comparer_(SearchArgs, address); |
1301 |
< |
uint value = 0; |
1302 |
< |
if (SearchArgs.CompareValueType == CompareValueTypes.OldValue) |
1303 |
< |
{ |
1304 |
< |
value = reader.CurrentResult<uint>(); |
1305 |
< |
comparer.Value = value; |
1294 |
> |
if (MemoryRangeStart > 0 && !SearchArgs.IsFirstSearch) { address = address - MemoryRangeStart; } |
1295 |
> |
try |
1296 |
> |
{ |
1297 |
> |
//r_ms.BaseStream.Seek(address, SeekOrigin.Begin); |
1298 |
> |
} |
1299 |
> |
catch (Exception) |
1300 |
> |
{ |
1301 |
> |
throw; |
1302 |
> |
} |
1303 |
> |
switch (SearchArgs.DataType) |
1304 |
> |
{ |
1305 |
> |
#region Comparer Support |
1306 |
> |
#region case SearchDataTypes._8bits: |
1307 |
> |
case SearchDataTypes._8bits: |
1308 |
> |
if (SearchArgs.IsUnsignedDataType) |
1309 |
> |
{ |
1310 |
> |
byte lookup_value = 0; |
1311 |
> |
using (GenericMemoryProvider gmp = new GenericMemoryProvider((IAcceptsProcessAndConfig)this)) { gmp.OpenProvider(); gmp.ReadMemory(address, out lookup_value); gmp.CloseProvider(); } |
1312 |
> |
_8bit_unsigned_comparer_ comparer = new _8bit_unsigned_comparer_(SearchArgs, address); |
1313 |
> |
byte value = 0; |
1314 |
> |
if (SearchArgs.CompareValueType == CompareValueTypes.OldValue) |
1315 |
> |
{ |
1316 |
> |
value = Convert.ToByte(result_value); |
1317 |
> |
comparer.Value = value; |
1318 |
> |
} |
1319 |
> |
else |
1320 |
> |
{ |
1321 |
> |
value = Convert.ToByte(SearchArgs.CompareStartValue); |
1322 |
> |
comparer.Value = value; |
1323 |
> |
} |
1324 |
> |
if (comparer.Compare(lookup_value, value)) |
1325 |
> |
{ |
1326 |
> |
using (ResultType<object> _tmp_result = new ResultType<object>(comparer.Address, comparer.Value)) |
1327 |
> |
{ |
1328 |
> |
second_tmp_Results.Add(_tmp_result); |
1329 |
> |
} |
1330 |
> |
} |
1331 |
> |
comparer = null; // free memory |
1332 |
|
} |
1333 |
|
else |
1334 |
|
{ |
1335 |
< |
value = Convert.ToUInt32(SearchArgs.CompareStartValue); |
1336 |
< |
comparer.Value = value; |
1337 |
< |
} |
1338 |
< |
if (comparer.Compare(lookup_value, value)) |
1339 |
< |
{ |
1340 |
< |
ResultType<object> _tmp_result = new ResultType<object>(comparer.Address, comparer.Value); |
1341 |
< |
second_tmp_Results.Add(_tmp_result); |
1342 |
< |
} |
1343 |
< |
comparer = null; // free memory |
1344 |
< |
} |
1345 |
< |
else |
1346 |
< |
{ |
1347 |
< |
int lookup_value = 0; |
1348 |
< |
using (GenericMemoryProvider gmp = new GenericMemoryProvider((IAcceptsProcessAndConfig)this)) { gmp.OpenProvider(); gmp.ReadMemory(address, out lookup_value); gmp.CloseProvider(); } |
1349 |
< |
_32bit_signed_comparer_ comparer = new _32bit_signed_comparer_(SearchArgs, address); |
1350 |
< |
int value = 0; |
1351 |
< |
if (SearchArgs.CompareValueType == CompareValueTypes.OldValue) |
1352 |
< |
{ |
1353 |
< |
value = reader.CurrentResult<int>(); |
1335 |
> |
sbyte lookup_value = 0; |
1336 |
> |
using (GenericMemoryProvider gmp = new GenericMemoryProvider((IAcceptsProcessAndConfig)this)) { gmp.OpenProvider(); gmp.ReadMemory(address, out lookup_value); gmp.CloseProvider(); } |
1337 |
> |
_8bit_signed_comparer_ comparer = new _8bit_signed_comparer_(SearchArgs, address); |
1338 |
> |
sbyte value = 0; |
1339 |
> |
if (SearchArgs.CompareValueType == CompareValueTypes.OldValue) |
1340 |
> |
{ |
1341 |
> |
value = Convert.ToSByte(result_value); |
1342 |
> |
} |
1343 |
> |
else |
1344 |
> |
{ |
1345 |
> |
value = Convert.ToSByte(SearchArgs.CompareStartValue); |
1346 |
> |
} |
1347 |
> |
if (comparer.Compare(lookup_value, value)) |
1348 |
> |
{ |
1349 |
> |
using (ResultType<object> _tmp_result = new ResultType<object>(comparer.Address, comparer.Value)) |
1350 |
> |
{ |
1351 |
> |
second_tmp_Results.Add(_tmp_result); |
1352 |
> |
} |
1353 |
> |
} |
1354 |
> |
comparer = null; // free memory |
1355 |
> |
} |
1356 |
> |
break; |
1357 |
> |
#endregion |
1358 |
> |
#region case SearchDataTypes._16bits: |
1359 |
> |
case SearchDataTypes._16bits: |
1360 |
> |
if (SearchArgs.IsUnsignedDataType) |
1361 |
> |
{ |
1362 |
> |
ushort lookup_value = 0; |
1363 |
> |
using (GenericMemoryProvider gmp = new GenericMemoryProvider((IAcceptsProcessAndConfig)this)) { gmp.OpenProvider(); gmp.ReadMemory(address, out lookup_value); gmp.CloseProvider(); } |
1364 |
> |
_16bit_unsigned_comparer_ comparer = new _16bit_unsigned_comparer_(SearchArgs, address); |
1365 |
> |
ushort value = 0; |
1366 |
> |
if (SearchArgs.CompareValueType == CompareValueTypes.OldValue) |
1367 |
> |
{ |
1368 |
> |
value = Convert.ToUInt16(result_value); |
1369 |
> |
comparer.Value = value; |
1370 |
> |
} |
1371 |
> |
else |
1372 |
> |
{ |
1373 |
> |
value = Convert.ToUInt16(SearchArgs.CompareStartValue); |
1374 |
> |
comparer.Value = value; |
1375 |
> |
} |
1376 |
> |
if (comparer.Compare(lookup_value, value)) |
1377 |
> |
{ |
1378 |
> |
using (ResultType<object> _tmp_result = new ResultType<object>(comparer.Address, comparer.Value)) |
1379 |
> |
{ |
1380 |
> |
second_tmp_Results.Add(_tmp_result); |
1381 |
> |
} |
1382 |
> |
} |
1383 |
> |
comparer = null; // free memory |
1384 |
|
} |
1385 |
|
else |
1386 |
|
{ |
1387 |
< |
value = Convert.ToInt32(SearchArgs.CompareStartValue); |
1388 |
< |
} |
1389 |
< |
if (comparer.Compare(lookup_value, value)) |
1390 |
< |
{ |
1391 |
< |
ResultType<object> _tmp_result = new ResultType<object>(comparer.Address, comparer.Value); |
1392 |
< |
second_tmp_Results.Add(_tmp_result); |
1393 |
< |
} |
1394 |
< |
comparer = null; // free memory |
1395 |
< |
} |
1396 |
< |
break; |
1397 |
< |
#endregion |
1398 |
< |
#region case SearchDataTypes._64bits: |
1399 |
< |
case SearchDataTypes._64bits: |
1400 |
< |
if (SearchArgs.IsUnsignedDataType) |
1401 |
< |
{ |
1402 |
< |
ulong lookup_value = 0; |
1403 |
< |
using (GenericMemoryProvider gmp = new GenericMemoryProvider((IAcceptsProcessAndConfig)this)) { gmp.OpenProvider(); gmp.ReadMemory(address, out lookup_value); gmp.CloseProvider(); } |
1404 |
< |
_64bit_unsigned_comparer_ comparer = new _64bit_unsigned_comparer_(SearchArgs, address); |
1405 |
< |
ulong value = 0; |
1406 |
< |
if (SearchArgs.CompareValueType == CompareValueTypes.OldValue) |
1407 |
< |
{ |
1408 |
< |
value = reader.CurrentResult<ulong>(); |
1409 |
< |
comparer.Value = value; |
1387 |
> |
short lookup_value = 0; |
1388 |
> |
using (GenericMemoryProvider gmp = new GenericMemoryProvider((IAcceptsProcessAndConfig)this)) { gmp.OpenProvider(); gmp.ReadMemory(address, out lookup_value); gmp.CloseProvider(); } |
1389 |
> |
_16bit_signed_comparer_ comparer = new _16bit_signed_comparer_(SearchArgs, address); |
1390 |
> |
short value = 0; |
1391 |
> |
if (SearchArgs.CompareValueType == CompareValueTypes.OldValue) |
1392 |
> |
{ |
1393 |
> |
value = Convert.ToInt16(result_value); |
1394 |
> |
} |
1395 |
> |
else |
1396 |
> |
{ |
1397 |
> |
value = Convert.ToInt16(SearchArgs.CompareStartValue); |
1398 |
> |
} |
1399 |
> |
if (comparer.Compare(lookup_value, value)) |
1400 |
> |
{ |
1401 |
> |
using (ResultType<object> _tmp_result = new ResultType<object>(comparer.Address, comparer.Value)) |
1402 |
> |
{ |
1403 |
> |
second_tmp_Results.Add(_tmp_result); |
1404 |
> |
} |
1405 |
> |
} |
1406 |
> |
comparer = null; // free memory |
1407 |
> |
} |
1408 |
> |
break; |
1409 |
> |
#endregion |
1410 |
> |
#region case SearchDataTypes._32bits: |
1411 |
> |
case SearchDataTypes._32bits: |
1412 |
> |
if (SearchArgs.IsUnsignedDataType) |
1413 |
> |
{ |
1414 |
> |
uint lookup_value = 0; |
1415 |
> |
using (GenericMemoryProvider gmp = new GenericMemoryProvider((IAcceptsProcessAndConfig)this)) |
1416 |
> |
{ |
1417 |
> |
try |
1418 |
> |
{ |
1419 |
> |
gmp.OpenProvider(); gmp.ReadMemory(address, out lookup_value); gmp.CloseProvider(); |
1420 |
> |
} |
1421 |
> |
catch (Exception ex) |
1422 |
> |
{ |
1423 |
> |
throw; |
1424 |
> |
} |
1425 |
> |
} |
1426 |
> |
_32bit_unsigned_comparer_ comparer = new _32bit_unsigned_comparer_(SearchArgs, address); |
1427 |
> |
uint value = 0; |
1428 |
> |
if (SearchArgs.CompareValueType == CompareValueTypes.OldValue) |
1429 |
> |
{ |
1430 |
> |
value = Convert.ToUInt32(result_value); |
1431 |
> |
comparer.Value = value; |
1432 |
> |
} |
1433 |
> |
else |
1434 |
> |
{ |
1435 |
> |
value = Convert.ToUInt32(SearchArgs.CompareStartValue); |
1436 |
> |
comparer.Value = value; |
1437 |
> |
} |
1438 |
> |
if (comparer.Compare(lookup_value, value)) |
1439 |
> |
{ |
1440 |
> |
using (ResultType<object> _tmp_result = new ResultType<object>(comparer.Address, comparer.Value)) |
1441 |
> |
{ |
1442 |
> |
second_tmp_Results.Add(_tmp_result); |
1443 |
> |
} |
1444 |
> |
} |
1445 |
> |
comparer = null; // free memory |
1446 |
|
} |
1447 |
|
else |
1448 |
|
{ |
1449 |
< |
value = Convert.ToUInt64(SearchArgs.CompareStartValue); |
1450 |
< |
comparer.Value = value; |
1451 |
< |
} |
1452 |
< |
if (comparer.Compare(lookup_value, value)) |
1453 |
< |
{ |
1454 |
< |
ResultType<object> _tmp_result = new ResultType<object>(comparer.Address, comparer.Value); |
1455 |
< |
second_tmp_Results.Add(_tmp_result); |
1456 |
< |
} |
1457 |
< |
comparer = null; // free memory |
1458 |
< |
} |
1459 |
< |
else |
1460 |
< |
{ |
1461 |
< |
long lookup_value = 0; |
1462 |
< |
using (GenericMemoryProvider gmp = new GenericMemoryProvider((IAcceptsProcessAndConfig)this)) { gmp.OpenProvider(); gmp.ReadMemory(address, out lookup_value); gmp.CloseProvider(); } |
1463 |
< |
_64bit_signed_comparer_ comparer = new _64bit_signed_comparer_(SearchArgs, address); |
1464 |
< |
long value = 0; |
1465 |
< |
if (SearchArgs.CompareValueType == CompareValueTypes.OldValue) |
1466 |
< |
{ |
1467 |
< |
value = reader.CurrentResult<long>(); |
1449 |
> |
int lookup_value = 0; |
1450 |
> |
using (GenericMemoryProvider gmp = new GenericMemoryProvider((IAcceptsProcessAndConfig)this)) { gmp.OpenProvider(); gmp.ReadMemory(address, out lookup_value); gmp.CloseProvider(); } |
1451 |
> |
_32bit_signed_comparer_ comparer = new _32bit_signed_comparer_(SearchArgs, address); |
1452 |
> |
int value = 0; |
1453 |
> |
if (SearchArgs.CompareValueType == CompareValueTypes.OldValue) |
1454 |
> |
{ |
1455 |
> |
value = Convert.ToInt32(result_value); |
1456 |
> |
} |
1457 |
> |
else |
1458 |
> |
{ |
1459 |
> |
value = Convert.ToInt32(SearchArgs.CompareStartValue); |
1460 |
> |
} |
1461 |
> |
if (comparer.Compare(lookup_value, value)) |
1462 |
> |
{ |
1463 |
> |
using (ResultType<object> _tmp_result = new ResultType<object>(comparer.Address, comparer.Value)) |
1464 |
> |
{ |
1465 |
> |
second_tmp_Results.Add(_tmp_result); |
1466 |
> |
} |
1467 |
> |
} |
1468 |
> |
comparer = null; // free memory |
1469 |
> |
} |
1470 |
> |
break; |
1471 |
> |
#endregion |
1472 |
> |
#region case SearchDataTypes._64bits: |
1473 |
> |
case SearchDataTypes._64bits: |
1474 |
> |
if (SearchArgs.IsUnsignedDataType) |
1475 |
> |
{ |
1476 |
> |
ulong lookup_value = 0; |
1477 |
> |
using (GenericMemoryProvider gmp = new GenericMemoryProvider((IAcceptsProcessAndConfig)this)) { gmp.OpenProvider(); gmp.ReadMemory(address, out lookup_value); gmp.CloseProvider(); } |
1478 |
> |
_64bit_unsigned_comparer_ comparer = new _64bit_unsigned_comparer_(SearchArgs, address); |
1479 |
> |
ulong value = 0; |
1480 |
> |
if (SearchArgs.CompareValueType == CompareValueTypes.OldValue) |
1481 |
> |
{ |
1482 |
> |
value = Convert.ToUInt64(result_value); |
1483 |
> |
comparer.Value = value; |
1484 |
> |
} |
1485 |
> |
else |
1486 |
> |
{ |
1487 |
> |
value = Convert.ToUInt64(SearchArgs.CompareStartValue); |
1488 |
> |
comparer.Value = value; |
1489 |
> |
} |
1490 |
> |
if (comparer.Compare(lookup_value, value)) |
1491 |
> |
{ |
1492 |
> |
using (ResultType<object> _tmp_result = new ResultType<object>(comparer.Address, comparer.Value)) |
1493 |
> |
{ |
1494 |
> |
second_tmp_Results.Add(_tmp_result); |
1495 |
> |
} |
1496 |
> |
} |
1497 |
> |
comparer = null; // free memory |
1498 |
|
} |
1499 |
|
else |
1500 |
|
{ |
1501 |
< |
value = Convert.ToInt64(SearchArgs.CompareStartValue); |
1502 |
< |
} |
1503 |
< |
if (comparer.Compare(lookup_value, value)) |
1501 |
> |
long lookup_value = 0; |
1502 |
> |
using (GenericMemoryProvider gmp = new GenericMemoryProvider((IAcceptsProcessAndConfig)this)) { gmp.OpenProvider(); gmp.ReadMemory(address, out lookup_value); gmp.CloseProvider(); } |
1503 |
> |
_64bit_signed_comparer_ comparer = new _64bit_signed_comparer_(SearchArgs, address); |
1504 |
> |
long value = 0; |
1505 |
> |
if (SearchArgs.CompareValueType == CompareValueTypes.OldValue) |
1506 |
> |
{ |
1507 |
> |
value = Convert.ToInt64(result_value); |
1508 |
> |
} |
1509 |
> |
else |
1510 |
> |
{ |
1511 |
> |
value = Convert.ToInt64(SearchArgs.CompareStartValue); |
1512 |
> |
} |
1513 |
> |
if (comparer.Compare(lookup_value, value)) |
1514 |
> |
{ |
1515 |
> |
using (ResultType<object> _tmp_result = new ResultType<object>(comparer.Address, comparer.Value)) |
1516 |
> |
{ |
1517 |
> |
second_tmp_Results.Add(_tmp_result); |
1518 |
> |
} |
1519 |
> |
} |
1520 |
> |
comparer = null; // free memory |
1521 |
> |
} |
1522 |
> |
break; |
1523 |
> |
#endregion |
1524 |
> |
#endregion |
1525 |
> |
} |
1526 |
> |
double double_percent_done = 100.0 * (double)((double)i / (double)reader.ResultCount); |
1527 |
> |
int int_percent_done = (int)double_percent_done; |
1528 |
> |
if (int_percent_done != Last_Whole_Percent_Done && i % 100000 == 0) |
1529 |
> |
{ |
1530 |
> |
if (int_percent_done <= 100) |
1531 |
> |
{ |
1532 |
> |
resultsprogress.Value = int_percent_done; |
1533 |
> |
resultsprogress.Message = string.Format(" -> Reading Address: 0x{0:x8}", i + MemoryRangeStart); |
1534 |
> |
Last_Whole_Percent_Done = int_percent_done; |
1535 |
> |
if (int_percent_done == 11) |
1536 |
|
{ |
1537 |
< |
ResultType<object> _tmp_result = new ResultType<object>(comparer.Address, comparer.Value); |
1434 |
< |
second_tmp_Results.Add(_tmp_result); |
1537 |
> |
int local_k = 0; |
1538 |
|
} |
1436 |
– |
comparer = null; // free memory |
1539 |
|
} |
1438 |
– |
break; |
1439 |
– |
#endregion |
1440 |
– |
#endregion |
1441 |
– |
} |
1442 |
– |
|
1443 |
– |
double double_percent_done = 100.0 * (double)((double)i / (double)reader.ResultCount); |
1444 |
– |
int int_percent_done = (int)double_percent_done; |
1445 |
– |
if (int_percent_done != Last_Whole_Percent_Done && i % 100000 == 0) |
1446 |
– |
{ |
1447 |
– |
if (int_percent_done <= 100) |
1448 |
– |
{ |
1449 |
– |
resultsprogress.Value = int_percent_done; |
1450 |
– |
resultsprogress.Message = string.Format(" -> Reading Address: 0x{0:x8}", i + MemoryRangeStart); |
1451 |
– |
Last_Whole_Percent_Done = int_percent_done; |
1540 |
|
} |
1541 |
|
} |
1454 |
– |
|
1542 |
|
} |
1543 |
|
} |
1544 |
+ |
catch (Exception ex) |
1545 |
+ |
{ |
1546 |
+ |
throw; |
1547 |
+ |
} |
1548 |
|
st_nonrange_search.Stop(); |
1549 |
|
logger.Profiler.WriteLine("Non-Ranged search took a total of {0} seconds to complete.", st_nonrange_search.Elapsed.TotalSeconds); |
1550 |
|
Last_Whole_Percent_Done = 0; |
1563 |
|
{ |
1564 |
|
for (int i = 0; i < reader.ResultCount; i += 1) |
1565 |
|
{ |
1566 |
< |
uint address = reader.CurrentAddress(); |
1566 |
> |
uint address = 0; |
1567 |
> |
#region switch (SearchArgs.DataType) |
1568 |
> |
switch (SearchArgs.DataType) |
1569 |
> |
{ |
1570 |
> |
case SearchDataTypes._8bits: if (unsigned) { using (ResultType<byte> result = reader.GetNextResult<byte>()) { address = result.Address; } } |
1571 |
> |
else { using (ResultType<sbyte> result = reader.GetNextResult<sbyte>()) { address = result.Address; } } break; |
1572 |
> |
case SearchDataTypes._16bits: if (unsigned) { using (ResultType<ushort> result = reader.GetNextResult<ushort>()) { address = result.Address; } } |
1573 |
> |
else { using (ResultType<short> result = reader.GetNextResult<short>()) { address = result.Address; } } break; |
1574 |
> |
case SearchDataTypes._32bits: if (unsigned) { using (ResultType<uint> result = reader.GetNextResult<uint>()) { address = result.Address; } } |
1575 |
> |
else { using (ResultType<int> result = reader.GetNextResult<int>()) { address = result.Address; } } break; |
1576 |
> |
case SearchDataTypes._64bits: if (unsigned) { using (ResultType<ulong> result = reader.GetNextResult<ulong>()) { address = result.Address; } } |
1577 |
> |
else { using (ResultType<long> result = reader.GetNextResult<long>()) { address = result.Address; } } break; |
1578 |
> |
} |
1579 |
> |
#endregion |
1580 |
> |
|
1581 |
|
if (MemoryRangeStart > 0 && !SearchArgs.IsFirstSearch) { address = address - MemoryRangeStart; } |
1582 |
|
//r_ms.BaseStream.Seek(address, SeekOrigin.Begin); |
1583 |
|
if (SearchArgs.CompareType == SearchCompareTypes.Between) |
1585 |
|
InRangeComparer comparer = new InRangeComparer(address, 0); |
1586 |
|
if (comparer.Compare(start, end, SearchArgs.DataType, SearchArgs.IsUnsignedDataType, (IAcceptsProcessAndConfig)this)) |
1587 |
|
{ |
1588 |
< |
ResultType<object> _tmp_result = new ResultType<object>(comparer.Address, comparer.Value); |
1589 |
< |
second_tmp_Results.Add(_tmp_result); |
1588 |
> |
using (ResultType<object> _tmp_result = new ResultType<object>(comparer.Address, comparer.Value)) |
1589 |
> |
{ |
1590 |
> |
second_tmp_Results.Add(_tmp_result); |
1591 |
> |
} |
1592 |
|
} |
1593 |
|
comparer = null; |
1594 |
|
} |
1597 |
|
NotInRangeComparer comparer = new NotInRangeComparer(address, 0); |
1598 |
|
if (comparer.Compare(start, end, SearchArgs.DataType, SearchArgs.IsUnsignedDataType, (IAcceptsProcessAndConfig)this)) |
1599 |
|
{ |
1600 |
< |
ResultType<object> _tmp_result = new ResultType<object>(comparer.Address, comparer.Value); |
1601 |
< |
second_tmp_Results.Add(_tmp_result); |
1600 |
> |
using (ResultType<object> _tmp_result = new ResultType<object>(comparer.Address, comparer.Value)) |
1601 |
> |
{ |
1602 |
> |
second_tmp_Results.Add(_tmp_result); |
1603 |
> |
} |
1604 |
|
} |
1605 |
|
comparer = null; |
1606 |
|
} |
1618 |
|
resultsprogress.Message = string.Format(" -> Reading Address: 0x{0:x8}", i + MemoryRangeStart); |
1619 |
|
Last_Whole_Percent_Done = int_percent_done; |
1620 |
|
} |
1621 |
+ |
if (int_percent_done == 11) |
1622 |
+ |
{ |
1623 |
+ |
int local_k = 0; |
1624 |
+ |
} |
1625 |
|
} |
1626 |
|
} |
1627 |
|
} |
1684 |
|
} |
1685 |
|
|
1686 |
|
resultsprogress.Value = 100; |
1687 |
< |
|
1687 |
> |
bool unsigned = SearchArgs.IsUnsignedDataType; |
1688 |
|
using (SearchResultReader reader = new SearchResultReader()) |
1689 |
|
{ |
1690 |
|
|
1691 |
+ |
object result_value = 0; |
1692 |
+ |
uint address = 0; |
1693 |
+ |
switch (SearchArgs.DataType) |
1694 |
+ |
{ |
1695 |
+ |
case SearchDataTypes._8bits: if (unsigned) |
1696 |
+ |
{ |
1697 |
+ |
using (ResultType<byte> result = reader.GetNextResult<byte>()) |
1698 |
+ |
{ |
1699 |
+ |
address = result.Address; |
1700 |
+ |
result_value = result.Value; |
1701 |
+ |
} |
1702 |
+ |
} |
1703 |
+ |
else |
1704 |
+ |
{ |
1705 |
+ |
using (ResultType<sbyte> result = reader.GetNextResult<sbyte>()) |
1706 |
+ |
{ |
1707 |
+ |
address = result.Address; |
1708 |
+ |
result_value = result.Value; |
1709 |
+ |
} |
1710 |
+ |
} break; |
1711 |
+ |
case SearchDataTypes._16bits: if (unsigned) |
1712 |
+ |
{ |
1713 |
+ |
using (ResultType<ushort> result = reader.GetNextResult<ushort>()) |
1714 |
+ |
{ |
1715 |
+ |
address = result.Address; |
1716 |
+ |
result_value = result.Value; |
1717 |
+ |
} |
1718 |
+ |
} |
1719 |
+ |
else |
1720 |
+ |
{ |
1721 |
+ |
using (ResultType<short> result = reader.GetNextResult<short>()) |
1722 |
+ |
{ |
1723 |
+ |
address = result.Address; |
1724 |
+ |
result_value = result.Value; |
1725 |
+ |
} |
1726 |
+ |
} break; |
1727 |
+ |
case SearchDataTypes._32bits: if (unsigned) |
1728 |
+ |
{ |
1729 |
+ |
using (ResultType<uint> result = reader.GetNextResult<uint>()) |
1730 |
+ |
{ |
1731 |
+ |
address = result.Address; |
1732 |
+ |
result_value = result.Value; |
1733 |
+ |
} |
1734 |
+ |
} |
1735 |
+ |
else |
1736 |
+ |
{ |
1737 |
+ |
using (ResultType<int> result = reader.GetNextResult<int>()) |
1738 |
+ |
{ |
1739 |
+ |
address = result.Address; |
1740 |
+ |
result_value = result.Value; |
1741 |
+ |
} |
1742 |
+ |
} break; |
1743 |
+ |
case SearchDataTypes._64bits: if (unsigned) |
1744 |
+ |
{ |
1745 |
+ |
using (ResultType<ulong> result = reader.GetNextResult<ulong>()) |
1746 |
+ |
{ |
1747 |
+ |
address = result.Address; |
1748 |
+ |
result_value = result.Value; |
1749 |
+ |
} |
1750 |
+ |
} |
1751 |
+ |
else |
1752 |
+ |
{ |
1753 |
+ |
using (ResultType<long> result = reader.GetNextResult<long>()) |
1754 |
+ |
{ |
1755 |
+ |
address = result.Address; |
1756 |
+ |
result_value = result.Value; |
1757 |
+ |
} |
1758 |
+ |
} break; |
1759 |
+ |
} |
1760 |
+ |
|
1761 |
+ |
|
1762 |
+ |
|
1763 |
|
logger.Debug.WriteLine(string.Format("Results Count -> 0x{0:x8}", reader.ResultCount)); |
1764 |
|
|
1765 |
|
|
1766 |
|
if (reader.ResultCount == 1) // debug message for 1 result using 32bit unsigned |
1767 |
< |
logger.Debug.WriteLine(string.Format("Debug: Found 1 result -> Address: 0x{0:x8} Value: 0x{1:x16}", reader.CurrentAddress(), reader.CurrentResult<ulong>())); |
1767 |
> |
logger.Debug.WriteLine(string.Format("Debug: Found 1 result -> Address: 0x{0:x8} Value: 0x{1:x16}", address, result_value)); |
1768 |
|
|
1769 |
|
logger.Info.WriteLine(string.Format("Found 0x{0:x8} results", reader.ResultCount)); |
1770 |
|
|
1781 |
|
{ |
1782 |
|
|
1783 |
|
case SearchDataTypes._8bits: |
1784 |
< |
if (SearchArgs.IsUnsignedDataType) { item = new ResultItem(reader.CurrentAddress(), false, reader.CurrentResult<byte>()); } |
1785 |
< |
else { item = new ResultItem(reader.CurrentAddress(), false, reader.CurrentResult<sbyte>()); } |
1784 |
> |
if (SearchArgs.IsUnsignedDataType) { ResultType<byte> result = reader.GetNextResult<byte>(); item = new ResultItem(result.Address, false, result.Value); } |
1785 |
> |
else { ResultType<sbyte> result = reader.GetNextResult<sbyte>(); item = new ResultItem(result.Address, false, result.Value); } |
1786 |
|
break; |
1787 |
|
case SearchDataTypes._16bits: |
1788 |
< |
if (SearchArgs.IsUnsignedDataType) { item = new ResultItem(reader.CurrentAddress(), false, reader.CurrentResult<ushort>()); } |
1789 |
< |
else { item = new ResultItem(reader.CurrentAddress(), false, reader.CurrentResult<short>()); } |
1788 |
> |
if (SearchArgs.IsUnsignedDataType) { ResultType<ushort> result = reader.GetNextResult<ushort>(); item = new ResultItem(result.Address, false, result.Value); } |
1789 |
> |
else { ResultType<short> result = reader.GetNextResult<short>(); item = new ResultItem(result.Address, false, result.Value); } |
1790 |
|
break; |
1791 |
|
case SearchDataTypes._32bits: |
1792 |
< |
if (SearchArgs.IsUnsignedDataType) { item = new ResultItem(reader.CurrentAddress(), false, reader.CurrentResult<uint>()); } |
1793 |
< |
else { item = new ResultItem(reader.CurrentAddress(), false, reader.CurrentResult<int>()); } |
1792 |
> |
if (SearchArgs.IsUnsignedDataType) { ResultType<uint> result = reader.GetNextResult<uint>(); item = new ResultItem(result.Address, false, result.Value); } |
1793 |
> |
else { ResultType<int> result = reader.GetNextResult<int>(); item = new ResultItem(result.Address, false, result.Value); } |
1794 |
|
break; |
1795 |
|
case SearchDataTypes._64bits: |
1796 |
< |
if (SearchArgs.IsUnsignedDataType) { item = new ResultItem(reader.CurrentAddress(), false, reader.CurrentResult<ulong>()); } |
1797 |
< |
else { item = new ResultItem(reader.CurrentAddress(), false, reader.CurrentResult<long>()); } |
1796 |
> |
if (SearchArgs.IsUnsignedDataType) { ResultType<ulong> result = reader.GetNextResult<ulong>(); item = new ResultItem(result.Address, false, result.Value); } |
1797 |
> |
else { ResultType<long> result = reader.GetNextResult<long>(); item = new ResultItem(result.Address, false, result.Value); } |
1798 |
|
break; |
1799 |
|
} |
1800 |
|
|