Class: Pwnlib::Shellcraft::Generators::Helper::Runner
- Inherits:
-
Object
- Object
- Pwnlib::Shellcraft::Generators::Helper::Runner
- Includes:
- Context, RegSort, Registers, Util::Fiddling, Util::Lists, Util::Packing
- Defined in:
- lib/pwnlib/shellcraft/generators/helper.rb
Overview
Provide a 'sandbox' for generators.
Constant Summary
Constants included from Registers
Registers::AMD64, Registers::I386, Registers::INTEL, Registers::X86_BASEREGS, Registers::X86_ORDERED
Class Method Summary collapse
Instance Method Summary collapse
- #clear ⇒ Object
-
#typesetting ⇒ Object
Indent each line 2 spaces.
Methods included from Util::Packing
flat, pack, unpack, unpack_many
Methods included from Util::Lists
Methods included from Util::Fiddling
b64d, b64e, bits, bits_str, bitswap, bitswap_int, enhex, hex, unbits, unhex, urldecode, urlencode, xor, xor_pair
Methods included from Registers
bits_required, get_register, register?, registers
Methods included from RegSort
Class Method Details
.label_num ⇒ Object
22 23 24 25 |
# File 'lib/pwnlib/shellcraft/generators/helper.rb', line 22 def label_num @label_num ||= 0 @label_num += 1 end |
Instance Method Details
#clear ⇒ Object
28 29 30 |
# File 'lib/pwnlib/shellcraft/generators/helper.rb', line 28 def clear @_output = StringIO.new end |
#typesetting ⇒ Object
Indent each line 2 spaces.
33 34 35 36 37 38 39 40 |
# File 'lib/pwnlib/shellcraft/generators/helper.rb', line 33 def typesetting indent = @_output.string.lines.map do |line| next "#{line.strip}\n" if label_str?(line.strip) line == "\n" ? line : ' ' * 2 + line.lstrip end indent.join end |