newdelete.cpp
Upload User: jinandeyu
Upload Date: 2007-01-05
Package Size: 620k
Code Size: 1k
Category:

Remote Control

Development Platform:

WINDOWS

  1. /*  Back Orifice 2000 - Remote Administration Suite
  2.     Copyright (C) 1999, Cult Of The Dead Cow
  3.     This file is free software, and not subject to GNU Public License
  4. restrictions; you can redistribute it and/or modify it in any way 
  5. you see fit. This file is suitable for inclusion in a derivative
  6. work, regardless of license on the work or availability of source code
  7. to the work. If you redistribute this file, you must leave this
  8. header intact.
  9.     
  10. This program is distributed in the hope that it will be useful,
  11.     but WITHOUT ANY WARRANTY; without even the implied warranty of
  12.     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
  13. The author of this program may be contacted at dildog@l0pht.com. */
  14. // Modified New/Delete Operators
  15. #include<windows.h>
  16. void * __cdecl operator new( unsigned int cb )
  17. {
  18. // No fail new!
  19. void *pMem;
  20. do {
  21. pMem=HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,cb);
  22. if(pMem==NULL) Sleep(2000);
  23. } while(pMem==NULL);
  24. return pMem;
  25. }
  26. void __cdecl operator delete( void * p )
  27. {
  28. HeapFree(GetProcessHeap(),0,p);
  29. }