Signatures = {}

local function AddSignature( name, module, sig )
        local mask = sig:gsub( "[0-9A-F]+%s*", "x" ):gsub( "%?%s*", "?" )
        sig = sig:gsub( "%?", "00" ):gsub( "([0-9A-F]+)%s*", function( byte )
				io.write( byte .. " " )
                return string.char( tonumber( byte, 16 ) )
        end )

		print()

        Signatures[name] = {
                Signature = sig;
                Mask = mask;
                Module = module;
                Length = sig:len();
        }
end

AddSignature(
        "Example Sig",
        "lua_shared",
        "DE AD BE    EF   ? ? ? ?    /* awesome comment */    C3    90 90 90    CA FE BA BE ? ? ? ?"
)