netsniper Posted May 3, 2004 Posted May 3, 2004 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 Quote
Administrators PlausiblyDamp Posted May 3, 2004 Administrators Posted May 3, 2004 how is buf declared? Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
netsniper Posted May 3, 2004 Author Posted May 3, 2004 how is buf declared? #define LEN 3500 #define BUFSIZE 2000 char buf[LEN+1]; Quote
netsniper Posted May 4, 2004 Author Posted May 4, 2004 Is this a problem because of MANAGED C++ code? Netsniper Quote
Administrators PlausiblyDamp Posted May 4, 2004 Administrators Posted May 4, 2004 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) Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
netsniper Posted May 4, 2004 Author Posted May 4, 2004 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 Quote
Administrators PlausiblyDamp Posted May 4, 2004 Administrators Posted May 4, 2004 1st parameter to the strlen function - not the 1st parameter to the memcpy. Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.