Skip to content

Instantly share code, notes, and snippets.

@yoggy
yoggy / gist:836648
Created February 21, 2011 04:06
Windowsでウインドウスタイルを途中で変更するサンプル?
HWND hWnd = ::FindWindow(NULL, window_name);
LONG style = GetWindowLong(hWnd, GWL_STYLE);
style &= ~WS_SIZEBOX;
SetWindowLong(hWnd, GWL_STYLE, style);
@yoggy
yoggy / gist:858169
Created March 7, 2011 06:54
crypt300-writeup.rb
#!/usr/bin/ruby
#
# CODEGATE2011 Crypt300 Writeup
#
# oracle old password hash
# http://svn.sqlmap.org/sqlmap/trunk/sqlmap/lib/utils/hash.py
#
# openssl library for ruby
# $ sudo apt-get install libopenssl-ruby
#
@yoggy
yoggy / gist:858174
Created March 7, 2011 07:07
#!/usr/bin/ruby # # CODEGATE2011 CTF Pre-qual Crypto100 Writeup # # how to: # $ ruby crypt100-writeup.rb # incryptographyasubstitutioncipherisamethodofencryptionbywhichunitsof # plaintextarereplacedwithciphertextaccordingtoaregularsystemtheun
#!/usr/bin/ruby
#
# CODEGATE2011 CTF Pre-qual Crypto100 Writeup
#
# how to:
# $ ruby crypt100-writeup.rb
# incryptographyasubstitutioncipherisamethodofencryptionbywhichunitsof
# plaintextarereplacedwithciphertextaccordingtoaregularsystemtheunits
# maybesingleletterspairsofletterstripletsoflettersmixturesoftheabovethis
# ciphertextisencryptedbytelephonekeypadsowecallthiskeypadcipher
#!/usr/bin/ruby
#
# Stringクラスにxor(^)を追加してみるテスト。主にCTF用?
#
class String
def ^(str)
raise "Illigal size!" if self.size != str.size
(0...self.size).inject("") {|r,i| r += (self[i] ^ str[i]).chr}
end
@yoggy
yoggy / xor_method_for_string.rb
Created March 7, 2011 10:29
Stringクラスにxor(^)を追加してみるテスト。主にCTF用?
#!/usr/bin/ruby
#
# Stringクラスにxor(^)を追加してみるテスト。主にCTF用?
#
class String
def ^(str)
raise "Illigal size!" if self.size != str.size
(0...self.size).inject("") {|r,i| r + (self[i] ^ str[i]).chr}
end
@yoggy
yoggy / get_exe_directory.c
Created March 9, 2011 07:50
How to get exe directory (only Linux)
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/param.h>
#include <libgen.h>
#include <memory.h>
// for linux only
void get_exe_path(char *dir, int size)
{
@yoggy
yoggy / maintenance503-webserver.rb
Created March 21, 2011 08:27
maintenance503-webserver.rb
#!/usr/bin/ruby
$KCODE='utf8'
require 'base64'
require 'webrick'
include WEBrick
include WEBrick::HTTPServlet
# default configuration
#!/usr/bin/ruby
#
# jishin_notifier.rb
#
# How to use...
#
# $ gem sources -a http://gems.github.com/
# $ gem install intridea-tweetstream
# $ gem install xmpp4r
# $ gem install net-netrc
@yoggy
yoggy / jishin_notifier.rb
Created March 22, 2011 09:23
jishin_notifier.rb
#!/usr/bin/ruby
#
# jishin_notifier.rb
#
# How to use...
#
# $ gem sources -a http://gems.github.com/
# $ gem install intridea-tweetstream
# $ gem install xmpp4r
# $ gem install net-netrc
@yoggy
yoggy / udp_packet_recieve_test.rb
Created April 16, 2011 16:40
UDP packet recieve test code...
#!/usr/bin/ruby
#
# UDP packet recieve test...
#
require 'socket'
addr = '127.0.0.1'
port = 12345
puts "== create socket for recv =="