Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6742921
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T11:54:00+00:00 2026-05-26T11:54:00+00:00

I’m trying to obtain the values of the arguments to a function using intel

  • 0

I’m trying to obtain the values of the arguments to a function using intel pin. Single argument functions are simple enough using the example ManualExamples/malloctrace.cpp . However, when I try to get the argument values with multiple arguments I run into trouble.

Eg. Trying to capture the argument values of the following function:

void funcA(int a, int b, int c) {
    printf("Actual: %i %i %i\n", a,b,c);
}

With the following pin code

VOID funcHandler(CHAR* name, int a, int b, int c) {
   printf("Pin: %s %i %i %i\n", name, a, b, c);
}

VOID Image(IMG img, VOID *v) {
    RTN funcRtn = RTN_FindByName(img, "funcA");
    if (RTN_Valid(funcRtn)) {
        RTN_Open(funcRtn);
        RTN_InsertCall(funcRtn, IPOINT_BEFORE, (AFUNPTR)funcHandler, 
                      IARG_ADDRINT, "funcA", IARG_FUNCARG_ENTRYPOINT_VALUE, 
                      0, IARG_END);
        RTN_Close(funcRtn);
    }
}

I get the following output

Pin: funcA 0 -656937200 -10
Actual: 0 -10 0
Pin: funcA 1 -656937200 -9
Actual: 1 -9 20
Pin: funcA 2 -656937200 -8
Actual: 2 -8 40

I can see that I’m close, but something isn’t aligned properly. I know about RTN_ReplaceProbed, but I need to use pin in jit mode as I need instruction level instrumentation.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T11:54:01+00:00Added an answer on May 26, 2026 at 11:54 am

    I think it’s actually a pretty easy one to fix, since you’ve basically got everything right to begin with.

    The only problem is that when calling RTN_InsertCall, you only extract the first argument (which is why Pin and Actual are the same for the first argument but not the others). You simply need to give a few more arguments to RTN_InsertCall so that funcHandler gets all the arguments it needs.

    So, instead of

    RTN_InsertCall(funcRtn, IPOINT_BEFORE, (AFUNPTR)funcHandler, 
        IARG_ADDRINT, "funcA", IARG_FUNCARG_ENTRYPOINT_VALUE, 
        0, IARG_END);
    

    just do

    RTN_InsertCall(funcRtn, IPOINT_BEFORE, (AFUNPTR)funcHandler, 
        IARG_ADDRINT, "funcA", IARG_FUNCARG_ENTRYPOINT_VALUE, 
        0, IARG_FUNCARG_ENTRYPOINT_VALUE, 1,
        IARG_FUNCARG_ENTRYPOINT_VALUE, 2, IARG_END);
    

    All I did was add a couple more IARG_FUNCARG_ENTRYPOINT_VALUE with 1 and 2 to get the 1st and 2nd arguments, after you already got the 0th argument.

    I’m currently not on the machine where I have Pin set up to test, but if it doesn’t work let me know.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to use string.replace('’','') to replace the dreaded weird single-quote character: ’ (aka
I'm trying to create an if statement in PHP that prevents a single post
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm making a simple page using Google Maps API 3. My first. One marker
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.