This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Drop this into msf3 root-dir as 'msf-rex.gemspec'. | |
# | |
# Create gem with: | |
# $ gem build msf-rex.gemspec | |
# | |
# Note there's already a "rex" rubygem, which is why we used 'msf-rex'. | |
# We can still "require 'rex'" though. | |
$: << 'lib' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# copy and paste this into IRB... | |
# | |
require 'ffi' | |
class Foo < FFI::Struct | |
layout :ary, [:uint16, 10] | |
end | |
f = Foo.new |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env jruby | |
# This code works fine in MRI, but not JRuby. For some strange reason | |
# jruby cannot superclass FFI::MemoryPointer or FFI::Buffer and override | |
# the initialize() method. | |
require 'ffi' | |
class SpecialBuffer < FFI::Buffer | |
def initialize() | |
super(256) |
NewerOlder