microsoft / microsoft/Detours

Add minimal sample for detouring malloc

Open
#45 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement help-wanted
Dominant language
C++
Stars
6.4k
Forks
1.2k
PR merge metrics
No merged PRs in 30d

Description

It would be great if there was a minimal sample which intercepts malloc and shows how to run code before and after the original malloc. In the sample it could be just a printf of the requested size and (after malloc did run) the obtained memory address.

I would find this especially useful as the FAQ has an entry on malloc.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the repository’s existing sample layout and the linked FAQ entry, “Why don't I see any calls to my detour of malloc?”. Add a minimal malloc-detouring sample that prints the requested size before the original call and the obtained memory address afterward; done means the sample builds and demonstrates both messages.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
devtools, operating-systems
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.