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

  • Home
  • SEARCH
  • 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 7957863
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T04:19:41+00:00 2026-06-04T04:19:41+00:00

In that intercepted function below, I have buff as a pointer to buffer, how

  • 0

In that intercepted function below, I have buff as a pointer to buffer, how can I change data without creating new my own buffer?

int WINAPI OwnRecv(SOCKET s, char FAR *buff, int len, int flags)
{
    if(s == ServerSocket)
    {
        int received = pTrampolineRecv(s, buff, len, flags);

        if(received <= 0)
        {
            return received;
        }

            unsigned char ReceiveBuffer[1024]; // how can i avoid creatin this by changing buff directly?
        do_decrypt((const unsigned char *) buff, ReceiveBuffer, received, KeyTest, NULL);
        buff = (char *) ReceiveBuffer;

        return received;
    }
    return pTrampolineRecv(s, buff, len, flags);
}

upd

I added my do_decrypt function

bool do_decrypt(const unsigned char *in, unsigned char *out, int inlen)
{
  int buflen, tmplen;

  if(!EVP_DecryptUpdate(&Decrypt_ctx, out, &buflen, in, inlen))
  {
        return false;
  }

  if(!EVP_DecryptFinal_ex(&Decrypt_ctx, out + buflen, &tmplen))
    {
        return false;
  }

  return true;
}
  • 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-06-04T04:19:42+00:00Added an answer on June 4, 2026 at 4:19 am

    You should definitely take a look at C++ tutorial about pointers before jumping straight on WinAPI code.

    Also, FAR keyword is deprecated.

    The simplest idea would be

    do_decrypt ((const unsigned char*) buff, (unsigned char *) buff, received, KeyTest, NULL);
    

    So basically – putting buff as both input and output variable.

    But I DO NOT recommend using it, as I don’t know how do_decrypt function works – you might end messing up your own data when decrypting. Only use above if do_decrypt is using some sort of (possibly smaller) internal buffer.

    Maybe try to clarify the question a bit more, as now I won’t be able to give you any more advice on the question.

    EDIT: So, thanks to other answers, you can use solution above when:

    1. Result data will fit in the input buffer (size of output <= size of input)
    2. do_decrypt function allows in situ operation – thus, modyfing data that’s being read.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some jQuery code that intercepts links clicked on a page: $(document).ready(function() {
I have a function that takes a string object name and I need the
I have a table that contains a lot of data, where we particularly care
i have two javascript functions, save() and saveAll() , set up as below: function
I have a Java class MyPojo that I am interested in deserializing from JSON.
I'm interested in creating a plugin that does this simple task: Steps 1. User
I have a function which needs to go through a class' types and identify
I have this interesting jQuery function. It basically adds a click handler to link,
Below is a small test case that demonstrates a problem that I am trying
My problem is that I have two functions and one of the functions calls

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.