new_blocks.insert(std::make_pair(block->getStartAddress(), block));
function->addBasicBlock(block);
+ uint64_t base_address, size;
+ text_section.getAddress(base_address);
+ text_section.getSize(size);
+ LOG4CXX_DEBUG(logger, "Text section at " << std::hex << base_address << " with size " << size);
+
while (remaining_blocks.size()) {
BasicBlock * current_block = remaining_blocks.top();
remaining_blocks.pop();
<< current_block->getStartAddress());
uint64_t inst_size;
- uint64_t base_address;
- text_section.getAddress(base_address);
uint64_t current_address = current_block->getStartAddress() - base_address;
while(true) {
MCInst inst;
text_section.getContents(bytes);
StringRefMemoryObject ref(bytes);
+ LOG4CXX_DEBUG(logger, "Splitting Blocks in Function " << function->getName());
// Split blocks where jumps are going inside the block
for (auto it = function->blocks().begin();
it != function->blocks().end();
++it) {
BasicBlock * current_block = it->second;
+ if (current_block->getEndAddress() == 0) {
+ LOG4CXX_ERROR(logger, "UNFINISHED BLOCK " << std::hex << current_block->getStartAddress());
+ break;
+ }
uint64_t inst_size;
uint64_t base_address;
text_section.getAddress(base_address);