Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I am getting some compiler errors and I assume that this is because of the .NET managed code. I'm not sure though, and if so, maybe I can disable it somehow. Please check it out below and see the error:

 

(386): error C2664: 'strlen' : cannot convert parameter 1 from 'unsigned char *' to 'const char *'

 

memcpy(&buf[2036], sc, strlen(sc));

 

Any ideas?

 

Netsniper

  • Administrators
Posted

Forgot to ask how sc is declared as well?

if it is something like

unsigned char* sc;

then you will need to cast it to a signed char...

memcpy(&buf[2036], sc, strlen((char *)sc));

however this could result in the loss of data, is there a reason why one is declared unsigned and the other signed? Also it may help if you give more detail on what you are trying to do - there may be another reason (although admittedly C++ isn't my strong point)

Posting Guidelines FAQ Post Formatting

 

Intellectuals solve problems; geniuses prevent them.

-- Albert Einstein

Posted

It is only the first parameter being passed to memcpy that is the problem, not the third. Basically, I am quite new to programming (less than a year of seriously applied experience with VB .NET, Java, MS VC++). I never really learned C, since I am learning Java now - I know - shoot me. Anyways, I am trying to compile some security related code having to do with recent MS vulnerabilities. I could link you to a copy of the code if you like here:

 

http://packetstorm.linuxsecurity.com/0405-exploits/HOD-ms04011-lsasrv-expl.c

 

Netsniper

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...