This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define HOOK_CALL(lib, name, size) \ | |
static void (*_ ## name ## _hook)(void); \ | |
void name (void) { \ | |
void *args = __builtin_apply_args(); \ | |
DBG("Calling %s", #name); \ | |
if (!_ ## name ## _hook) { \ | |
void *orig_p, *orig; \ | |
void *hook = get_lib_hook(lib); \ | |
orig = dlsym(RTLD_NEXT, #name); \ | |
if (!orig) { \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def equip(name): | |
name = ' '.join(name) | |
item = get_inv_item(name, False) | |
if item.equipped: | |
print "%s is already equipped", name | |
return | |
if item.slot is None: | |
print "You equip %s" % name | |
power += item.bonus |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/dlls/crypt32/cert.c b/dlls/crypt32/cert.c | |
index 75b0e12..8571c83 100644 | |
--- a/dlls/crypt32/cert.c | |
+++ b/dlls/crypt32/cert.c | |
@@ -317,25 +317,28 @@ static BOOL CertContext_GetProperty(void *context, DWORD dwPropId, | |
break; | |
case CERT_KEY_IDENTIFIER_PROP_ID: | |
{ | |
+ CRYPT_DATA_BLOB value; | |
+ DWORD size = sizeof(value); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int cnt = 0; | |
while (getenv("LD_PRELOAD")) { | |
fprintf(stderr, "l"); | |
unsetenv("LD_PRELOAD"); | |
if (cnt++ > 10) | |
break; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define WIN32_LEAN_AND_MEAN | |
#define SECURITY_WIN32 | |
#include <Windows.h> | |
#include <WinCrypt.h> | |
#include <Security.h> | |
#include <stdio.h> | |
#pragma comment(lib, "crypt32") | |
#define skip(...) do { printf(__VA_ARGS__); goto out; } while (0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>>> for line in data: | |
... print "checking", line, | |
... m = re.search("latitude.*'(.*)'", line) | |
... if m: | |
... print m.group(1) | |
... | |
checking function geoip_country_code() { return 'RU'; } | |
checking function geoip_country_name() { return 'Russian Federation'; } | |
checking function geoip_city() { return 'Moscow'; } | |
checking function geoip_region() { return '48'; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def calc_jtt(start, end, now): | |
now = now.datetime() | |
end = end.datetime() | |
start = start.datetime() | |
hlen = (end - start).seconds/6.0 | |
tnow = (now - start).seconds | |
return tnow/hlen |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
proxy = None | |
proxydict = urllib2.ProxyHandler().proxies | |
for type in ["https", "http", "socks"]: | |
if type not in proxydict: | |
continue | |
proxyline = proxydict[type] | |
schemalen = length(type + 3) # "<schema>://" | |
if proxyline[:schemalen] == "%s://" % type | |
proxyline = proxyline[schemalen:] | |
proxAddr, proxPort = proxyline.split(":") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
int a() { | |
printf("a called\n"); | |
return 0; | |
} | |
int b() { | |
printf("b called\n"); | |
return 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <math.h> | |
typedef unsigned long long int val_t; | |
val_t naive_calc(val_t n, val_t min) { | |
val_t k; | |
for (k = min; k < n; k++) | |
if (n / k == n / (k + 1)) | |
return k; |