Skip to content

Instantly share code, notes, and snippets.

View ice799's full-sized avatar

Joe Damato ice799

  • san francisco, ca
View GitHub Profile
> I am trying to patch an executable with does not link to Lua (script library) yet includes the source. The function luaL_newstate is the
> one wanted, which is present in the mach-o and I can see the instruction address and the displacement to the function.
so you have a binary which does not link to lua_whatever.so ? ok...
> I have tried numerous methods of inserting the hook displacement for the displacement in the binary of interest. I would assume it requires
> using execve to run the binary of interest yet that will overwrite the address space of the patcher. I have tried fork -> ptrace
> PT_TRACE_ME execve and then trying dlsym(RTLD_DEFAULT, "luaL_newstate"); after a signal with the intention of overwriting memory with the
> hook. I tested this by not including the Lua lib in the patcher and it does not find the symbol.
diff --git a/ext/gpgme/gpgme_n.c b/ext/gpgme/gpgme_n.c
index b9f9d6d..06c092a 100644
--- a/ext/gpgme/gpgme_n.c
+++ b/ext/gpgme/gpgme_n.c
@@ -109,6 +109,11 @@
#define UNWRAP_GPGME_TRUST_ITEM(vitem, item) \
Data_Get_Struct(vitem, struct _gpgme_trust_item, item)
+#ifdef HAVE_RUBY_ENCODING_H
+#include <ruby/encoding.h>
diff --git a/test/fixtures/cookbooks/packagecloud_test/recipes/rubygems.rb b/test/fixtures/cookbooks/packagecloud_test/recipes/rubygems.rb
index 6a72864..a2677e2 100644
--- a/test/fixtures/cookbooks/packagecloud_test/recipes/rubygems.rb
+++ b/test/fixtures/cookbooks/packagecloud_test/recipes/rubygems.rb
@@ -1,13 +1,17 @@
-return if platform?('centos') && node['platform_version'].to_i == 5
-
include_recipe 'packagecloud_test::distro_deps'
packagecloud_repo 'computology/packagecloud-cookbook-test-public' do
@ice799
ice799 / build.sh
Created July 20, 2010 20:30
ugly testing harness
rm *.o test
as -a --gstabs --64 -march=core2 -o funcs64.o funcs64.S
gcc test.c -Wall -m64 -march=core2 -c
gcc funcs64.o test.o -Wall -m64 -march=core2 -o test
#!/custom/ree/bin/ruby
# USAGE:
#
# echo "|/path/to/core_helper.rb %p %s %u %g" > /proc/sys/kernel/core_pattern
#
require 'etc'
require 'net/smtp'
/* machdep.S - machine dependent assembly routines for the GDB stub */
/*
* Copyright (C) 2006 Lubomir Kundrak
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
-----> serverspec installed (version 2.31.1)
/opt/chef/embedded/bin/ruby -I/tmp/busser/suites/serverspec -I/tmp/busser/gems/gems/rspec-support-3.4.1/lib:/tmp/busser/gems/gems/rspec-core-3.4.4/lib /opt/chef/embedded/bin/rspec --pattern /tmp/busser/suites/serverspec/\*\*/\*_spec.rb --color --format documentation --default-path /tmp/busser/suites/serverspec
Command "ls /usr/local/bin/jake"
exit_status
should eq 0 (FAILED - 1)
Command "/usr/local/bin/jake"
exit_status
should eq 0 (FAILED - 2)
Mar 27 14:33:10 sg123 bprobe[83972]: 27/Mar/2012 14:33:10 [nprobe.c:3087] Welcome to bprobe v.1.0.0fi772 ($Revision: 1983 $) for x86_64-redhat-linux-gnu
Mar 27 14:33:10 sg123 bprobe[83972]: 27/Mar/2012 14:33:10 [nprobe.c:3106] Tracing enabled
Mar 27 14:33:10 sg123 bprobe[83972]: 27/Mar/2012 14:33:10 [nprobe.c:4858] There are no bonded interfaces being monitored.
Mar 27 14:33:10 sg123 bprobe[83972]: 27/Mar/2012 14:33:10 [plugin.c:133] Loading plugins...
Mar 27 14:33:10 sg123 bprobe[83972]: 27/Mar/2012 14:33:10 [plugin.c:142] No plugins found in ./plugins
Mar 27 14:33:10 sg123 bprobe[83972]: 27/Mar/2012 14:33:10 [plugin.c:142] No plugins found in /usr/local/lib/bprobe/plugins
Mar 27 14:33:10 sg123 bprobe[83972]: 27/Mar/2012 14:33:10 [plugin.c:146] WARNING: Unable to find plugins directory. bProbe will work without plugins!
Mar 27 14:33:10 sg123 bprobe[83972]: 27/Mar/2012 14:33:10 [plugin.c:196] 0 plugin(s) loaded [0 delete][0 packet].
Mar 27 14:33:10 sg123 bprobe[83972]: 27/Mar/2012 14:33:10 [nprobe.c:4992] We
@ice799
ice799 / an_bug.S
Created January 3, 2012 20:01
an bug
# can you spot the bug?
#
# if so, boundary is hiring: jobs@boundary.com
#
c03bc00c <atomic64_add_return_cx8>:
c03bc00c: 55 push %ebp
c03bc00d: 53 push %ebx
c03bc00e: 56 push %esi
c03bc00f: 57 push %edi
/* there are bugs in this this is just copy and pasted, but might be a good reference */
static void
dump_registers(void *context)
{
ucontext_t *uc = context;
#if defined(linux)
#if defined(BUILD_ARCH_X86_64)
traceEvent(TRACE_ERROR, "RBP = 0x%0.16lx, RSP = 0x%0.16lx, RIP = 0x%0.16lx",