Advertisement
Riremito

AirMemory.h

Jul 16th, 2015
590
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.61 KB | None | 0 0
  1. #ifndef __AIRMEMORY_H__
  2. #define __AIRMEMORY_H__
  3.  
  4. #include<Windows.h>
  5. #include<psapi.h>
  6. #pragma comment(lib, "psapi.lib")
  7.  
  8. #define MaxSize 256
  9.  
  10. #define CALL 0xE8
  11. #define JMP 0xE9
  12. #define JNE 0x850F
  13. #define JE 0x840F
  14.  
  15. class AirMemory{
  16.     private:
  17.         typedef struct tagBackupMemory{
  18.             DWORD Address;
  19.             DWORD Size;
  20.             void *Memory;
  21.             tagBackupMemory *Next;
  22.         }BackupMemory;
  23.  
  24.         DWORD BaseAddress;
  25.         DWORD Memory_Start;
  26.         DWORD Memory_End;
  27.         DWORD MemoryDump;
  28.         bool IsDLL;
  29.         DWORD OldAddr;
  30.         DWORD OldSize;
  31.         DWORD OldProtect;
  32.         BackupMemory MemoryList;
  33.  
  34.         bool FullAccess(DWORD Address, DWORD Size);
  35.         bool RestoreProtect();
  36.         void AddBackupMemory(DWORD Address, void *Memory, DWORD Size);
  37.         bool DeleteBackupMemory(DWORD Address);
  38.         void MemoryCopy(DWORD Address, void *Memory, DWORD Size);
  39.  
  40.     public:
  41.         AirMemory();
  42.         void Init(char *ModuleName = NULL);
  43.         void CreateMemoryDump();
  44.         DWORD AobScan(char *Aob, int Result = 0, DWORD StartAddress = 0, DWORD EndAddress = 0);
  45.         DWORD GetAbsoluteAddress(DWORD Address);
  46.         bool MemoryWriter(DWORD Address, char *Code);
  47.         bool RestoreMemory(DWORD Address);
  48.         bool WriteHook(DWORD Address, WORD OpCode, void *Function, DWORD *RetAddr = NULL, DWORD AddNop = 0);
  49.         void GetDumpInfo(DWORD *MS, DWORD *ME, DWORD *MD);
  50.         DWORD GetBaseAddress();
  51.         void PointerHook(DWORD Pointer, void *Function, DWORD *OldFunction);
  52.         DWORD AutoVMHook(DWORD Address, void *Function, DWORD *RetAddr, DWORD MinAddr = 0);
  53.         bool FunctionHook(char *ProcName, void *Function, DWORD *RetAddr);
  54.         void ArgumentsHook(DWORD Address, DWORD OverWrite, void *HookFunction);
  55. };
  56.  
  57. #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement