2191 |
|
} |
2192 |
|
else |
2193 |
|
{ |
2194 |
+ |
Guid new_SearchGuid = SearchGuid; |
2195 |
|
// need to get the address list |
2196 |
|
using (SearchResultReader reader = new SearchResultReader(SearchGuid, false)) // delete the file on dispose |
2197 |
|
{ |
2268 |
|
//} |
2269 |
|
//SearchGuid = new_SearchGuid; |
2270 |
|
#endregion |
2271 |
< |
|
2272 |
< |
byte[] guid = SearchGuid.ToByteArray(); |
2273 |
< |
guid[guid.Length - 1]++; // increment the search guid by 1 |
2274 |
< |
Guid new_SearchGuid = new Guid(guid); |
2275 |
< |
|
2275 |
< |
foreach(var k in reader.GetResults(SearchArgs.IsUnsignedDataType,SearchArgs.DataType,new Action<int,string>(UpdateProgress))) |
2276 |
< |
{ |
2277 |
< |
provider.OpenProvider(); |
2278 |
< |
int bytesRead=0; |
2279 |
< |
byte[] data = new byte[STEP_SIZE]; |
2280 |
< |
provider.ReadProcessMemory(k.Address, STEP_SIZE, out bytesRead, out data); |
2281 |
< |
provider.CloseProvider(); |
2282 |
< |
|
2283 |
< |
uint address_index = k.Address; |
2284 |
< |
#region comparison and serialization |
2285 |
< |
switch (sdt) |
2271 |
> |
|
2272 |
> |
new_SearchGuid = GuidTools.IncrementGuid(SearchGuid); |
2273 |
> |
using (SearchResultWriter writer = new SearchResultWriter(0, new_SearchGuid)) |
2274 |
> |
{ |
2275 |
> |
foreach (var k in reader.GetResults(SearchArgs.IsUnsignedDataType, SearchArgs.DataType, new Action<int, string>(UpdateProgress))) |
2276 |
|
{ |
2277 |
< |
case SearchDataTypes._8bits: |
2278 |
< |
if (unsigned) |
2279 |
< |
{ |
2280 |
< |
#region 8bits - unsigned |
2281 |
< |
var t_data = BitTools.ConvertByteArray<byte>(data); |
2282 |
< |
foreach (var Value in t_data) |
2277 |
> |
provider.OpenProvider(); |
2278 |
> |
int bytesRead = 0; |
2279 |
> |
byte[] data = new byte[STEP_SIZE]; |
2280 |
> |
provider.ReadProcessMemory(k.Address, STEP_SIZE, out bytesRead, out data); |
2281 |
> |
provider.CloseProvider(); |
2282 |
> |
|
2283 |
> |
uint address_index = k.Address; |
2284 |
> |
#region comparison and serialization |
2285 |
> |
switch (sdt) |
2286 |
> |
{ |
2287 |
> |
case SearchDataTypes._8bits: |
2288 |
> |
if (unsigned) |
2289 |
|
{ |
2290 |
< |
if (SearchWorkerThread.CancellationPending) { break; } |
2291 |
< |
using (_8bit_unsigned_comparer_ comparer = new _8bit_unsigned_comparer_(SearchArgs, address_index)) |
2290 |
> |
#region 8bits - unsigned |
2291 |
> |
var t_data = BitTools.ConvertByteArray<byte>(data); |
2292 |
> |
foreach (var Value in t_data) |
2293 |
|
{ |
2294 |
< |
byte value = 0; |
2295 |
< |
if (SearchArgs.CompareValueType == CompareValueTypes.OldValue) |
2294 |
> |
if (SearchWorkerThread.CancellationPending) { break; } |
2295 |
> |
using (_8bit_unsigned_comparer_ comparer = new _8bit_unsigned_comparer_(SearchArgs, address_index)) |
2296 |
|
{ |
2297 |
< |
using (GenericMemoryProvider gmp = new GenericMemoryProvider((IAcceptsProcessAndConfig)this)) |
2297 |
> |
byte value = 0; |
2298 |
> |
if (SearchArgs.CompareValueType == CompareValueTypes.OldValue) |
2299 |
|
{ |
2300 |
< |
try |
2300 |
> |
using (GenericMemoryProvider gmp = new GenericMemoryProvider((IAcceptsProcessAndConfig)this)) |
2301 |
|
{ |
2302 |
< |
gmp.OpenProvider(); |
2303 |
< |
gmp.ReadMemory(address_index, out value); |
2304 |
< |
gmp.CloseProvider(); |
2305 |
< |
} |
2306 |
< |
catch (Exception ex) |
2307 |
< |
{ |
2308 |
< |
logger.VerboseError.WriteLine(ex.ToString()); |
2302 |
> |
try |
2303 |
> |
{ |
2304 |
> |
gmp.OpenProvider(); |
2305 |
> |
gmp.ReadMemory(address_index, out value); |
2306 |
> |
gmp.CloseProvider(); |
2307 |
> |
} |
2308 |
> |
catch (Exception ex) |
2309 |
> |
{ |
2310 |
> |
logger.VerboseError.WriteLine(ex.ToString()); |
2311 |
> |
} |
2312 |
|
} |
2313 |
+ |
comparer.Value = value; |
2314 |
+ |
} |
2315 |
+ |
else |
2316 |
+ |
{ |
2317 |
+ |
value = Convert.ToByte(SearchArgs.CompareStartValue); |
2318 |
+ |
comparer.Value = value; |
2319 |
+ |
} |
2320 |
+ |
if (comparer.Compare(Convert.ToByte(Value), value)) |
2321 |
+ |
{ |
2322 |
+ |
writer.WriteResult<byte>(comparer.Address, comparer.Value); |
2323 |
|
} |
2313 |
– |
comparer.Value = value; |
2314 |
– |
} |
2315 |
– |
else |
2316 |
– |
{ |
2317 |
– |
value = Convert.ToByte(SearchArgs.CompareStartValue); |
2318 |
– |
comparer.Value = value; |
2319 |
– |
} |
2320 |
– |
if (comparer.Compare(Convert.ToByte(Value), value)) |
2321 |
– |
{ |
2322 |
– |
writer.WriteResult<byte>(comparer.Address, comparer.Value); |
2324 |
|
} |
2325 |
+ |
address_index += STEP_SIZE; |
2326 |
|
} |
2327 |
< |
address_index += STEP_SIZE; |
2327 |
> |
#endregion |
2328 |
|
} |
2329 |
< |
#endregion |
2328 |
< |
} |
2329 |
< |
else |
2330 |
< |
{ |
2331 |
< |
#region 8bits - signed |
2332 |
< |
var t_data = BitTools.ConvertByteArray<sbyte>(data); |
2333 |
< |
foreach (var Value in t_data) |
2329 |
> |
else |
2330 |
|
{ |
2331 |
< |
if (SearchWorkerThread.CancellationPending) { break; } |
2332 |
< |
using (_8bit_signed_comparer_ comparer = new _8bit_signed_comparer_(SearchArgs, address_index)) |
2331 |
> |
#region 8bits - signed |
2332 |
> |
var t_data = BitTools.ConvertByteArray<sbyte>(data); |
2333 |
> |
foreach (var Value in t_data) |
2334 |
|
{ |
2335 |
< |
sbyte value = 0; |
2336 |
< |
if (SearchArgs.CompareValueType == CompareValueTypes.OldValue) |
2335 |
> |
if (SearchWorkerThread.CancellationPending) { break; } |
2336 |
> |
using (_8bit_signed_comparer_ comparer = new _8bit_signed_comparer_(SearchArgs, address_index)) |
2337 |
|
{ |
2338 |
< |
using (GenericMemoryProvider gmp = new GenericMemoryProvider((IAcceptsProcessAndConfig)this)) |
2338 |
> |
sbyte value = 0; |
2339 |
> |
if (SearchArgs.CompareValueType == CompareValueTypes.OldValue) |
2340 |
|
{ |
2341 |
< |
try |
2341 |
> |
using (GenericMemoryProvider gmp = new GenericMemoryProvider((IAcceptsProcessAndConfig)this)) |
2342 |
|
{ |
2343 |
< |
gmp.OpenProvider(); |
2344 |
< |
gmp.ReadMemory(address_index, out value); |
2345 |
< |
gmp.CloseProvider(); |
2346 |
< |
} |
2347 |
< |
catch (Exception ex) |
2348 |
< |
{ |
2349 |
< |
logger.VerboseError.WriteLine(ex.ToString()); |
2343 |
> |
try |
2344 |
> |
{ |
2345 |
> |
gmp.OpenProvider(); |
2346 |
> |
gmp.ReadMemory(address_index, out value); |
2347 |
> |
gmp.CloseProvider(); |
2348 |
> |
} |
2349 |
> |
catch (Exception ex) |
2350 |
> |
{ |
2351 |
> |
logger.VerboseError.WriteLine(ex.ToString()); |
2352 |
> |
} |
2353 |
|
} |
2354 |
+ |
comparer.Value = value; |
2355 |
+ |
} |
2356 |
+ |
else |
2357 |
+ |
{ |
2358 |
+ |
value = Convert.ToSByte(SearchArgs.CompareStartValue); |
2359 |
+ |
comparer.Value = value; |
2360 |
+ |
} |
2361 |
+ |
if (comparer.Compare(Convert.ToSByte(Value), value)) |
2362 |
+ |
{ |
2363 |
+ |
writer.WriteResult<sbyte>(comparer.Address, comparer.Value); |
2364 |
|
} |
2354 |
– |
comparer.Value = value; |
2355 |
– |
} |
2356 |
– |
else |
2357 |
– |
{ |
2358 |
– |
value = Convert.ToSByte(SearchArgs.CompareStartValue); |
2359 |
– |
comparer.Value = value; |
2360 |
– |
} |
2361 |
– |
if (comparer.Compare(Convert.ToSByte(Value), value)) |
2362 |
– |
{ |
2363 |
– |
writer.WriteResult<sbyte>(comparer.Address, comparer.Value); |
2365 |
|
} |
2366 |
+ |
address_index += STEP_SIZE; |
2367 |
|
} |
2368 |
< |
address_index += STEP_SIZE; |
2369 |
< |
} |
2370 |
< |
#endregion |
2371 |
< |
} break; |
2370 |
< |
case SearchDataTypes._16bits: |
2371 |
< |
if (unsigned) |
2372 |
< |
{ |
2373 |
< |
#region 16bits - unsigned |
2374 |
< |
var t_data = BitTools.ConvertByteArray<ushort>(data); |
2375 |
< |
foreach (var Value in t_data) |
2368 |
> |
#endregion |
2369 |
> |
} break; |
2370 |
> |
case SearchDataTypes._16bits: |
2371 |
> |
if (unsigned) |
2372 |
|
{ |
2373 |
< |
if (SearchWorkerThread.CancellationPending) { break; } |
2374 |
< |
using (_16bit_unsigned_comparer_ comparer = new _16bit_unsigned_comparer_(SearchArgs, address_index)) |
2373 |
> |
#region 16bits - unsigned |
2374 |
> |
var t_data = BitTools.ConvertByteArray<ushort>(data); |
2375 |
> |
foreach (var Value in t_data) |
2376 |
|
{ |
2377 |
< |
ushort value = 0; |
2378 |
< |
if (SearchArgs.CompareValueType == CompareValueTypes.OldValue) |
2377 |
> |
if (SearchWorkerThread.CancellationPending) { break; } |
2378 |
> |
using (_16bit_unsigned_comparer_ comparer = new _16bit_unsigned_comparer_(SearchArgs, address_index)) |
2379 |
|
{ |
2380 |
< |
using (GenericMemoryProvider gmp = new GenericMemoryProvider((IAcceptsProcessAndConfig)this)) |
2380 |
> |
ushort value = 0; |
2381 |
> |
if (SearchArgs.CompareValueType == CompareValueTypes.OldValue) |
2382 |
|
{ |
2383 |
< |
try |
2386 |
< |
{ |
2387 |
< |
gmp.OpenProvider(); |
2388 |
< |
gmp.ReadMemory(address_index, out value); |
2389 |
< |
gmp.CloseProvider(); |
2390 |
< |
} |
2391 |
< |
catch (Exception ex) |
2383 |
> |
using (GenericMemoryProvider gmp = new GenericMemoryProvider((IAcceptsProcessAndConfig)this)) |
2384 |
|
{ |
2385 |
< |
logger.VerboseError.WriteLine(ex.ToString()); |
2385 |
> |
try |
2386 |
> |
{ |
2387 |
> |
gmp.OpenProvider(); |
2388 |
> |
gmp.ReadMemory(address_index, out value); |
2389 |
> |
gmp.CloseProvider(); |
2390 |
> |
} |
2391 |
> |
catch (Exception ex) |
2392 |
> |
{ |
2393 |
> |
logger.VerboseError.WriteLine(ex.ToString()); |
2394 |
> |
} |
2395 |
|
} |
2396 |
+ |
comparer.Value = value; |
2397 |
+ |
} |
2398 |
+ |
else |
2399 |
+ |
{ |
2400 |
+ |
value = Convert.ToUInt16(SearchArgs.CompareStartValue); |
2401 |
+ |
comparer.Value = value; |
2402 |
+ |
} |
2403 |
+ |
if (comparer.Compare(Convert.ToUInt16(Value), value)) |
2404 |
+ |
{ |
2405 |
+ |
writer.WriteResult<ushort>(comparer.Address, comparer.Value); |
2406 |
|
} |
2396 |
– |
comparer.Value = value; |
2397 |
– |
} |
2398 |
– |
else |
2399 |
– |
{ |
2400 |
– |
value = Convert.ToUInt16(SearchArgs.CompareStartValue); |
2401 |
– |
comparer.Value = value; |
2402 |
– |
} |
2403 |
– |
if (comparer.Compare(Convert.ToUInt16(Value), value)) |
2404 |
– |
{ |
2405 |
– |
writer.WriteResult<ushort>(comparer.Address, comparer.Value); |
2407 |
|
} |
2408 |
+ |
address_index += STEP_SIZE; |
2409 |
|
} |
2410 |
< |
address_index += STEP_SIZE; |
2410 |
> |
#endregion |
2411 |
|
} |
2412 |
< |
#endregion |
2411 |
< |
} |
2412 |
< |
else |
2413 |
< |
{ |
2414 |
< |
#region 16bits - signed |
2415 |
< |
var t_data = BitTools.ConvertByteArray<short>(data); |
2416 |
< |
foreach (var Value in t_data) |
2412 |
> |
else |
2413 |
|
{ |
2414 |
< |
if (SearchWorkerThread.CancellationPending) { break; } |
2415 |
< |
using (_16bit_signed_comparer_ comparer = new _16bit_signed_comparer_(SearchArgs, address_index)) |
2414 |
> |
#region 16bits - signed |
2415 |
> |
var t_data = BitTools.ConvertByteArray<short>(data); |
2416 |
> |
foreach (var Value in t_data) |
2417 |
|
{ |
2418 |
< |
short value = 0; |
2419 |
< |
if (SearchArgs.CompareValueType == CompareValueTypes.OldValue) |
2418 |
> |
if (SearchWorkerThread.CancellationPending) { break; } |
2419 |
> |
using (_16bit_signed_comparer_ comparer = new _16bit_signed_comparer_(SearchArgs, address_index)) |
2420 |
|
{ |
2421 |
< |
using (GenericMemoryProvider gmp = new GenericMemoryProvider((IAcceptsProcessAndConfig)this)) |
2421 |
> |
short value = 0; |
2422 |
> |
if (SearchArgs.CompareValueType == CompareValueTypes.OldValue) |
2423 |
|
{ |
2424 |
< |
try |
2427 |
< |
{ |
2428 |
< |
gmp.OpenProvider(); |
2429 |
< |
gmp.ReadMemory(address_index, out value); |
2430 |
< |
gmp.CloseProvider(); |
2431 |
< |
} |
2432 |
< |
catch (Exception ex) |
2424 |
> |
using (GenericMemoryProvider gmp = new GenericMemoryProvider((IAcceptsProcessAndConfig)this)) |
2425 |
|
{ |
2426 |
< |
logger.VerboseError.WriteLine(ex.ToString()); |
2426 |
> |
try |
2427 |
> |
{ |
2428 |
> |
gmp.OpenProvider(); |
2429 |
> |
gmp.ReadMemory(address_index, out value); |
2430 |
> |
gmp.CloseProvider(); |
2431 |
> |
} |
2432 |
> |
catch (Exception ex) |
2433 |
> |
{ |
2434 |
> |
logger.VerboseError.WriteLine(ex.ToString()); |
2435 |
> |
} |
2436 |
|
} |
2437 |
+ |
comparer.Value = value; |
2438 |
+ |
} |
2439 |
+ |
else |
2440 |
+ |
{ |
2441 |
+ |
value = Convert.ToInt16(SearchArgs.CompareStartValue); |
2442 |
+ |
comparer.Value = value; |
2443 |
+ |
} |
2444 |
+ |
if (comparer.Compare(Convert.ToSByte(Value), value)) |
2445 |
+ |
{ |
2446 |
+ |
writer.WriteResult<short>(comparer.Address, comparer.Value); |
2447 |
|
} |
2437 |
– |
comparer.Value = value; |
2438 |
– |
} |
2439 |
– |
else |
2440 |
– |
{ |
2441 |
– |
value = Convert.ToInt16(SearchArgs.CompareStartValue); |
2442 |
– |
comparer.Value = value; |
2443 |
– |
} |
2444 |
– |
if (comparer.Compare(Convert.ToSByte(Value), value)) |
2445 |
– |
{ |
2446 |
– |
writer.WriteResult<short>(comparer.Address, comparer.Value); |
2448 |
|
} |
2449 |
+ |
address_index += STEP_SIZE; |
2450 |
|
} |
2451 |
< |
address_index += STEP_SIZE; |
2452 |
< |
} |
2453 |
< |
#endregion |
2454 |
< |
} break; |
2453 |
< |
case SearchDataTypes._32bits: |
2454 |
< |
if (unsigned) |
2455 |
< |
{ |
2456 |
< |
#region 32bits - unsigned |
2457 |
< |
var t_data = BitTools.ConvertByteArray<uint>(data); |
2458 |
< |
foreach (var Value in t_data) |
2451 |
> |
#endregion |
2452 |
> |
} break; |
2453 |
> |
case SearchDataTypes._32bits: |
2454 |
> |
if (unsigned) |
2455 |
|
{ |
2456 |
< |
if (SearchWorkerThread.CancellationPending) { break; } |
2457 |
< |
using (_32bit_unsigned_comparer_ comparer = new _32bit_unsigned_comparer_(SearchArgs, address_index)) |
2456 |
> |
#region 32bits - unsigned |
2457 |
> |
var t_data = BitTools.ConvertByteArray<uint>(data); |
2458 |
> |
foreach (var Value in t_data) |
2459 |
|
{ |
2460 |
< |
uint value = 0; |
2461 |
< |
if (SearchArgs.CompareValueType == CompareValueTypes.OldValue) |
2460 |
> |
if (SearchWorkerThread.CancellationPending) { break; } |
2461 |
> |
using (_32bit_unsigned_comparer_ comparer = new _32bit_unsigned_comparer_(SearchArgs, address_index)) |
2462 |
|
{ |
2463 |
< |
using (GenericMemoryProvider gmp = new GenericMemoryProvider((IAcceptsProcessAndConfig)this)) |
2463 |
> |
uint value = 0; |
2464 |
> |
if (SearchArgs.CompareValueType == CompareValueTypes.OldValue) |
2465 |
|
{ |
2466 |
< |
try |
2469 |
< |
{ |
2470 |
< |
gmp.OpenProvider(); |
2471 |
< |
gmp.ReadMemory(address_index, out value); |
2472 |
< |
gmp.CloseProvider(); |
2473 |
< |
} |
2474 |
< |
catch (Exception ex) |
2466 |
> |
using (GenericMemoryProvider gmp = new GenericMemoryProvider((IAcceptsProcessAndConfig)this)) |
2467 |
|
{ |
2468 |
< |
logger.VerboseError.WriteLine(ex.ToString()); |
2468 |
> |
try |
2469 |
> |
{ |
2470 |
> |
gmp.OpenProvider(); |
2471 |
> |
gmp.ReadMemory(address_index, out value); |
2472 |
> |
gmp.CloseProvider(); |
2473 |
> |
} |
2474 |
> |
catch (Exception ex) |
2475 |
> |
{ |
2476 |
> |
logger.VerboseError.WriteLine(ex.ToString()); |
2477 |
> |
} |
2478 |
|
} |
2479 |
+ |
comparer.Value = value; |
2480 |
+ |
} |
2481 |
+ |
else |
2482 |
+ |
{ |
2483 |
+ |
value = Convert.ToUInt32(SearchArgs.CompareStartValue); |
2484 |
+ |
comparer.Value = value; |
2485 |
+ |
} |
2486 |
+ |
if (comparer.Compare(Convert.ToUInt32(Value), value)) |
2487 |
+ |
{ |
2488 |
+ |
writer.WriteResult<uint>(comparer.Address, comparer.Value); |
2489 |
|
} |
2479 |
– |
comparer.Value = value; |
2480 |
– |
} |
2481 |
– |
else |
2482 |
– |
{ |
2483 |
– |
value = Convert.ToUInt32(SearchArgs.CompareStartValue); |
2484 |
– |
comparer.Value = value; |
2485 |
– |
} |
2486 |
– |
if (comparer.Compare(Convert.ToUInt32(Value), value)) |
2487 |
– |
{ |
2488 |
– |
writer.WriteResult<uint>(comparer.Address, comparer.Value); |
2490 |
|
} |
2491 |
+ |
address_index += STEP_SIZE; |
2492 |
|
} |
2493 |
< |
address_index += STEP_SIZE; |
2493 |
> |
#endregion |
2494 |
|
} |
2495 |
< |
#endregion |
2494 |
< |
} |
2495 |
< |
else |
2496 |
< |
{ |
2497 |
< |
#region 32bits - signed |
2498 |
< |
var t_data = BitTools.ConvertByteArray<int>(data); |
2499 |
< |
foreach (var Value in t_data) |
2495 |
> |
else |
2496 |
|
{ |
2497 |
< |
if (SearchWorkerThread.CancellationPending) { break; } |
2498 |
< |
using (_32bit_signed_comparer_ comparer = new _32bit_signed_comparer_(SearchArgs, address_index)) |
2497 |
> |
#region 32bits - signed |
2498 |
> |
var t_data = BitTools.ConvertByteArray<int>(data); |
2499 |
> |
foreach (var Value in t_data) |
2500 |
|
{ |
2501 |
< |
int value = 0; |
2502 |
< |
if (SearchArgs.CompareValueType == CompareValueTypes.OldValue) |
2501 |
> |
if (SearchWorkerThread.CancellationPending) { break; } |
2502 |
> |
using (_32bit_signed_comparer_ comparer = new _32bit_signed_comparer_(SearchArgs, address_index)) |
2503 |
|
{ |
2504 |
< |
using (GenericMemoryProvider gmp = new GenericMemoryProvider((IAcceptsProcessAndConfig)this)) |
2504 |
> |
int value = 0; |
2505 |
> |
if (SearchArgs.CompareValueType == CompareValueTypes.OldValue) |
2506 |
|
{ |
2507 |
< |
try |
2510 |
< |
{ |
2511 |
< |
gmp.OpenProvider(); |
2512 |
< |
gmp.ReadMemory(address_index, out value); |
2513 |
< |
gmp.CloseProvider(); |
2514 |
< |
} |
2515 |
< |
catch (Exception ex) |
2507 |
> |
using (GenericMemoryProvider gmp = new GenericMemoryProvider((IAcceptsProcessAndConfig)this)) |
2508 |
|
{ |
2509 |
< |
logger.VerboseError.WriteLine(ex.ToString()); |
2509 |
> |
try |
2510 |
> |
{ |
2511 |
> |
gmp.OpenProvider(); |
2512 |
> |
gmp.ReadMemory(address_index, out value); |
2513 |
> |
gmp.CloseProvider(); |
2514 |
> |
} |
2515 |
> |
catch (Exception ex) |
2516 |
> |
{ |
2517 |
> |
logger.VerboseError.WriteLine(ex.ToString()); |
2518 |
> |
} |
2519 |
|
} |
2520 |
+ |
comparer.Value = value; |
2521 |
+ |
} |
2522 |
+ |
else |
2523 |
+ |
{ |
2524 |
+ |
value = Convert.ToInt32(SearchArgs.CompareStartValue); |
2525 |
+ |
comparer.Value = value; |
2526 |
+ |
} |
2527 |
+ |
if (comparer.Compare(Convert.ToInt32(Value), value)) |
2528 |
+ |
{ |
2529 |
+ |
writer.WriteResult<int>(comparer.Address, comparer.Value); |
2530 |
|
} |
2520 |
– |
comparer.Value = value; |
2521 |
– |
} |
2522 |
– |
else |
2523 |
– |
{ |
2524 |
– |
value = Convert.ToInt32(SearchArgs.CompareStartValue); |
2525 |
– |
comparer.Value = value; |
2526 |
– |
} |
2527 |
– |
if (comparer.Compare(Convert.ToInt32(Value), value)) |
2528 |
– |
{ |
2529 |
– |
writer.WriteResult<int>(comparer.Address, comparer.Value); |
2531 |
|
} |
2532 |
+ |
address_index += STEP_SIZE; |
2533 |
|
} |
2534 |
< |
address_index += STEP_SIZE; |
2535 |
< |
} |
2536 |
< |
#endregion |
2537 |
< |
} break; |
2536 |
< |
case SearchDataTypes._64bits: |
2537 |
< |
if (unsigned) |
2538 |
< |
{ |
2539 |
< |
#region 64bits - unsigned |
2540 |
< |
var t_data = BitTools.ConvertByteArray<ulong>(data); |
2541 |
< |
foreach (var Value in t_data) |
2534 |
> |
#endregion |
2535 |
> |
} break; |
2536 |
> |
case SearchDataTypes._64bits: |
2537 |
> |
if (unsigned) |
2538 |
|
{ |
2539 |
< |
if (SearchWorkerThread.CancellationPending) { break; } |
2540 |
< |
using (_64bit_unsigned_comparer_ comparer = new _64bit_unsigned_comparer_(SearchArgs, address_index)) |
2539 |
> |
#region 64bits - unsigned |
2540 |
> |
var t_data = BitTools.ConvertByteArray<ulong>(data); |
2541 |
> |
foreach (var Value in t_data) |
2542 |
|
{ |
2543 |
< |
ulong value = 0; |
2544 |
< |
if (SearchArgs.CompareValueType == CompareValueTypes.OldValue) |
2543 |
> |
if (SearchWorkerThread.CancellationPending) { break; } |
2544 |
> |
using (_64bit_unsigned_comparer_ comparer = new _64bit_unsigned_comparer_(SearchArgs, address_index)) |
2545 |
|
{ |
2546 |
< |
using (GenericMemoryProvider gmp = new GenericMemoryProvider((IAcceptsProcessAndConfig)this)) |
2546 |
> |
ulong value = 0; |
2547 |
> |
if (SearchArgs.CompareValueType == CompareValueTypes.OldValue) |
2548 |
|
{ |
2549 |
< |
try |
2549 |
> |
using (GenericMemoryProvider gmp = new GenericMemoryProvider((IAcceptsProcessAndConfig)this)) |
2550 |
|
{ |
2551 |
< |
gmp.OpenProvider(); |
2552 |
< |
gmp.ReadMemory(address_index, out value); |
2553 |
< |
gmp.CloseProvider(); |
2554 |
< |
} |
2555 |
< |
catch (Exception ex) |
2556 |
< |
{ |
2557 |
< |
logger.VerboseError.WriteLine(ex.ToString()); |
2551 |
> |
try |
2552 |
> |
{ |
2553 |
> |
gmp.OpenProvider(); |
2554 |
> |
gmp.ReadMemory(address_index, out value); |
2555 |
> |
gmp.CloseProvider(); |
2556 |
> |
} |
2557 |
> |
catch (Exception ex) |
2558 |
> |
{ |
2559 |
> |
logger.VerboseError.WriteLine(ex.ToString()); |
2560 |
> |
} |
2561 |
|
} |
2562 |
+ |
comparer.Value = value; |
2563 |
+ |
} |
2564 |
+ |
else |
2565 |
+ |
{ |
2566 |
+ |
value = Convert.ToUInt64(SearchArgs.CompareStartValue); |
2567 |
+ |
comparer.Value = value; |
2568 |
+ |
} |
2569 |
+ |
if (comparer.Compare(Convert.ToUInt64(Value), value)) |
2570 |
+ |
{ |
2571 |
+ |
writer.WriteResult<ulong>(comparer.Address, comparer.Value); |
2572 |
|
} |
2562 |
– |
comparer.Value = value; |
2563 |
– |
} |
2564 |
– |
else |
2565 |
– |
{ |
2566 |
– |
value = Convert.ToUInt64(SearchArgs.CompareStartValue); |
2567 |
– |
comparer.Value = value; |
2568 |
– |
} |
2569 |
– |
if (comparer.Compare(Convert.ToUInt64(Value), value)) |
2570 |
– |
{ |
2571 |
– |
writer.WriteResult<ulong>(comparer.Address, comparer.Value); |
2573 |
|
} |
2574 |
+ |
address_index += STEP_SIZE; |
2575 |
|
} |
2576 |
< |
address_index += STEP_SIZE; |
2576 |
> |
#endregion |
2577 |
|
} |
2578 |
< |
#endregion |
2577 |
< |
} |
2578 |
< |
else |
2579 |
< |
{ |
2580 |
< |
#region 64bits - signed |
2581 |
< |
var t_data = BitTools.ConvertByteArray<long>(data); |
2582 |
< |
foreach (var Value in t_data) |
2578 |
> |
else |
2579 |
|
{ |
2580 |
< |
if (SearchWorkerThread.CancellationPending) { break; } |
2581 |
< |
using (_64bit_signed_comparer_ comparer = new _64bit_signed_comparer_(SearchArgs, address_index)) |
2580 |
> |
#region 64bits - signed |
2581 |
> |
var t_data = BitTools.ConvertByteArray<long>(data); |
2582 |
> |
foreach (var Value in t_data) |
2583 |
|
{ |
2584 |
< |
long value = 0; |
2585 |
< |
if (SearchArgs.CompareValueType == CompareValueTypes.OldValue) |
2584 |
> |
if (SearchWorkerThread.CancellationPending) { break; } |
2585 |
> |
using (_64bit_signed_comparer_ comparer = new _64bit_signed_comparer_(SearchArgs, address_index)) |
2586 |
|
{ |
2587 |
< |
using (GenericMemoryProvider gmp = new GenericMemoryProvider((IAcceptsProcessAndConfig)this)) |
2587 |
> |
long value = 0; |
2588 |
> |
if (SearchArgs.CompareValueType == CompareValueTypes.OldValue) |
2589 |
|
{ |
2590 |
< |
try |
2593 |
< |
{ |
2594 |
< |
gmp.OpenProvider(); |
2595 |
< |
gmp.ReadMemory(address_index, out value); |
2596 |
< |
gmp.CloseProvider(); |
2597 |
< |
} |
2598 |
< |
catch (Exception ex) |
2590 |
> |
using (GenericMemoryProvider gmp = new GenericMemoryProvider((IAcceptsProcessAndConfig)this)) |
2591 |
|
{ |
2592 |
< |
logger.VerboseError.WriteLine(ex.ToString()); |
2592 |
> |
try |
2593 |
> |
{ |
2594 |
> |
gmp.OpenProvider(); |
2595 |
> |
gmp.ReadMemory(address_index, out value); |
2596 |
> |
gmp.CloseProvider(); |
2597 |
> |
} |
2598 |
> |
catch (Exception ex) |
2599 |
> |
{ |
2600 |
> |
logger.VerboseError.WriteLine(ex.ToString()); |
2601 |
> |
} |
2602 |
|
} |
2603 |
+ |
comparer.Value = value; |
2604 |
+ |
} |
2605 |
+ |
else |
2606 |
+ |
{ |
2607 |
+ |
value = Convert.ToInt64(SearchArgs.CompareStartValue); |
2608 |
+ |
comparer.Value = value; |
2609 |
+ |
} |
2610 |
+ |
if (comparer.Compare(Convert.ToInt64(Value), value)) |
2611 |
+ |
{ |
2612 |
+ |
writer.WriteResult<long>(comparer.Address, comparer.Value); |
2613 |
|
} |
2603 |
– |
comparer.Value = value; |
2604 |
– |
} |
2605 |
– |
else |
2606 |
– |
{ |
2607 |
– |
value = Convert.ToInt64(SearchArgs.CompareStartValue); |
2608 |
– |
comparer.Value = value; |
2609 |
– |
} |
2610 |
– |
if (comparer.Compare(Convert.ToInt64(Value), value)) |
2611 |
– |
{ |
2612 |
– |
writer.WriteResult<long>(comparer.Address, comparer.Value); |
2614 |
|
} |
2615 |
+ |
address_index += STEP_SIZE; |
2616 |
|
} |
2617 |
< |
address_index += STEP_SIZE; |
2618 |
< |
} |
2617 |
< |
#endregion |
2618 |
< |
} break; |
2617 |
> |
#endregion |
2618 |
> |
} break; |
2619 |
|
|
2620 |
< |
} |
2621 |
< |
#endregion |
2622 |
< |
|
2623 |
< |
} |
2620 |
> |
} |
2621 |
> |
#endregion |
2622 |
|
|
2623 |
+ |
} |
2624 |
|
|
2626 |
– |
//ISerializedResult sr = (reader as ISerializedResult); |
2627 |
– |
//if (sr == null) |
2628 |
– |
//{ |
2629 |
– |
// throw new ArgumentNullException("sr", string.Format("Unable to cast: '{0}' to '{1}'", reader.GetType().Name, typeof(ISerializedResult).Name)); |
2630 |
– |
//} |
2631 |
– |
//int sr_index = 0; |
2632 |
– |
//try |
2633 |
– |
//{ |
2634 |
– |
// if (sr.ContainsAddress(obre_CurrentIndex, obre_unsigned, obre_sdt, new Action<int, string>(this.UpdateProgress), out sr_index)) |
2635 |
– |
// { |
2636 |
– |
// StructResultType<ulong> result = StructResultType<ulong>.Empty; |
2637 |
– |
// sr.GetResultAtIndex(sr_index, obre_unsigned, obre_sdt, new Action<int, string>(this.UpdateProgress), out result); |
2638 |
– |
// if (Debugger.IsAttached) |
2639 |
– |
// { |
2640 |
– |
// Debugger.Break(); |
2641 |
– |
// } |
2642 |
– |
// } |
2643 |
– |
//} |
2625 |
|
|
2626 |
+ |
//ISerializedResult sr = (reader as ISerializedResult); |
2627 |
+ |
//if (sr == null) |
2628 |
+ |
//{ |
2629 |
+ |
// throw new ArgumentNullException("sr", string.Format("Unable to cast: '{0}' to '{1}'", reader.GetType().Name, typeof(ISerializedResult).Name)); |
2630 |
+ |
//} |
2631 |
+ |
//int sr_index = 0; |
2632 |
+ |
//try |
2633 |
+ |
//{ |
2634 |
+ |
// if (sr.ContainsAddress(obre_CurrentIndex, obre_unsigned, obre_sdt, new Action<int, string>(this.UpdateProgress), out sr_index)) |
2635 |
+ |
// { |
2636 |
+ |
// StructResultType<ulong> result = StructResultType<ulong>.Empty; |
2637 |
+ |
// sr.GetResultAtIndex(sr_index, obre_unsigned, obre_sdt, new Action<int, string>(this.UpdateProgress), out result); |
2638 |
+ |
// if (Debugger.IsAttached) |
2639 |
+ |
// { |
2640 |
+ |
// Debugger.Break(); |
2641 |
+ |
// } |
2642 |
+ |
// } |
2643 |
+ |
//} |
2644 |
|
|
2645 |
+ |
} |
2646 |
|
|
2647 |
|
} |
2648 |
+ |
SearchGuid = new_SearchGuid; // update with out new guid |
2649 |
|
} |
2650 |
|
} |
2651 |
|
provider_st.Stop(); |