|
Hi shalala,
I feel a little concerned that I somehow begun this thread of rather hard asnwers (though if I didn't, someone else would have.)
Please do not feel hurt by this. I seriously do not believe you had malitious intentions. You probably didn't thought about it and I felt it was sensible to warn you and others about the risks of this type of trojans.
Do not let this incident prevent you from continuing posting here. Just remember that executing binary code from anywhere except a well known site is dangerous and must only be done under extreme precautions. Many CP posters could execute this in their work computers, with horrible potential results. It could happen to you some day.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Yes, you are right, and I have an important lesson again.
My computer was once planted a trojan virus just because I excuted a executable file without any caution.
You are all very helpful!
Thank you!
|
|
|
|
|
Then perhaps you'd be willing to post a link to the movie, rather than instructions on how to create our own.
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
I think this is a problem that a CP would like.
So I post it here to discuss a way to solve my question.
I also want to code some code to do something like that
|
|
|
|
|
The maze is quite interesting, is it wolfenstein?. It is interesting to know of a way to transfer binary via debug.
cool.
But could be risky as well
Sonork 100.41263:Anthony_Yio
|
|
|
|
|
It is interesting, I tested on a test machine with network disconnected. Next time you want to post such thing, you need to explain what it does, if you can't, attach a warning message that this is an uncheck code. Such code does carry a lots of risks.
Good try anyway, thanks!
|
|
|
|
|
You can't be paranoid enough. I installed some free innocent looking animated icons on my Windows laptop. A month later, when I installed and activated Norton Internet Security, I was notified the free software was trying to send information back to its web site. I assume it was marketing spyware but it could have been even worse.
My question - How do you know your disconnected computer won't do something evil when it is reconnected to your network?
I recently diagnosed a customer computer that wasn't shuting Windows down gracefully. I used MSCONFIG.EXE in the Windows directory and looked at all the programs being loaded. The cheap Juno Internet service had marketing spyware installed telling them what topics were of interest to the customer. Consequently, when the customer went to a automobile quote site, he started getting automobile popup adds and automobile sales email.
Of course, such programs tie up ram memory and slow down the Windows startup.
The following site provides a list of all programs detected as running covertly during Windows startup. It also explains their removal techniques.
http://www.pacs-portal.co.uk/startup_content.htm#THE_PROGRAMS
|
|
|
|
|
Earl Allen wrote:
My question - How do you know your disconnected computer won't do something evil when it is reconnected to your network?
My answer
It never is. More accurately, I have a Ghost Image of a known clean configuration, which I restore to a drive, put stuff on for testing/checking, then restore again to wipe all traces of whatever it was.
After all, the last thing I need is any kind of virus/worm infection....
Steve S
|
|
|
|
|
Hi Everyone,
If anyone donot mind go to the MSWord Help and select office assistant,u will find office assistance image character
appear and then click and u will see form appear on the screen.(If do searching). I want like that form and button flushing in VC++.
Thanks
|
|
|
|
|
I am trying to use a struct as a parameter to a template. I am trying to use the struct as an abstract interface to a plugin architecture. The problem is that I can't seem to instantiate it correctly. Here is the code below. Any ideas what I am doing wrong. All the example for templates seems to exclusively use stack for there example.
// Here is how I am trying to instantiate it
CPlugin<I_Plugin>PLUGIN;
PLUGIN.Load("HTPCPlugin.dll", "GetPlugin"); // compiler pukes here
Compiling...
HTPCCOREDlg.cpp
d:\htpccore\htpccoredlg.cpp(117) : error C2143: syntax error : missing ';' before '.'
d:\htpccore\htpccoredlg.cpp(117) : error C2501: 'PLUGIN' : missing storage-class or type specifiers
d:\htpccore\htpccoredlg.cpp(117) : error C2371: 'PLUGIN' : redefinition; different basic types
d:\htpccore\htpccoredlg.cpp(115) : see declaration of 'PLUGIN'
d:\htpccore\htpccoredlg.cpp(117) : error C2143: syntax error : missing ';' before '.'
Error executing cl.exe.
Creating browse info file...
HTPCCORE.exe - 4 error(s), 0 warning(s)
// Below is the template and interface
struct I_Plugin
{
public:
virtual ~I_Plugin() { }
virtual void Initialize() = 0; // We'll use this to initialize the object
virtual void Destroy() = 0; // We'll use this to destroy the object
virtual void Config() = 0;
virtual void Release() = 0;
virtual void SendMessage( CString ModuleName , UINT Msg, WPARAM wParam, LPARAM lParam ) = 0;
};
template<typename T>
class CPlugin
{
public:
CPlugin():m_hLibrary(0), m_pPlugin(0){}
~CPlugin(){}
T* Load( const char* szDLLName, const char* szFunction )
{
LOADPLUGIN pfnLoad;
// Load our plugin
m_hLibrary = (HINSTANCE)::LoadLibrary( szDLLName );
// Handle errors
if( m_hLibrary == NULL )
return 0;
// Get Address of our plugin accessing function
pfnLoad = (LOADPLUGIN)::GetProcAddress( m_hLibrary, szFunction );
// Get our plugin
if( pfnLoad)
{
pfnLoad( &m_pPlugin );
}
return m_pPlugin;
}
void Release()
{
if( m_pPlugin == 0 )
return;
m_pPlugin->Release();
::FreeLibrary( m_hLibrary );
}
private:
T* m_pPlugin;
typedef void (*LOADPLUGIN)(T**);
HINSTANCE m_hLibrary;
};
|
|
|
|
|
Hi smesser,
Brackets do not show properly in your post. Please use the "Do not treat <'s as HTML tags" checkbox below the editbox. Also, what is the error messahe the compiler is emitting?
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Sorry about that. I did as you sugguested and I also added the compilers errors.
Thanks
Steve
PS: Oh your the guy who answered my questions about FFT.
|
|
|
|
|
In which context are you issuing the PLUGIN.Load() call? Inside a function or outside?
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
At the moment I was using it outside all functions (globally) just to see if I could get it to complile.
|
|
|
|
|
Then don't You cannot write code outside a function just like that. It is like if you dropped a printf("hello") outside a function, you get this is not legal, right? Put your code inside some function and things will probably work (or at least your error chasing will move one step further.)
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Your my hero.
Thanks, you are always so helpful.
Steve
|
|
|
|
|
You can have the plugin loaded without any "inside" code if you define the ctor as
CPlugin(const char* szDLLName, const char* szFunction){} and provide some GetPlugin accesor for later use. IMHO this is probably better than the Load scheme, since the only purpose of CPlugin is to make the loading anyway. Following this approach, you might want to move the unloading code to the dtor of the class and supress the explicit loading functions altogether. This fits nicely with a C++ idiom called RAII (Resource Acquisition is Initialization), which you can google for for further info.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Thanks for the sugguestion. I will look into it.
Steve
|
|
|
|
|
Ok, I just put:
PLUGIN.Load("HTPCPlugin.dll", "GetPlugin");
inside of a function and it compiled beautifully.
I am new to templates so what is going on here?
Steve
|
|
|
|
|
There is surely something I do not understand here. I would very much appreciate if someone could explain to me how I screwed this up.
Thank you.
--------------------Configuration: TCPIPwatch - Win32 Debug--------------------
Compiling...
TCPIPwatchDlg.cpp
C:\DOCUMENTS AND SETTINGS\ADMIN\DESKTOP\SSPROJECT\TCPIPwatch\TCPIPwatchDlg.cpp(235) : error C2664: 'bind' : cannot convert parameter 2 from 'struct CTCPIPwatchDlg::TCPIPWConnectSock::SOCKADDR_IN *' to 'const struct sockaddr *'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
Error executing cl.exe.
TCPIPwatch.exe - 1 error(s), 0 warning(s)
void CTCPIPwatchDlg::TCPIPWConnectSock(SOCKADDR_IN *dest, SOCKET &theTrgSock)
{
dest->sin_family = AF_INET;
dest->sin_port = 80;
if(dest->sin_port == INVALID_SOCKET)
AfxMessageBox("Port is invalid.",MB_OK);
theTrgSock = socket(AF_INET, SOCK_RAW, IPPROTO_IP);
const char RCVTIMEO[50] = "5000";
setsockopt(theTrgSock, SOL_SOCKET, SO_RCVTIMEO, (RCVTIMEO), 4);
bind(theTrgSock, (struct SOCKADDR_IN*) dest, sizeof(dest));
}
|
|
|
|
|
Hi,
typecast with (const ::SOCKADDR*) to 2nd parameter for function bind().
Cheers
The chosen One
|
|
|
|
|
Well, I am comming along more and more with this program, but I could still obviously use some help. I am going to put the specifications in full out here.
Define a class for triagnles. A triangle is defined by three sides. Class should have following capabilities:
A constructor that will allow definining a triangle. (float side1, float side2, float side3). The constructor is to call Order to place the sides in order from smallest to largest.
A constructo with no arguments: initialize the three sides to zero.
Public member functions needed.
void SetTriangle(float side1, float side2, float side3);
bool IsEquilateral();
bool IsIsosceles();
bool IsScalene();
bool IsRight();
bool IsAcute();
bool IsObtuse();
friend Triangle Copy(Triangle triangle1);
friend bool operator ==(const Triangle& triangle1, const Triangle& triangle2);
friend ostream& operator <<(ostream& outs, Triangle& the_triangle);
Private member functions needed.
void Order;
void Swap;
I need to write a program that will define triangle1, triangle2, triangle3, triangle4
am to define a class for triangles, and once I have defined it I need to do tese procedurse:
The constructor (with sides) is to call order to order the sides from smallest to largest.
and
The SetTriangle function is to call order to order the sides from smallest to largest
and then display the sides and the type it is... scalene and right, isosceles and acute, ....
I think I may need to give more detail. Triangle1 will not have any values defined. Triangle2 has sides 6.0, 6.0, 6.0. Triangle3: 5.0, 4.0, 3.0. Triangle4: 6.0, 4.0, 4.0
And then for Triangles 2, 4, and 4... I
1) Use friend operator function << to display the three sides of each
2) Test to see if the triangle is Equilateral, Isosceles, or Scalene. When one of the functions returns true, display message. Message should not be displayed within function.
3) Test to see if Right, Acute, Obtuse
For the copy test
1) Use the friend copy function to copy triangle 4 to triangle 1
2) Use friend operator function << to display the three sides of triangle 4 and triangle 1.
3)Use friend operator function == to see if triangle 1 is equal to triangle 4. If the two are, display " are equal", otherwise " are not equal.
For another == test, do the following
1)Use friend operator function << to display three sides of triangle2 and triangle3.
2)Use friend operator function ++ to see if triangle2 is equal to triangle3 and display appropriate message
For the SetTriangle test, do the following:
1)set Triangle3's sides to (5, 4, 3 (in that order))
2)use friend operator function << to disply the three sides of triangle3.
There are all the specifications and what not. It has been like a week... and I have only gotten as far as this Could I please get some help all around on this one. I would so much appreciate it. Please, could I get some help. I have done this much on my own, and now I have just gotten stuck and don't really have a clue as what to do.
My code is
#include <iostream.h><br />
#include <stdlib.h><br />
<br />
class Triangle<br />
{<br />
public:<br />
friend Triangle Copy(Triangle triangle1);<br />
friend bool operator ==(const Triangle& triangle1, const Triangle& triangle2);<br />
friend ostream& operator <<(ostream& outs, Triangle& the_triangle);<br />
<br />
Triangle(float side1, float side2, float side3);<br />
Triangle();<br />
<br />
void SetTriangle(float side1, float side2, float side3);<br />
<br />
bool IsEquilateral();<br />
bool IsIsosceles();<br />
bool IsObtuse();<br />
<br />
float get_side1();<br />
float get_side2();<br />
float get_side3();<br />
<br />
private:<br />
void order(float side_1, float side_2, float side_3);<br />
void swap(float side_1, float side_2);<br />
<br />
float side_1, side_2, side_3;<br />
};<br />
<br />
void main()<br />
{<br />
Triangle triangle1, triangle2(5.0, 4.0, 3.0), triangle3(6.0, 4.0, 4.0);<br />
cout << "Display triangle 1:\n";<br />
cout << "Side 1 = " << triangle1.get_side1() << endl;<br />
cout << "Side 2 = " << triangle1.get_side2() << endl;<br />
cout << "Side 3 = " << triangle1.get_side3() << endl;<br />
<br />
cout << "Display triangle 2:\n";<br />
cout << "Side 1 = " << triangle2.get_side1() << endl;<br />
cout << "Side 2 = " << triangle2.get_side2() << endl;<br />
cout << "Side 3 = " << triangle2.get_side3() << endl;<br />
<br />
cout << "Display triangle 3:\n";<br />
cout << "Side 1 = " << triangle3.get_side1() << endl;<br />
cout << "Side 2 = " << triangle3.get_side2() << endl;<br />
cout << "Side 3 = " << triangle3.get_side3() << endl;<br />
<br />
}<br />
<br />
<br />
Triangle Copy(Triangle triangle1)<br />
{<br />
Triangle copy;<br />
<br />
copy.order = triangle1;<br />
return copy;<br />
}<br />
Triangle::Triangle(float side1, float side2, float side3)<br />
{<br />
side_1 = side1;<br />
side_2 = side2;<br />
side_3 = side3;<br />
} <br />
<br />
void swap(float side_1, float side_2)<br />
{<br />
float temp;<br />
temp = side_1;<br />
side_1 = side_2;<br />
side_2 = temp;<br />
}<br />
<br />
void order(float side_1, float side_2, float side_3)<br />
{<br />
if (side_1 > side_2)<br />
swap (side_1, side_2);<br />
if (side_1 > side_3)<br />
swap (side_1, side_3);<br />
if (side_2 > side_3)<br />
swap (side_2, side_3);<br />
}<br />
<br />
<br />
<br />
Triangle::Triangle() : side_1(0), side_2(0), side_3(0)<br />
{<br />
}<br />
float Triangle::get_side1()<br />
{<br />
return side_1;<br />
}<br />
float Triangle::get_side2()<br />
{<br />
return side_2;<br />
}<br />
float Triangle::get_side3()<br />
{<br />
return side_3;<br />
}
|
|
|
|
|
OK, let me see, if i understood you correctly.
You want to use an overloaded operator << . But what you have done, is only using the normal output of an float.
The overloading would look like this:
ostream& operator<< (ostream& ostr, CTriangle& triangle)
{
ostr << "Side1 = " << triangle.side1 << endl
<< "Side2 = " << triangle.side2 << endl
<< "Side3 = " << triangle.side3 << endl;
return ostr;
}
The overloaded operator== looks like this:
bool operator ==(const CTriangle& tri1, const CTriangle& tri2)
{
if (tri1.side1 == tri2.side1
&& tri1.side2 == tri2.side2
&& tri1.side3 == tri2.side3)
return true;
else
return false;
}
My personal advice:
You should divide your program into three files.
-----------------------
First file -
a file containing the declaration of the triangle class. Name this file triangle.h
!! Remember that triangle is a class, so name the class CTriangle. !!
-----------------------
Second file -
Name this file triangle.cpp
include your triangle.h by using
#include "triangle.h"
Now put all the definitions of your CTriangle class in here (for instance yout get-functions etc. and the overloaded operators). Don't forget neccessary inclusions like iostream.h
-----------------------
Third file -
name this file main.cpp
include your triangle.h by using
#include "triangle.h"
#include <iostream.h>
void main()
{
CTriangle triangle1, triangle2(5.0, 4.0, 3.0), triangle3(6.0, 4.0, 4.0);
cout << "Display triangle 1:\n";
cout << triangle1 ;
cout << "Display triangle 2:\n";
cout << triangle2 ;
cout << "Display triangle 3:\n";
cout << triangle3;
if (triangle2 == triangle3)
cout << "identical" << endl;
else
cout << "not identical" << endl;
<
}
I havent compiled it, but this should work. Test it by changing the values of the triangle2 and triangle3.
Hope this helps
sledge
|
|
|
|
|
ÓÃÖÐÎĶàºÃ£¬Ó¢ÎÄ¿´²»¶®£¡;P
|
|
|
|
|
Yeah....that's probably not going to compile.
When I can talk about 64 bit processors and attract girls with my computer not my car, I'll come out of the closet. Until that time...I'm like "What's the ENTER key?"
-Hockey on being a geek
|
|
|
|
|