MCPcopy Create free account
hub / github.com/bwapi/bwapi / WriteNops

Function WriteNops

bwapi/BWAPI/Source/NewHackUtil.cpp:130–148  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

128 //////////////////////////////////////////////////////////////////////////////////////
129
130 void WriteNops(void* dest, u32 size)
131 {
132 memPatch tempPatch;
133 tempPatch.location = dest;
134 tempPatch.patchSize = size;
135 memcpy_s(tempPatch.patch, 128, dest, size);
136 changes.push_back(tempPatch);
137
138 DWORD lastAccess = 0;
139 VirtualProtect(dest, size, PAGE_EXECUTE_READWRITE, &lastAccess);
140 __try
141 {
142 memset(dest, 0x90, size);
143 }
144 __except(1)
145 {}
146 VirtualProtect(dest, size, lastAccess, &lastAccess);
147 return;
148 }
149
150 void WriteNops(u32 dest, u32 size)
151 {

Callers 1

ApplyCodePatchesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected