mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-03 17:59:46 +02:00
GP-0: Post-merge fixes for tests involving assembly.
This commit is contained in:
parent
28bad6d430
commit
d9476f62e7
2 changed files with 12 additions and 5 deletions
|
@ -386,7 +386,7 @@ public class PopulateDemoTrace extends GhidraScript {
|
|||
* A call to "exit" results in the immediate termination of the calling thread.
|
||||
*/
|
||||
Assembler asm = Assemblers.getAssembler(trace.getFixedProgramView(snap));
|
||||
InstructionBlock mainBlock = asm.assemble(mainLabel.getAddress(), //
|
||||
Iterator<Instruction> mainBlock = asm.assemble(mainLabel.getAddress(), //
|
||||
"PUSH RBP", //
|
||||
"MOV RBP,RSP", //
|
||||
"CALL clone", //
|
||||
|
@ -404,7 +404,7 @@ public class PopulateDemoTrace extends GhidraScript {
|
|||
"MOV dword ptr [RSP+8],0x21646c", //
|
||||
"CALL exit" //
|
||||
);
|
||||
mainBlock.forEach(mainInstructions::add);
|
||||
mainBlock.forEachRemaining(mainInstructions::add);
|
||||
|
||||
/**
|
||||
* Stub out "clone"
|
||||
|
|
|
@ -21,6 +21,7 @@ import java.lang.invoke.MethodHandles;
|
|||
import java.lang.invoke.MethodHandles.Lookup;
|
||||
import java.math.BigInteger;
|
||||
import java.nio.ByteBuffer;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
import org.junit.Test;
|
||||
|
@ -33,7 +34,9 @@ import ghidra.app.plugin.assembler.sleigh.sem.AssemblyPatternBlock;
|
|||
import ghidra.app.plugin.processors.sleigh.SleighLanguage;
|
||||
import ghidra.pcode.emu.PcodeThread;
|
||||
import ghidra.pcode.exec.*;
|
||||
import ghidra.program.model.lang.*;
|
||||
import ghidra.program.model.lang.Register;
|
||||
import ghidra.program.model.lang.RegisterValue;
|
||||
import ghidra.program.model.listing.Instruction;
|
||||
import ghidra.test.AbstractGhidraHeadlessIntegrationTest;
|
||||
import ghidra.trace.database.ToyDBTraceBuilder;
|
||||
import ghidra.trace.model.memory.TraceMemoryFlag;
|
||||
|
@ -76,9 +79,13 @@ public class TracePcodeEmulatorTest extends AbstractGhidraHeadlessIntegrationTes
|
|||
Range.atLeast(0L), tb.range(0x00100000, 0x0010ffff),
|
||||
TraceMemoryFlag.READ, TraceMemoryFlag.WRITE);
|
||||
Assembler asm = Assemblers.getAssembler(tb.trace.getFixedProgramView(0));
|
||||
InstructionBlock block =
|
||||
Iterator<Instruction> block =
|
||||
asm.assemble(tb.addr(0x00400000), assembly.toArray(String[]::new));
|
||||
Msg.info(this, "Assembly ended at: " + block.getMaxAddress());
|
||||
Instruction last = null;
|
||||
while (block.hasNext()) {
|
||||
last = block.next();
|
||||
}
|
||||
Msg.info(this, "Assembly ended at: " + last.getMaxAddress());
|
||||
PcodeExecutor<byte[]> exec =
|
||||
TraceSleighUtils.buildByteExecutor(tb.trace, 0, thread, 0);
|
||||
PcodeProgram initProg = SleighProgramCompiler.compileProgram(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue