Skip to content

Instantly share code, notes, and snippets.

@gdbinit
gdbinit / gist:8282fe8c6b9bc7addb53470615e870ff
Created November 1, 2018 00:31
Xcode Command Line tools template with /usr/local folders in search paths
Copy folder Xcode.app/Contents/Developer/Library/Xcode/Templates/Project Templates/Mac/Application/Command Line Tool.xctemplate folder
to ~/Library/Developer/Xcode/Templates/Custom/
Modifity the plist to the following. Scroll down when choosing new project template and should be there in Custom area.
The trick is this:
<key>Project</key>
<dict>
<key>SharedSettings</key>
<dict>
@gdbinit
gdbinit / gist:3c2022907af5ca476173985492d6ec6e
Created January 23, 2018 19:16
Retrieve IDA stack variables cross references from IDA C SDK
/* retrieve the current function information - we need this to extract the stack frame */
func_t *current_function = get_func(current_addr);
/* retrieve the stack frame for this function - IDA encapsulates it as struc_t */
struc_t *frame = get_frame(current_function);
/* now each variable is a member of the structure - Chris Eagle book shows how to iterate over this */
for (int i = 0; i < frame->memqty; i++)
{
/* so each variable is a member - we can retrieve its netnode id via the .id field - in case of structures/stack variables
* this is an address starting by 0xFF but it's still a netnode like everything else in IDA
*/