Skip to content

Instantly share code, notes, and snippets.

View lallousx86's full-sized avatar

Elias Bachaalany lallousx86

View GitHub Profile
@lallousx86
lallousx86 / FindFuncEATSlot.cpp
Created March 30, 2017 17:46
Find the EAT slot of a given function
//-------------------------------------------------------------------------
PDWORD FindFuncEATAddressSlot(
HMODULE hModule,
LPCSTR FuncName)
{
if (hModule == nullptr)
return nullptr;
ULONG_PTR Base = ULONG_PTR(hModule);
@lallousx86
lallousx86 / ListViewExtensions.cs
Created January 14, 2016 20:33
C#/ListView extensions
public static class ListViewExtensions
{
public static string GetItemsString(
this System.Windows.Forms.ListViewItem lvi,
string SurroundL = "\"",
string SurroundR = "\"",
string Join = "\t")
{
List<string> s = new List<string>();
foreach (System.Windows.Forms.ListViewItem.ListViewSubItem CurSub in lvi.SubItems)
@lallousx86
lallousx86 / XmlExtensions.cs
Created January 14, 2016 19:34
C# XML serialize/deserialize
public static class XmlExtensions
{
static public string GetAttrValue(
this XmlNode node,
string AttrName)
{
try
{
return node.Attributes[AttrName].Value;
}
@lallousx86
lallousx86 / AnsiOrWideString.cpp
Last active June 12, 2017 00:01
AnsiOrWideString_t()
//--------------------------------------------------------------------------
#pragma warning(push)
#pragma warning(disable: 4127)
template <class DT, class ST> class AnsiOrWideString_t
{
const DT *dstr;
bool bOwned;
AnsiOrWideString_t &operator =(const AnsiOrWideString_t &) { }
AnsiOrWideString_t(const AnsiOrWideString_t &) { }
@lallousx86
lallousx86 / QuickTokenizer.cpp
Last active June 12, 2017 00:02
strtok wrapper / tokenizer
//////////////////////////////////////////////////////////////////////////
class QuickTokenizer
{
private:
char *buf;
char *token;
char *ctx;
void FreeBuffers()
{
@lallousx86
lallousx86 / get_rop_gadget_string
Created September 11, 2014 23:34
Return the body of a ROP gadget as a string
import idaapi
import idautils
import idc
def get_rop_gadget_string(addr):
gb = []
while True:
# Decode
i = idautils.DecodeInstruction(addr)