Skip to content

Instantly share code, notes, and snippets.

View LTears's full-sized avatar
🏠
Working from home

LTears LTears

🏠
Working from home
  • Abetsafe Security Lab
  • Helsinki Finland
View GitHub Profile
@LTears
LTears / sfinae_tostring_ex.cpp
Created December 26, 2019 06:47 — forked from fenbf/sfinae_tostring_ex.cpp
C++ SFINAE example: how to detect if a class contains ToString method
// SFINAE, enable_if example
// based on http://stackoverflow.com/questions/257288/is-it-possible-to-write-a-c-template-to-check-for-a-functions-existence
#include <iostream>
#include <type_traits>
class ClassWithToString
{
public:
@LTears
LTears / wildcards.c
Created June 25, 2018 03:36 — forked from orca-zhang/wildcards.c
case sensitive wildcards match function
/*
MIT License
Copyright (c) 2010-2017 <http://ez8.co> <orca.zhang@yahoo.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
@LTears
LTears / mw32getpeb.c
Created June 15, 2017 02:37 — forked from okumura/mw32getpeb.c
Get PEB for Windows.
LPVOID mw32GetPeb() {
#if defined(_WIN64)
UINT64 uiPeb = __readgsqword(0x60);
return (LPVOID) (UINT_PTR) uiPeb;
#else
UINT32 uiPeb = __readfsdword(0x30);
return (LPVOID) (UINT_PTR) uiPeb;
#endif
}