Added method to exploitability class which checks if a given address contains all ascii characters.

BUG=NONE
TEST=ExploitabilityTest.TestWindowsEngine
Review URL: http://breakpad.appspot.com/207001

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@706 4c0a9323-5329-0410-9bdc-e9ce6186880e
This commit is contained in:
cdn@chromium.org 2010-10-01 23:25:48 +00:00
parent 2b4274afc4
commit 8b2e6865e5
4 changed files with 99 additions and 51 deletions

View file

@ -204,19 +204,26 @@ ExploitabilityRating ExploitabilityWin::CheckPlatformExploitability() {
break;
}
MinidumpMemoryRegion *instruction_region = 0;
if (memory_available)
instruction_region = memory_list->GetMemoryRegionForAddress(instruction_ptr);
if (memory_available) {
instruction_region =
memory_list->GetMemoryRegionForAddress(instruction_ptr);
}
if (!near_null && instruction_region &&
context->GetContextCPU() == MD_CONTEXT_X86 &&
(bad_read || bad_write)) {
// Perform checks related to memory around instruction pointer.
u_int32_t memory_offset = instruction_ptr - instruction_region->GetBase();
u_int32_t available_memory = instruction_region->GetSize() - memory_offset;
u_int32_t memory_offset =
instruction_ptr - instruction_region->GetBase();
u_int32_t available_memory =
instruction_region->GetSize() - memory_offset;
available_memory = available_memory > kDisassembleBytesBeyondPC ?
kDisassembleBytesBeyondPC : available_memory;
if (available_memory) {
const u_int8_t *raw_memory = instruction_region->GetMemory() + memory_offset;
DisassemblerX86 disassembler(raw_memory, available_memory, instruction_ptr);
const u_int8_t *raw_memory =
instruction_region->GetMemory() + memory_offset;
DisassemblerX86 disassembler(raw_memory,
available_memory,
instruction_ptr);
disassembler.NextInstruction();
if (bad_read)
disassembler.setBadRead();
@ -257,6 +264,8 @@ ExploitabilityRating ExploitabilityWin::CheckPlatformExploitability() {
}
}
}
if (!near_null && AddressIsAscii(address))
exploitability_weight += kMediumBump;
} else {
BPLOG(INFO) << "Access violation type parameter missing.";
return EXPLOITABILITY_ERR_PROCESSING;