class Object

Public Instance Methods

c(int) click to toggle source
# File lib/basic.rb, line 28
def c(int)
    [int].pack("C")
end
hex(str) click to toggle source
# File lib/basic.rb, line 32
def hex(str)
    str.unpack("H*")[0]
end
i16(int) click to toggle source
# File lib/basic.rb, line 1
def i16(int)
    [int].pack("S<")
end
i32(int) click to toggle source
# File lib/basic.rb, line 5
def i32(int)
    [int].pack("L<")
end
i64(int) click to toggle source
# File lib/basic.rb, line 9
def i64(int)
    [int].pack("Q<")
end
log(str) click to toggle source
# File lib/basic.rb, line 40
def log(str)
    $stderr.puts "[-] #{str}"
end
nop() click to toggle source
# File lib/basic.rb, line 36
def nop()
    "\x90"
end
s16(int) click to toggle source
# File lib/basic.rb, line 13
def s16(int)
    str = str.ljust(2, "\x00")
    str.unpack("S<")[0]
end
s32(str) click to toggle source
# File lib/basic.rb, line 18
def s32(str)
    str = str.ljust(4, "\x00")
    str.unpack("L<")[0]
end
s64(str) click to toggle source
# File lib/basic.rb, line 23
def s64(str)
    str = str.ljust(8, "\x00")
    str.unpack("Q<")[0]
end