本文整理汇总了C++中MemoryWriter::writeDWord方法的典型用法代码示例。如果您正苦于以下问题:C++ MemoryWriter::writeDWord方法的具体用法?C++ MemoryWriter::writeDWord怎么用?C++ MemoryWriter::writeDWord使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MemoryWriter
的用法示例。
在下文中一共展示了MemoryWriter::writeDWord方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: allocateVMT
void JITCompiler32 :: allocateVMT(MemoryWriter& vmtWriter, size_t flags, size_t vmtLength)
{
alignCode(&vmtWriter, VA_ALIGNMENT, false);
// create VMT header:
// dummy package reference
vmtWriter.writeDWord(0);
// vmt length
vmtWriter.writeDWord(vmtLength);
// vmt flags
vmtWriter.writeDWord(flags);
// dummy class reference
vmtWriter.writeDWord(0);
int position = vmtWriter.Position();
size_t vmtSize = 0;
if (test(flags, elStandartVMT)) {
// + VMT length
vmtSize = vmtLength * sizeof(VMTEntry);
}
vmtWriter.writeBytes(0, vmtSize);
vmtWriter.seek(position);
}
示例2: writeTrailItem
inline int writeTrailItem(MemoryWriter& writer, int nonterminal, int next)
{
int offset = writer.Position();
writer.writeDWord(nonterminal);
writer.writeDWord(next);
return offset;
}
示例3: writeReference
void Instance::ImageReferenceHelper :: writeReference(MemoryWriter& writer, ref_t reference, size_t disp, _Module* module)
{
size_t pos = reference & ~mskAnyRef;
if (test(reference, mskRelCodeRef)) {
writer.writeDWord(pos - writer.Position() - 4);
}
else writer.writeDWord((test(reference, mskRDataRef) ? _statBase : _codeBase) + pos + disp);
}
示例4: writeDerivationItem
inline int writeDerivationItem(MemoryWriter& writer, int key, int terminal, int trace)
{
int offset = writer.Position();
writer.writeDWord(key);
writer.writeDWord(terminal);
writer.writeDWord(trace);
return offset;
}
示例5: writeCommand
void ECodesAssembler :: writeCommand(ByteCommand command, MemoryWriter& writer)
{
writer.writeByte(command.code);
if (command.code >= 0x20) {
writer.writeDWord(command.argument);
}
if (command.code >= 0xE0) {
writer.writeDWord(command.additional);
}
}
示例6: writeCommand
void ECodesAssembler :: writeCommand(ByteCommand command, MemoryWriter& writer)
{
writer.writeByte(command.code);
if (command.code > MAX_SINGLE_ECODE) {
writer.writeDWord(command.argument);
}
if (command.code > MAX_DOUBLE_ECODE) {
writer.writeDWord(command.additional);
}
}
示例7: writeTapeRecord
inline void writeTapeRecord(MemoryWriter& tape, size_t command, ident_t value1, ident_t value2)
{
tape.writeDWord(command);
// write total length including equal sign
tape.writeDWord(getlength(value1) + getlength(value2) + 2);
if (!emptystr(value1)) {
tape.writeLiteral(value1, getlength(value1));
tape.writeChar('=');
}
if (!emptystr(value2)) {
tape.writeLiteral(value2);
}
else tape.writeChar((char)0);
}
示例8: writeReference
void JITLinker::ReferenceHelper :: writeReference(MemoryWriter& writer, ref_t reference, size_t disp, _Module* module)
{
ref_t mask = reference & mskAnyRef;
ref_t refID = reference & ~mskAnyRef;
//// check if it is a constant, resolve it immediately
//if (mask == mskLinkerConstant) {
// writer.writeDWord(getLinkerConstant(refID));
// return;
//}
if (!module)
module = _module;
ref_t position = writer.Position();
writer.writeDWord(disp);
// vmt entry offset should be resolved later
if (mask == mskVMTEntryOffset) {
_references->add(position, RefInfo(reference, module));
return;
}
// try to resolve immediately
void* vaddress = _owner->_loader->resolveReference(
_owner->_loader->retrieveReference(module, refID, mask), mask);
if (vaddress != LOADER_NOTLOADED) {
resolveReference(writer.Memory(), position, (ref_t)vaddress, mask, _owner->_virtualMode);
}
// or resolve later
else _references->add(position, RefInfo(reference, module));
}
示例9: compileRJump
void ECodesAssembler :: compileRJump(ByteCode code, TokenInfo& token, MemoryWriter& writer, LabelInfo& info, _Module* binary)
{
writer.writeByte(code);
int label = 0;
token.read();
if (info.labels.exist(token.value)) {
label = info.labels.get(token.value) - writer.Position() - 8;
}
else {
info.fwdJumps.add(token.value, writer.Position() + 4);
}
size_t reference = compileRArg(token, binary);
writer.writeDWord(reference);
writer.writeDWord(label);
}
示例10: compileMccJump
void ECodesAssembler :: compileMccJump(ByteCode code, TokenInfo& token, MemoryWriter& writer, LabelInfo& info)
{
writer.writeByte(code);
int label = 0;
token.read();
if (info.labels.exist(token.value)) {
label = info.labels.get(token.value) - writer.Position() - 8;
}
else {
info.fwdJumps.add(token.value, 4 + writer.Position());
}
int message = token.readInteger(constants);
writer.writeDWord(message);
writer.writeDWord(label);
}
示例11: fixVMT
void JITCompiler32 :: fixVMT(MemoryWriter& vmtWriter, void* classClassVAddress, void* packageVAddress, int count, bool virtualMode)
{
_Memory* image = vmtWriter.Memory();
// update class package reference if available
if (packageVAddress != NULL) {
int position = vmtWriter.Position();
vmtWriter.seek(position - 0x10);
if (virtualMode) {
vmtWriter.writeRef((ref_t)packageVAddress, 0);
}
else vmtWriter.writeDWord((int)packageVAddress);
vmtWriter.seek(position);
}
// update class vmt reference if available
if (classClassVAddress != NULL) {
vmtWriter.seek(vmtWriter.Position() - 4);
if (virtualMode) {
vmtWriter.writeRef((ref_t)classClassVAddress, 0);
}
else vmtWriter.writeDWord((int)classClassVAddress);
}
// if in virtual mode mark method addresses as reference
if (virtualMode) {
ref_t entryPosition = vmtWriter.Position();
for (int i = 0 ; i < count ; i++) {
image->addReference(mskCodeRef, entryPosition + 4);
entryPosition += 8;
}
}
}
示例12: if
void JITLinker::ReferenceHelper :: writeReference(MemoryWriter& writer, void* vaddress, bool relative, size_t disp)
{
if (!_owner->_virtualMode) {
ref_t address = (ref_t)vaddress;
// calculate relative address
if (relative)
address -= ((ref_t)writer.Address() + 4);
writer.writeDWord(address + disp);
}
else if (relative) {
writer.writeRef(((ref_t)vaddress | mskRelCodeRef), disp);
}
else writer.writeRef((ref_t)vaddress, disp);
}
示例13: compileJump
void ECodesAssembler :: compileJump(ByteCode code, TokenInfo& token, MemoryWriter& writer, LabelInfo& info)
{
writer.writeByte(code);
int label = 0;
token.read();
if (info.labels.exist(token.value)) {
label = info.labels.get(token.value) - writer.Position() - 4;
}
else {
info.fwdJumps.add(token.value, writer.Position());
}
writer.writeDWord(label);
}
示例14: allocateVariable
void JITCompiler32 :: allocateVariable(MemoryWriter& writer)
{
writer.writeDWord(0);
}
示例15: writeTape
void Instance::ImageReferenceHelper :: writeTape(MemoryWriter& tape, void* vaddress, int mask)
{
int ref = (size_t)vaddress - (test(mask, mskRDataRef) ? _statBase : _codeBase);
tape.writeDWord(ref | mask);
}