| OLD | NEW |
| 1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include <string> | 5 #include <string> |
| 6 #include "sandbox/sandbox_poc/pocdll/exports.h" | 6 #include "sandbox/win/sandbox_poc/pocdll/exports.h" |
| 7 #include "sandbox/sandbox_poc/pocdll/utils.h" | 7 #include "sandbox/win/sandbox_poc/pocdll/utils.h" |
| 8 | 8 |
| 9 // This file contains the tests used to verify the security of the system by | 9 // This file contains the tests used to verify the security of the system by |
| 10 // using some spying techniques. | 10 // using some spying techniques. |
| 11 | 11 |
| 12 void POCDLL_API TestSpyKeys(HANDLE log) { | 12 void POCDLL_API TestSpyKeys(HANDLE log) { |
| 13 HandleToFile handle2file; | 13 HandleToFile handle2file; |
| 14 FILE *output = handle2file.Translate(log, "w"); | 14 FILE *output = handle2file.Translate(log, "w"); |
| 15 | 15 |
| 16 if (RegisterHotKey(NULL, 1, 0, 0x42)) { | 16 if (RegisterHotKey(NULL, 1, 0, 0x42)) { |
| 17 fprintf(output, "[GRANTED] successfully registered hotkey\r\n"); | 17 fprintf(output, "[GRANTED] successfully registered hotkey\r\n"); |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 if (::GetPixel(screen_dc, x, y) != pixel_color) { | 57 if (::GetPixel(screen_dc, x, y) != pixel_color) { |
| 58 fprintf(output, "[GRANTED] Read pixel on screen\r\n"); | 58 fprintf(output, "[GRANTED] Read pixel on screen\r\n"); |
| 59 return; | 59 return; |
| 60 } | 60 } |
| 61 } | 61 } |
| 62 } | 62 } |
| 63 | 63 |
| 64 fprintf(output, "[BLOCKED] Read pixel on screen. Error = %d\r\n", | 64 fprintf(output, "[BLOCKED] Read pixel on screen. Error = %d\r\n", |
| 65 ::GetLastError()); | 65 ::GetLastError()); |
| 66 } | 66 } |
| OLD | NEW |