hlp plz hide url ???

how to hide my url in c++ after combile and don't show if edit happen.
closed account (zb0S216C)
What? You want to hide a URL in an executable? Why?

Wazzak
i want to know the code in c++ to hide my url and if any one want to make edit for it after executable don't show my url.
What do you mean your 'url'? What does a uniform resource locator have to do with your C++ application?
this is resource

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
void Fetcher::fetch()
{	
  	// declare variable
	eString url, code;
         code = mytext->getText();
	// assign to the variable the url we want to connect
	url = "http://www.host.com/activate.php?actvcode="+code;
	// assign to class variable the temporary file we will use to store the dowanloaded data
	tempPath = "/var/keys/file save";
	// inizialize the control error flag
	int error = 0;
	// start connection
	connectionP = eHTTPConnection::doRequest(url.c_str(), eApp, &error);
	//Show a Messagebox in case of connection error
	if(!connectionP || error)
	{	eMessageBox msg("Error Activation " + url + "(" + eString().sprintf("%d", error) + ")", _("Details"), eMessageBox::btOK);
		msg.show();     msg.exec();     msg.hide();
	}
	else
	{
		//if the connection is estabilished start the download funcions
		CONNECT(connectionP->transferDone, Fetcher::transferDone);
		CONNECT(connectionP->createDataSource, Fetcher::createDownloadSink);
		// set the user-agent name
		connectionP->local_header["User-Agent"] = "PLBOT";
		connectionP->start();
	}
}

void Fetcher::transferDone(int err)
{	
	// If no error we can call the downloadDone function
	if(!err)
	{	connectionP = NULL;
		// Tell caller download is ready
		/*emit*/ downloadDone(err);
	}
	else
	{
		//else show a Messagebox with Error description.
		eString sMsg = "Error " + eString().sprintf("%d", err);
		eMessageBox msg(sMsg, _("User Abort"), eMessageBox::iconWarning|eMessageBox::btOK);
		msg.show();     msg.exec();     msg.hide();
	}
}
// internal download procedure (standard)
eHTTPDataSource * Fetcher::createDownloadSink(eHTTPConnection *conn)
{	dataSinkP = new eHTTPDownload(connectionP, (char *)tempPath.c_str());

	return(dataSinkP);

}

void eBibleMainWindow::downloadDone(int err)
{
	// set the flag that indicates that download is complete
	if(!downloadDoneFlag)
	{	downloadDoneFlag = 1;
		// create a buffer to read the temp file with download data.
		char buf[512];
		// declare the variables we will use in this function
		eString strview, strview1;
		// open temporary file cotaining the downloaded data 
  		FILE *f = fopen("/var/tmp/bdemo.tmp", "w+");
   		if (f)
   		{
			//Add an introduction text
			strview = "";
			// find the line we want (The mkportal definition in the wiki page we downloaded)
			while (fgets(buf, 512, f))
     		{
				if (strstr(buf, ""))
				break;
			}
			// store this line in the variable
			strview1 = eString(buf);
			// remove html tags
			strview1 = removeTags(strview1);
			//  concate strings to compose our output text
			strview += strview1;
			// read the next lines .....
      		while (fgets(buf, 512, f))
      		{
			// if we found this string the defnition is ended so we can stop to read the file
				if (strstr(buf, ""))
				break;
			// else store the line in the variable
				strview1 = eString(buf);
			// remove html tags
				strview1 = removeTags(strview1);
			//  concate strings to compose our output text
				strview += strview1; 
      		}
			// close file
      		fclose(f);
   		}
		//Delete the temporary file we used to store downloaded data
   		::unlink("/var/tmp/bdemo.tmp");
		// Hide label to change the text
		label->hide();
		// Insert into the label the output we have stored in the variable strview
		label->setText(strview);
		// Show the label with the new text
		label->show();
		// hide the connection button
		ok->hide();
		// set the flag that indicates we are not in download state anymore
		inDownloadFlag = 0;

	}

}
And who are you tying to hide your URL from? People looking at the source code, at the executable file in a hex editor or what?

EDIT: The obvious solution would be to encrypt your URL.
Last edited on
thx Xander314

yes in hex editor the url is show after executable and i don't want it to show. how???
Ceasar Shifting the characters in the URL against the ASCII chart would be the easiest, you could use a Lagrange cipher but that would be over kill if you're just hiding it from a casual glance. The problem is that if the connections are enumerated then the site you're connecting to will still be visible on the host machine. You can get around that using a technique called ARP poisoning but that can be detectable on the host machine (in windows) with arp -a at the command line, unless you have access to the DNS that system runs through...

For anyone who hasn't caught on, this code could easily be modified to scan a site for SQL injection vulnerabilities. It can also be used as a downloader or any number of other things, and if run as a service would not require the users permission to install anything. All and all this is a very suspicious segment of code to be openly asking about.
i mean when i compile it , nobody can change the ip or url , when edited with hex editor
thats the problem

when i edit that file i can see the http://.......,/ i want to hide it
Last edited on
We've already told you how to "hide" the URL from people looking at it, encrypt your string. If you don't want them to decompile and edit the string you should have a sanity check in your code that auto quits the app if that string changes.
RE: sanity check, you could digitally sign the executable. If anyone modifies the exe, the signature is lost. Your exe can verify its own certificate.
@ OP: First let me say that webJose has the right idea, signing the entire executable is better then just checking the string. This will work to detect ANY modification as opposed to my origional suggestion of just the string.

Next I'd like to point out that what you are asking for is only about 80% possible. Could you tell us WHY we are hiding this URL? There might be a better solution.
thx all. some one i know't put code in source c++ and hide url if edit exe on hex the url not found is hide coz some people if found url on hex editor change some character in url and make url or host you have it that the problem....

url = ip or host
and same same source


if you know to encrypt url let me the method
Last edited on
any one hlp plz
any one to learn me to encrypt url or hide in c++
any one to learn me to encrypt url or hide in c++


Have you even read the posts people gave you?


In face the comments in your code display better structure and readability then you posts here, making me think that you didn't write the code. So how about you prove me wrong, and write something that doesn't look like the work of a ten year old with a learning disability.

EDIT: and if you don't speak English as a first language then use Google translate.
Last edited on
Topic archived. No new replies allowed.