Skip to content

Instantly share code, notes, and snippets.

@koichiro
Created June 12, 2011 09:57
Show Gist options
  • Save koichiro/1021392 to your computer and use it in GitHub Desktop.
Save koichiro/1021392 to your computer and use it in GitHub Desktop.
require 'Win32API'
w32 = Win32API.new('kernel32.dll','GetModuleFileName','ppi','i')
buf = "\0" * 1024
size = w32.call(nil, buf, 1024)
puts buf[0,size]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment