IMAGE_RESOURCE_DIRECTORY_STRING* ResourceEntryWrapper::getNameStr()
{
    offset_t nameOff = getNameOffset();
    if (nameOff == INVALID_ADDR) return NULL;

    const size_t BASIC_SIZE = sizeof(IMAGE_RESOURCE_DIRECTORY_STRING);
    IMAGE_RESOURCE_DIRECTORY_STRING *ptr = (IMAGE_RESOURCE_DIRECTORY_STRING*) this->m_Exe->getContentAt(nameOff, Executable::RAW, BASIC_SIZE);
    return ptr;
}
Beispiel #2
0
void NameManager::addName(Instruction* inst) {
  if ((inst->opcode() == SpvOpName && inst->NumOperands() >= 2) ||
      (inst->opcode() == SpvOpMemberName && inst->NumOperands() >= 3)) {
    uint32_t id = inst->GetSingleWordOperand(0);
    uint32_t offset = getNameOffset(inst);
    id_to_inst.insert(std::pair<id_offset, Instruction*>(id_offset(id, offset), inst));
    names_ids.insert(id);
  }
}