fix problem when compiling in 32-bit + add license
This commit is contained in:
parent
2bf0920cc5
commit
7880f4f063
24
LICENSE.txt
Normal file
24
LICENSE.txt
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
This is free and unencumbered software released into the public domain.
|
||||||
|
|
||||||
|
Anyone is free to copy, modify, publish, use, compile, sell, or
|
||||||
|
distribute this software, either in source code form or as a compiled
|
||||||
|
binary, for any purpose, commercial or non-commercial, and by any
|
||||||
|
means.
|
||||||
|
|
||||||
|
In jurisdictions that recognize copyright laws, the author or authors
|
||||||
|
of this software dedicate any and all copyright interest in the
|
||||||
|
software to the public domain. We make this dedication for the benefit
|
||||||
|
of the public at large and to the detriment of our heirs and
|
||||||
|
successors. We intend this dedication to be an overt act of
|
||||||
|
relinquishment in perpetuity of all present and future rights to this
|
||||||
|
software under copyright law.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||||
|
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||||
|
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||||
|
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
||||||
|
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||||
|
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||||
|
OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
|
For more information, please refer to <https://unlicense.org/>
|
||||||
@ -2,6 +2,7 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <inttypes.h>
|
||||||
|
|
||||||
#define WIN32_LEAN_AND_MEAN 1
|
#define WIN32_LEAN_AND_MEAN 1
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
@ -92,7 +93,7 @@ void DebugPrintBuf(uintptr Address, const uint8 *Buffer, int Count){
|
|||||||
int Remainder = Count % BytesPerLine;
|
int Remainder = Count % BytesPerLine;
|
||||||
|
|
||||||
for(int i = 0; i < FullLines; i += 1){
|
for(int i = 0; i < FullLines; i += 1){
|
||||||
printf("%16llX | ", (Address + i * BytesPerLine));
|
printf("%16" PRIXPTR " | ", (Address + i * BytesPerLine));
|
||||||
|
|
||||||
for(int j = 0; j < BytesPerLine; j += 1){
|
for(int j = 0; j < BytesPerLine; j += 1){
|
||||||
if(j > 0) putchar(' ');
|
if(j > 0) putchar(' ');
|
||||||
@ -110,7 +111,7 @@ void DebugPrintBuf(uintptr Address, const uint8 *Buffer, int Count){
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(Remainder > 0){
|
if(Remainder > 0){
|
||||||
printf("%16llX | ", (Address + FullLines * BytesPerLine));
|
printf("%16" PRIXPTR " | ", (Address + FullLines * BytesPerLine));
|
||||||
|
|
||||||
for(int j = 0; j < BytesPerLine; j += 1){
|
for(int j = 0; j < BytesPerLine; j += 1){
|
||||||
if(j > 0) putchar(' ');
|
if(j > 0) putchar(' ');
|
||||||
|
|||||||
@ -2,6 +2,7 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <inttypes.h>
|
||||||
|
|
||||||
#define WIN32_LEAN_AND_MEAN 1
|
#define WIN32_LEAN_AND_MEAN 1
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
@ -28,7 +29,7 @@ void DebugPrintBuf(uintptr Address, const uint8 *Buffer, int Count){
|
|||||||
int Remainder = Count % BytesPerLine;
|
int Remainder = Count % BytesPerLine;
|
||||||
|
|
||||||
for(int i = 0; i < FullLines; i += 1){
|
for(int i = 0; i < FullLines; i += 1){
|
||||||
printf("%16llX | ", (Address + i * BytesPerLine));
|
printf("%16" PRIXPTR " | ", (Address + i * BytesPerLine));
|
||||||
|
|
||||||
for(int j = 0; j < BytesPerLine; j += 1){
|
for(int j = 0; j < BytesPerLine; j += 1){
|
||||||
if(j > 0) putchar(' ');
|
if(j > 0) putchar(' ');
|
||||||
@ -46,7 +47,7 @@ void DebugPrintBuf(uintptr Address, const uint8 *Buffer, int Count){
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(Remainder > 0){
|
if(Remainder > 0){
|
||||||
printf("%16llX | ", (Address + FullLines * BytesPerLine));
|
printf("%16" PRIXPTR " | ", (Address + FullLines * BytesPerLine));
|
||||||
|
|
||||||
for(int j = 0; j < BytesPerLine; j += 1){
|
for(int j = 0; j < BytesPerLine; j += 1){
|
||||||
if(j > 0) putchar(' ');
|
if(j > 0) putchar(' ');
|
||||||
@ -225,7 +226,7 @@ int main(int argc, char **argv){
|
|||||||
uintptr BaseAddr = 0;
|
uintptr BaseAddr = 0;
|
||||||
MEMORY_BASIC_INFORMATION Info;
|
MEMORY_BASIC_INFORMATION Info;
|
||||||
while(VirtualQueryEx(Process, (void*)BaseAddr, &Info, sizeof(Info)) != 0){
|
while(VirtualQueryEx(Process, (void*)BaseAddr, &Info, sizeof(Info)) != 0){
|
||||||
if(Info.State & MEM_COMMIT && !(Info.Protect & PAGE_NOACCESS) && !(Info.Protect & PAGE_GUARD)){
|
if((Info.State & MEM_COMMIT) && !(Info.Protect & PAGE_NOACCESS) && !(Info.Protect & PAGE_GUARD)){
|
||||||
ScanProcessMemory(Process, (uintptr)Info.BaseAddress, Info.RegionSize, Data, DataSize, ContextWindow);
|
ScanProcessMemory(Process, (uintptr)Info.BaseAddress, Info.RegionSize, Data, DataSize, ContextWindow);
|
||||||
}
|
}
|
||||||
BaseAddr = (uintptr)Info.BaseAddress + Info.RegionSize;
|
BaseAddr = (uintptr)Info.BaseAddress + Info.RegionSize;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user