Home » Developing U++ » U++ Developers corner » What does SSE2 usage enhance?
Re: What does SSE2 usage enhance? [message #39702 is a reply to message #39700] |
Thu, 18 April 2013 11:43 |
crydev
Messages: 151 Registered: October 2012 Location: Netherlands
|
Experienced Member |
|
|
Here is a small code snippet. If you see anything that is strange or wrong I would appreciate feedback.
The memcpy line is the line where I copy, in this case, 4 bytes from the address of i in array buffer to float variable tempStore.
template<>
void MemoryScanner::ScanWorker(const MemoryRegion& region, const float& value)
{
Byte *buffer = (Byte*)MemoryAlloc(region.MemorySize);
if (!ReadProcessMemory(this->mOpenedProcessHandle, (void*)region.BaseAddress, buffer
, region.MemorySize, NULL))
{
MemoryFree(buffer);
return;
}
Vector<MemoryBlockBase*> localResults;
for (int i = 0; i < region.MemorySize; i++)
{
float tempStore;
memcpy(&tempStore, &(buffer[i]), sizeof(float));
if (TemplateCompare(tempStore, value)) // WRITES TO FREED BLOCKS DETECTED
{
MemoryBlock<float>* mb = new MemoryBlock<float>();
mb->Address = static_cast<unsigned int>(region.BaseAddress + i);
mb->Size = sizeof(float);
mb->Buffer = tempStore;
localResults.Add(mb);
}
}
MemoryFree(buffer);
AtomicInc(this->ThreadFinishCount);
if (localResults.GetCount() > 0)
{
this->AddThreadSpecificSearchResults(localResults);
}
this->UpdateScanningProgress(this->ThreadFinishCount);
}
|
|
|
|
|
What does SSE2 usage enhance?
By: crydev on Wed, 10 April 2013 13:31
|
|
|
Re: What does SSE2 usage enhance?
By: mirek on Mon, 15 April 2013 18:34
|
|
|
Re: What does SSE2 usage enhance?
By: crydev on Wed, 17 April 2013 10:54
|
|
|
Re: What does SSE2 usage enhance?
By: mirek on Wed, 17 April 2013 11:17
|
|
|
Re: What does SSE2 usage enhance?
By: mirek on Wed, 17 April 2013 11:20
|
|
|
Re: What does SSE2 usage enhance?
By: crydev on Wed, 17 April 2013 22:04
|
|
|
Re: What does SSE2 usage enhance?
By: mirek on Thu, 18 April 2013 06:34
|
|
|
Re: What does SSE2 usage enhance?
By: crydev on Thu, 18 April 2013 08:33
|
|
|
Re: What does SSE2 usage enhance?
By: mirek on Thu, 18 April 2013 10:38
|
|
|
Re: What does SSE2 usage enhance?
By: crydev on Thu, 18 April 2013 11:43
|
|
|
Re: What does SSE2 usage enhance?
By: mirek on Thu, 18 April 2013 11:58
|
Goto Forum:
Current Time: Tue May 14 05:19:08 CEST 2024
Total time taken to generate the page: 0.03141 seconds
|