the GUID dont care so much for me i generate it for each login new and it works. But i think the 0x0B can be maybe the problem.Quote:
Where do you have the packet from?
Make sure to use your GUID and to generate the hash automatically (so you don‘t have to change it everytime the client gets an update)
What you said is a bullshit.Quote:
No and no.
When you have decrypted bytes you should never use a string due to the null byte.
Use a std::vector.
And no, C/C++ terminates strings on the first found \0 byte. You cannot change that.
Illuminate me. How is std::vector easier than std::string? The std::vector<char> .data() method returns a const char* which is exactly the same as std::string .c_str(). A std::string is not using \0 or any delimiter at all. You can operate on std::string the same way you operate on std::vector with the benefit of not having to convert from const char* to std::vector to convert it back again to const char* or std::string. You also have access to very useful methods which you may need. What you are saying is senseless and you should stop spreading disinformation out there.Quote:
It is not bullshit since it's about printing a encrypted text packet which contains \0. He might use a vector from the beginning which makes it easier than with a std::string.
Yes, you should. No. Print the string directly.Quote:
Couldn't I work with strings instead of vectors? And, is there a possible way to try avoiding the "\0" while you convert string to const char*?
int main()
{
std::string packet = "NoS0575 7031428 Test 3213852420455EE02E4F9FB7E1263751BA49DC01278E8D8AC6B094C2AD555ABE3512267B6A2D9528A2234E6A90E295E95E12"
"4AE0AB2E54C406C49B533293B3CF c594947f-d4a9-4462-b545-ad7ddbfd71a2 006EC080\x0B0.9.3.3104 0 2F65F4A00E723E4281EFE51CACE4039D";
// print plaintext packet
std::cout << packet << std::endl;
// encrypt
for (std::size_t i = 0; i < packet.length(); i++)
{
packet[i] ^= 0xC3;
packet[i] += 0x0F;
}
// print encrypted packet
std::cout << packet << std::endl;
// ws2_32.send()
send(socket, packet.c_str(), packet.length(), NULL);
return 0;
}
[Only registered and activated users can see links. Click Here To Register...]Quote:
Someone could help me to compile curl library for windows? I want to use it but I don't know how to compile this damn library.
Do you know why I get this error? Did I linked bad the libraries?Quote:
[Only registered and activated users can see links. Click Here To Register...]
You can find compiled binaries too
#include <iostream>
#include <string>
#include "curl.h"
static size_t WriteCallback(void* contents, size_t size, size_t nmemb, void* userp)
{
((std::string*)userp)->append((char*)contents, size * nmemb);
return size * nmemb;
}
int main(void)
{
CURL* curl;
CURLcode res;
std::string readBuffer;
curl = curl_easy_init();
if (curl) {
curl_easy_setopt(curl, CURLOPT_URL, "http://www.google.com");
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, WriteCallback);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, &readBuffer);
res = curl_easy_perform(curl);
curl_easy_cleanup(curl);
std::cout << readBuffer << std::endl;
}
return 0;
}
I thought you wanted help for C++ code.Quote:
Do you know why I get this error? Did I linked bad the libraries?
[Only registered and activated users can see links. Click Here To Register...]
Code:#include <iostream> #include <string> #include "curl.h" static size_t WriteCallback(void* contents, size_t size, size_t nmemb, void* userp) { ((std::string*)userp)->append((char*)contents, size * nmemb); return size * nmemb; } int main(void) { CURL* curl; CURLcode res; std::string readBuffer; curl = curl_easy_init(); if (curl) { curl_easy_setopt(curl, CURLOPT_URL, "http://www.google.com"); curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, WriteCallback); curl_easy_setopt(curl, CURLOPT_WRITEDATA, &readBuffer); res = curl_easy_perform(curl); curl_easy_cleanup(curl); std::cout << readBuffer << std::endl; } return 0; }
My idea is to do it in C++ but I took this example code for a random page.Quote:
I thought you wanted help for C++ code.
Why I see you only posting C code in 2 pages?
It is horrible to read.
You probably want to use Boost.Beast instead of curl: [Only registered and activated users can see links. Click Here To Register...]
To solve your error you have to link curl .lib(s)