Пример #1
0
void IdaFrontend::createSections(core::image::Image *image) {
    for (int i = 0; i < get_segm_qty(); i++) {
        segment_t *idaSegment = getnseg(i);

        assert(idaSegment != NULL);

        char segName[MAXSTR];
        ssize_t segNameSize = get_segm_name(idaSegment, segName, sizeof(segName) - 1);
        if(segNameSize < 0) {
            segName[0] = '\0';
        } else if(segNameSize > 0 && segName[0] == '_') {
            segName[0] = '.';
        }

        auto section = std::make_unique<core::image::Section>(
            segName,
            checked_cast<ByteAddr>(idaSegment->startEA),
            checked_cast<ByteSize>(idaSegment->size())
        );

        section->setReadable(idaSegment->perm & SEGPERM_READ);
        section->setWritable(idaSegment->perm & SEGPERM_WRITE);
        section->setExecutable(idaSegment->perm & SEGPERM_EXEC);
        section->setCode(idaSegment->type == SEG_CODE);
        section->setData(idaSegment->type == SEG_DATA);
        section->setBss(idaSegment->type == SEG_BSS);
        section->setAllocated(section->isCode() || section->isData() || section->isBss());
        section->setExternalByteSource(std::make_unique<IdaByteSource>());

        image->addSection(std::move(section));
    }
}
Пример #2
0
void QUrlInfo_QtDShell::__override_setWritable(bool  b0, bool static_call)
{
    if (static_call) {
        QUrlInfo::setWritable((bool )b0);
    } else {
        setWritable((bool )b0);
    }
}
Пример #3
0
ReadOrWriteWidget::ReadOrWriteWidget( QWidget* writableWidget, bool writable, QWidget* parent)
    : QWidget( parent )
    , m_writableWidget( writableWidget )
    , m_label( 0 )
    , m_layout( 0 )
    , m_writable( writable )
{
    m_label = new QLabel( QString(), this );
    
    m_layout = new QStackedLayout( this );
    if( writableWidget )
        m_layout->addWidget( writableWidget );
    
    m_layout->addWidget( m_label );
    
    setWritable( m_writable );
    
    setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
    setContentsMargins( 0, 0, 0, 0 );
    m_layout->setContentsMargins( 0, 0, 0, 0 );
    m_layout->setSpacing( 0 );
}
bool ConstantBufferD3D::create(bool cpuWrite)
{
	setWritable(cpuWrite);

	D3D11_BUFFER_DESC bufferDesc;
	ZeroMemory(&bufferDesc, sizeof(bufferDesc));
	bufferDesc.ByteWidth = (size % BUFFER_PADSIZE) ? size + BUFFER_PADSIZE - size % BUFFER_PADSIZE : size;

	bufferDesc.BindFlags = D3D11_BIND_CONSTANT_BUFFER;
	bufferDesc.CPUAccessFlags = 0;
	if(cpuWrite)
	{
		bufferDesc.Usage = D3D11_USAGE_DEFAULT;
	} else {
		bufferDesc.Usage = D3D11_USAGE_IMMUTABLE;
	}

	if(bufferDesc.ByteWidth > D3D11_REQ_CONSTANT_BUFFER_ELEMENT_COUNT * sizeof(float))
	{
		LOGFUNCERROR("Size of buffer exceeds maximum size");
		return false;
	}

	D3D11_SUBRESOURCE_DATA initialData;
	ZeroMemory(&initialData, sizeof(initialData));
	initialData.pSysMem = data;

	HRESULT result = device->getD3DDevice()->CreateBuffer(&bufferDesc, &initialData, &gpuBuffer);
	if(FAILED(result)) 
	{
		LOGERROR(result, "ID3D11Device::CreateBuffer");
		return false;
	}

	return true;
}
Пример #5
0
 ReadWriteWidgetItem(Debugger *debugger, int rw_id)
     : ReadOnlyWidgetItem(debugger, rw_id)
 {
     setWritable(true);
 }
Пример #6
0
 InfoWidgetItem(Debugger *debugger)
 {
     this->debugger = debugger;
     setWritable(false);
 }