Jump to content
Welcome, Guest
Existing user? Sign In

Sign In



Sign Up
The MatriX
  • Welcome To Ghbsys
  • CS GO Streaming Version is released. Have fun streaming while cheating!
  • Have a Payment Issue? Send us a Support ticket.
  • Make a thread if you need support or join our discord for live support.
  • Have Suggestions? Make a thread and you'll earn Ghbsys Points for implemented suggestions.
  • Join our discord to stay well connected! Don't forget to integrate your discord to the site
  • Welcome to [GHB] - GAmEhAcKbAsTaRdS Forum

    Welcome to [GHB] - GAmEhAcKbAsTaRdS Forum, like most online communities you must register to view or post in our community, but don't worry this is a simple free process that requires minimal information for you to signup. Be apart of [GHB] - GAmEhAcKbAsTaRdS Forum by signing in or creating an account.
    • Start new topics and reply to others
    • Subscribe to topics and forums to get email updates
    • Get your own profile page and make new friends
    • Send personal messages to other members.

    Problem with MD5 in C++


    ShaddiX
     Share

    Recommended Posts

    Im workign on a teeworlds server and I try to secure the password with md5.

     

    I already tested the MD5 class in a testconsoleprogramm. So the class is working.

     

    But when I implent the class in the server project I get more than 100 errors.

     

    And I just include the class, I dont even use the function.

     

     

    some of the errors :

     

    C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\INCLUDE\cstdio(39) : error
    C2143: Syntaxfehler: Es fehlt '{' vor ':'
    C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\INCLUDE\cstdio(39) : error
    C2059: Syntaxfehler: ':'
    C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\INCLUDE\cstdio(41) : error
    C2143: Syntaxfehler: Es fehlt '{' vor ':'
    C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\INCLUDE\cstdio(41) : error
    C2059: Syntaxfehler: ':'
    C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\INCLUDE\cstdio(41) : error
    C2143: Syntaxfehler: Es fehlt '{' vor ':'
    C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\INCLUDE\cstdio(41) : error
    C2059: Syntaxfehler: ':'
    C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\INCLUDE\cstdio(41) : error
    C2143: Syntaxfehler: Es fehlt '{' vor ':'
    C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\INCLUDE\cstdio(41) : error
    C2059: Syntaxfehler: ':'
    C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\INCLUDE\cstdio(42) : error
    C2143: Syntaxfehler: Es fehlt '{' vor ':'
    C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\INCLUDE\cstdio(42) : error
    C2059: Syntaxfehler: ':'
    C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\INCLUDE\cstdio(42) : error
    C2143: Syntaxfehler: Es fehlt '{' vor ':'

    Edited by Shadd!X
    • Upvote 1
    • Downvote 1
    Link to comment
    Share on other sites

    deine includes stehen in konflikt,

     

    läuft das ganze dann auf einem linux oder windows server?

     

    sonst könntest du auf alternativen ausweichen:

     

    #include <wincrypt.h>
    ....
    
    char hash[33] = {0};
    HCRYPTPROV c_prov; 
    HCRYPTHASH c_hash; 
    BYTE raw_hash[64]; 
    DWORD len = sizeof(raw_hash); 
    unsigned int i; 
    
    if(CryptAcquireContext(&c_prov, NULL, NULL, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT | CRYPT_SILENT) && 
    	CryptCreateHash(c_prov, CALG_MD5, 0, 0, &c_hash) && 
    	CryptHashData(c_hash, ( const unsigned char * )sData.c_str(), (DWORD)sData.length(), 0) && 
    	CryptGetHashParam(c_hash, HP_HASHVAL, raw_hash, &len, 0) && 
    	((len * 2) + 1 <= 33)) { 
    		for(i=0;i<len;i++) { 
    			wsprintf(&hash[i * 2], "%02.2x", raw_hash[i]); 
    		}		
    	} else { 
    		return NULL;		
    	} 
    	hash[33] = '\0';

    Edited by Neo I.I.I
    Link to comment
    Share on other sites

    Danke für die Antwort.

     

    Wieso stehen die Includes im Konflikt ? Wie entsteht denn so ein Konflikt ?

     

    Am Ende soll der Server sowohl auf Linux als auch auf Windows laufen.

    Edited by Shadd!X
    Link to comment
    Share on other sites

    wenn er auf linux laufen soll musst auch auf linux compilen, geht dann nicht mit ein und der selben binary. und manche apis die du unter windows hast sind in linux nicht verfügbar und umgekehrt.

     

    ich weiss nicht was alles included ist bei dir jedoch ist laut compiler der fehler in einer include datei bereitgestellt von microsoft... also mögen sich ein paar includes die da aufeinander treffen nicht. welche das sind musst du selbst rausfinden, include reihenfolge ändern usw...

    Link to comment
    Share on other sites

    hmm an sich ging es immer auf Linux, mit md5 hab ichs noch nicht ausprobiert.

     

    Naja ich probier einfach mal weiter rum

     

    Edit:

     

    hmmm hab grad mal alles aus der source genommen außer dem md5 include.

     

    und trotzdem die fehler. Ich versteh es einfach nicht .__.'

    Edited by Shadd!X
    Link to comment
    Share on other sites

    wie ich dir bereits sagte, mit compiler error alleine kannst du keine hilfe erwarten und wirst höchstwahrscheinlich auch keine bekommen.

    Link to comment
    Share on other sites

    Guest
    This topic is now closed to further replies.
     Share

    • Recently Browsing   0 members

      • No registered users viewing this page.
    ×
    ×
    • Create New...