标签: fiddle

Ruby Fiddle中的嵌套结构

  • 是否有可能在Ruby的Fiddle lib中定义嵌套结构签名?
  • 或者在这一点上通过我不熟悉的任何其他最新图书馆?

这是一个绝望的问题,因为我搜索了文档和Fiddle的代码,发现没有关于嵌套结构的线索(尽管FFI库能够做到这一点,而Fiddle应该是FFI的包装器).

ruby dll shared-libraries fiddle

39
推荐指数
1
解决办法
1059
查看次数

如何延迟div中背景图像的显示

这是我的小提琴.


我只是希望background-image:css中的" "完全加载并在3秒后显示快速淡入效果,直到那时整个div必须是黑色.
怎么可能在cssjavascript.

.initials {
    position:absolute;
    background:black;
    background-image: url("http://static.tumblr.com/lxn1yld/Hnxnxaqya/space.gif");
    color:white;
    margin-top:20px;
    padding-top:20px;
    padding-bottom:20px;
    width:60px;
    text-align:center;
    margin-left:20px;
    font-size:17px;
    letter-spacing:5px;
    box-shadow:0px 2px 3px rgba(0,0,0,.15);
    overflow: hidden;
    white-space: nowrap;
}
Run Code Online (Sandbox Code Playgroud)
<div class="initials">A</div>
Run Code Online (Sandbox Code Playgroud)

html javascript css jquery fiddle

21
推荐指数
2
解决办法
6092
查看次数

如何使用Fiddle with Windows API(dll)在Ruby中运行shellcode

我正在尝试使用ruby Fiddle标准库来运行Windows API以运行shellcode

代码的想法是

  1. 有一个执行任何事情的hexdicemial shellcode raw(例如MessageBoxA)
  2. 呼叫 kernel32.dll
  3. 为这个shellcode分配一个内存. VirtualAlloc
  4. 为这个shellcode创建一个缓冲区
  5. 将shellcode移动到该分配. RtlMoveMemory
  6. 创建一个新线程来执行该shellcode. CreateThread
  7. 等待执行/线程结束. WaitForSingleObject

这是代码:

require 'fiddle'
require 'fiddle/import'
require 'fiddle/types'

shellcode = # MessageBoxA
"\x31\xd2\xb2\x30\x64\x8b\x12\x8b\x52\x0c\x8b\x52\x1c\x8b\x42" +  
"\x08\x8b\x72\x20\x8b\x12\x80\x7e\x0c\x33\x75\xf2\x89\xc7\x03" + 
"\x78\x3c\x8b\x57\x78\x01\xc2\x8b\x7a\x20\x01\xc7\x31\xed\x8b" + 
"\x34\xaf\x01\xc6\x45\x81\x3e\x46\x61\x74\x61\x75\xf2\x81\x7e" + 
"\x08\x45\x78\x69\x74\x75\xe9\x8b\x7a\x24\x01\xc7\x66\x8b\x2c" + 
"\x6f\x8b\x7a\x1c\x01\xc7\x8b\x7c\xaf\xfc\x01\xc7\x68\x79\x74" + 
"\x65\x01\x68\x6b\x65\x6e\x42\x68\x20\x42\x72\x6f\x89\xe1\xfe" + 
"\x49\x0b\x31\xc0\x51\x50\xff\xd7"

include Fiddle 
kernel32 = Fiddle.dlopen('kernel32')

puts "[-] VirtualAlloc"
ptr = Function.new(kernel32['VirtualAlloc'], [4,4,4,4], 4).call(0, (shellcode.size), 0x3000, 0x40)
Function.new(kernel32['VirtualProtect'], [4,4,4,4], 4).call(ptr, shellcode.size, 0, 0)

puts "[-] Create buffer"
buf = Fiddle::Pointer[shellcode]

puts "[-] RtlMoveMemory"
Function.new(kernel32['RtlMoveMemory'], [4, 4, 4], …
Run Code Online (Sandbox Code Playgroud)

c ruby windows winapi fiddle

6
推荐指数
1
解决办法
288
查看次数

如何使用 Ruby fiddle 加载 Windows DLL 文件?

我正在尝试为 ruby​​ 创建一个GR 框架绑定。我用小提琴。Fiddle 是使用 ruby​​ 转换外部函数接口 (FFI) 的默认扩展。它在 Linux 和 Mac 上运行良好。但在 Windows 上,我收到以下错误。

代码hoge.rb

require 'fiddle/import'

module M
   extend extend Fiddle::Importer
   dlload File.expand_path('gr/bin/libGR.dll').gsub("/", "\\")
end
Run Code Online (Sandbox Code Playgroud)

错误

Traceback (most recent call last):
        7: from hoge.rb:3:in `<main>'
        6: from hoge.rb:5:in `<module:M>'
        5: from C:/Ruby26-x64/lib/ruby/2.6.0/fiddle/import.rb:77:in `dlload'
        4: from C:/Ruby26-x64/lib/ruby/2.6.0/fiddle/import.rb:77:in `collect'
        3: from C:/Ruby26-x64/lib/ruby/2.6.0/fiddle/import.rb:87:in `block in dlload'
        2: from C:/Ruby26-x64/lib/ruby/2.6.0/fiddle.rb:47:in `dlopen'
        1: from C:/Ruby26-x64/lib/ruby/2.6.0/fiddle.rb:47:in `new'
C:/Ruby26-x64/lib/ruby/2.6.0/fiddle.rb:47:in `initialize': No such file or directory (Fiddle::DLError)
        5: from hoge.rb:3:in `<main>'
        4: from hoge.rb:5:in …
Run Code Online (Sandbox Code Playgroud)

ruby windows dll ruby-ffi fiddle

5
推荐指数
1
解决办法
1505
查看次数

加/减最大值输入

我有一个加/减按钮,希望用户不能选择超过 20 个,但不知道如何让它工作。我尝试使用 min="1" max="5 属性,但它们不起作用。这是我的代码和小提琴的链接。https: //jsfiddle.net/6n9298gp/

<form id='myform' method='POST' action='#' class="numbo">
<input type='button' value='-' class='qtyminus' field='quantity' style="font-weight: bold;" />
<input type='text' name='quantity' value='1' class='qty' style="margin-bottom: 0px !important" onkeypress='return event.charCode >= 48 && event.charCode <= 57'/>
<input type='button' value='+' class='qtyplus' field='quantity' style="font-weight: bold;" />
</form>

<script type="text/javascript">
jQuery(document).ready(function(){
    // This button will increment the value
    $('.qtyplus').click(function(e){
        // Stop acting like a button
        e.preventDefault();
        // Get the field name
        fieldName = $(this).attr('field');
        // Get its current value
        var currentVal = parseInt($('input[name='+fieldName+']').val()); …
Run Code Online (Sandbox Code Playgroud)

html jquery button fiddle

1
推荐指数
1
解决办法
1万
查看次数

标签 统计

fiddle ×5

ruby ×3

dll ×2

html ×2

jquery ×2

windows ×2

button ×1

c ×1

css ×1

javascript ×1

ruby-ffi ×1

shared-libraries ×1

winapi ×1