Skip to content

Instantly share code, notes, and snippets.

inline void InitializeListHead(LIST_ENTRY* list_head)
{
list_head->Flink = list_head;
list_head->Blink = list_head;
}
inline int IsListEmpty(LIST_ENTRY* list_head)
{
return list_head->Flink == list_head;
}
@ek0
ek0 / user.css
Last active July 2, 2019 17:40
IDA Pro Theme
/* NOTE: This is an autogenerated file; please do not edit. */
CustomIDAMemo
{
qproperty-line-fg-default: white;
qproperty-line-fg-regular-comment: #0E8F1D;
qproperty-line-fg-insn: #B6B6B6;
qproperty-line-fg-dummy-data-name: #CA0003;
qproperty-line-fg-regular-data-name: #C50003;
qproperty-line-fg-demangled-name: #0DA9FF;
@ek0
ek0 / ida_utils.py
Created June 3, 2019 17:45
useful IDAPython functions
def get_arg_1(call_address):
""" Returns the arg 1 initialization address given a call to a function """
addr = call_address
while GetOpnd(addr, 0) != "rcx":
addr = PrevHead(addr)
return addr
@ek0
ek0 / spawnconsole.cs
Created March 19, 2019 15:32
Spawn Console C#
public static void InitializeConsole(bool alwaysCreateNewConsole = true)
{
bool consoleAttached = true;
if (alwaysCreateNewConsole || (Main.AttachConsole(4294967295u) == 0u && (long)Marshal.GetLastWin32Error() != 5L))
{
consoleAttached = (Main.AllocConsole() != 0);
}
if (consoleAttached)
{
Main.InitializeOutStream();