/thirdparty/breakpad/google_breakpad/processor/exploitability.h

http://github.com/tomahawk-player/tomahawk · C Header · 73 lines · 24 code · 12 blank · 37 comment · 0 complexity · 08a6de6446e0fcda116a6ded22e285d8 MD5 · raw file

  1. // Copyright (c) 2010 Google Inc.
  2. // All rights reserved.
  3. //
  4. // Redistribution and use in source and binary forms, with or without
  5. // modification, are permitted provided that the following conditions are
  6. // met:
  7. //
  8. // * Redistributions of source code must retain the above copyright
  9. // notice, this list of conditions and the following disclaimer.
  10. // * Redistributions in binary form must reproduce the above
  11. // copyright notice, this list of conditions and the following disclaimer
  12. // in the documentation and/or other materials provided with the
  13. // distribution.
  14. // * Neither the name of Google Inc. nor the names of its
  15. // contributors may be used to endorse or promote products derived from
  16. // this software without specific prior written permission.
  17. //
  18. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  19. // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  20. // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  21. // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  22. // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  23. // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  24. // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  25. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  26. // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  27. // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  28. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  29. // exploitability_engine.h: Generic exploitability engine.
  30. //
  31. // The Exploitability class is an abstract base class providing common
  32. // generic methods that apply to exploitability engines for specific platforms.
  33. // Specific implementations will extend this class by providing run
  34. // methods to fill in the exploitability_ enumeration of the ProcessState
  35. // for a crash.
  36. //
  37. // Author: Cris Neckar
  38. #ifndef GOOGLE_BREAKPAD_PROCESSOR_EXPLOITABILITY_H_
  39. #define GOOGLE_BREAKPAD_PROCESSOR_EXPLOITABILITY_H_
  40. #include "google_breakpad/common/breakpad_types.h"
  41. #include "google_breakpad/processor/minidump.h"
  42. #include "google_breakpad/processor/process_state.h"
  43. namespace google_breakpad {
  44. class Exploitability {
  45. public:
  46. virtual ~Exploitability() {}
  47. static Exploitability *ExploitabilityForPlatform(Minidump *dump,
  48. ProcessState *process_state);
  49. ExploitabilityRating CheckExploitability();
  50. bool AddressIsAscii(u_int64_t);
  51. protected:
  52. Exploitability(Minidump *dump,
  53. ProcessState *process_state);
  54. Minidump *dump_;
  55. ProcessState *process_state_;
  56. SystemInfo *system_info_;
  57. private:
  58. virtual ExploitabilityRating CheckPlatformExploitability() = 0;
  59. };
  60. } // namespace google_breakpad
  61. #endif // GOOGLE_BREAKPAD_PROCESSOR_EXPLOITABILITY_H_