You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add a pure-Ruby assembler backend, instead of relying on YASM to produce shellcode.
This would likely take the form of having each architecture module define it's own Assembler class. These class may be initialized with additional configuration (ARM supports being switched to big-endian or little-endian mode) or could also track state while processing instructions. These classes should implement the "Emitter Pattern", and provide an entry point method called emit_instruction(inst) which would accept an Instruction object and output a binary String of opcodes (or possibly append the opcodes directly to an output String/File object that's also given). This method could be as simple as one giant case/when statement which inspects the instruction's name, or a method which dynamically invokes other emit_instruction_#{inst.name} methods using public_send(). Additional helper emit_* methods will probably also need to be defined to emit the operands for the instructions. An emit_program(program) method may also be necessary to output a fully assembled program, instead of a series of opcodes for shellcode.
Add a pure-Ruby assembler backend, instead of relying on YASM to produce shellcode.
This would likely take the form of having each architecture module define it's own
Assembler
class. These class may be initialized with additional configuration (ARM supports being switched to big-endian or little-endian mode) or could also track state while processing instructions. These classes should implement the "Emitter Pattern", and provide an entry point method calledemit_instruction(inst)
which would accept anInstruction
object and output a binary String of opcodes (or possibly append the opcodes directly to an output String/File object that's also given). This method could be as simple as one giantcase
/when
statement which inspects the instruction'sname
, or a method which dynamically invokes otheremit_instruction_#{inst.name}
methods usingpublic_send()
. Additional helperemit_*
methods will probably also need to be defined to emit the operands for the instructions. Anemit_program(program)
method may also be necessary to output a fully assembled program, instead of a series of opcodes for shellcode.References
opcodes.rb
in each directory..td
files.espcially*InstrFormats.td
and*InstrInfo.td
.x86.xml
ISA file into Ruby files for each instruction..tar.gz
file.The text was updated successfully, but these errors were encountered: