|
You have several options and that depends on what you want to do.
If your objective is to hide some sensitive data than encrypt those into your exe, and decrypt at runtime.
If hiding the code from crackers eyes is what you are trying to achieve, try one of the different packers that are available (or write your own but requires some time. google for writing packer reverse)
SMC exe can achieve what you need to do, but that requires writing some assembly code (make sure the section in your exe your modifiying is linked with RW attributes)
So practically without knowing what you need, its kind of hard to tell you what to do.
An average cracker may only stop if he becomes bored to death
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
See if this article gets you started.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
i want to develop a port scan detector...
can any1 help me on this...
how to do it???
|
|
|
|
|
We wont develop your program for you. I suppose you could monitor the ports for connections, but then when you put nMap portscanner into the picture it might get a little harder. nMap doesnt actually try to connect to the port to see if its open. I think it uses arp requests or something, its been awhile since i used/read about it. So that will require some more programming.
|
|
|
|
|
I didn't think that nMap detected port scanning, rather it used various port scanning techniques to Map the network!?
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fruity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Williams (Little Britain)
|
|
|
|
|
I never said nMap detected portscanning. I meant that trying to detect nMap portscans would be hard.
|
|
|
|
|
Sorry, I misunderstood your post. You are quite right. nMap uses various port scanning techniques most of which would need so sort of packet analysis (pattern matching) in order to detect them.
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fruity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Williams (Little Britain)
|
|
|
|
|
A suppose a solution would be to either write an NDIS driver of your own or use WinPCap[^].
You could then analyse the incoming packets for patterns that would suggest a port scan is happening.
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fruity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Williams (Little Britain)
|
|
|
|
|
I read this about using a wrapper for Non-Static Callbacks within a class. (http://www.codeproject.com/cpp/SetTimer__non-static.asp) Its brilliant. I can't believe I never thought of it. Anyway, would it be possible to use a Non-Static callback with threads? I want to run another thread within my class using CreateThread, but I want the thread to be able to access the members of my class. Is it possible?
|
|
|
|
|
I believe you can use a similiar approach such as:
Let's say Class A is the class that you want to access from within the thread. Then you can do something like:
in A::something() : (if you're using VC++)
AfxBeginThread(fnThread, this);
in fnThread(LPVOID param) :
A* pObj = static_cast<A*>(param);
then you can access A's methods like:
pObj->aMethod();
of course, provided you have the required access level for it.
|
|
|
|
|
Right now I decided to use the multimedia timers to call my drawing routine, and the callback doesnt support and void user-defined params. So I figured out all I really need to do is name a pointer of type of my class static and put it in the class declaration like so:
static CScroller * ClassPtr;
So now my static wrapper callback can access it and use it to call the non-static member function that does all the drawing work. What a nice little hack. I love it. Anyway as I was reading that article i mentioned earlier from the code project, I noticed how just having "static CScroller * ClassPtr;" in my class declaration would cause an undefined external object linking error. The article mentioned putting "CScroller * CScroller::ClassPtr;" in my class implementaion. That fixed the error. What I want to know is how does doing that fix it and why does it get that linking error if I don't put it?
|
|
|
|
|
Hi
All static members of a class must be defined somewhere. This is necessary since unlike normal member variables, which are created when a class is instantiated, static member variables exist even when there is no instance of the class. For example, if you have something like:
in A.h:
class A
{
static int _anInt;
};
the you define it as (in A.cpp):
int A::_anInt;
The definition is usually put on top of your class implementation file, and it is also useful for setting a default value for your static member (i.e. if you want to override the default 0 value), e.g:
in A.cpp:
int A::_anInt(10) //set _anInt to 10
|
|
|
|
|
Hi All,
I am having issues using GetBandInfo from a rebar control. I am attempting to get the rebar band info for each of the bands in a webbrowser2 control.
Here is what I have
<br />
for ( UINT nBand = 0; nBand < m_Rebar->GetReBarCtrl().GetBandCount(); nBand++ )<br />
{<br />
REBARBANDINFO rbbi;<br />
rbbi.cbSize = sizeof( rbbi );<br />
rbbi.fMask = RBBIM_STYLE | RBBIM_CHILD;<br />
m_Rebar->GetReBarCtrl().GetBandInfo(nBand, &rbbi);<br />
}<br />
GetBandInfo() is returning a 0 value which means it is failing for some reason but I am cant seem to determine why.
|
|
|
|
|
Note that this will hide each of the bands.
for ( UINT nBand = 0; nBand < m_Rebar->GetReBarCtrl().GetBandCount(); nBand++ )<br />
{<br />
...<br />
m_Rebar->GetReBarCtrl().ShowBand(nBand, false);<br />
...<br />
}
|
|
|
|
|
Hi all,
Just new to the forum and was hoping that you may be able to help me out.
I am looking at running two or more BDA Filter graphs within the same process using two or more DTV cards. I have been able to operate two cards within the same process but have got a problem where the TIF is always updating from the NP causing a memory usage creep. I say this since the creep does not occur if the channels are the same on both cards.
Has anyone seen or know of a similar situation with the BDA structure?
Thanks,
Dan.
|
|
|
|
|
so i've done it again and taken a stupid little idea that i technically completed within an hour of work, and i'm turning it into a massive behemoth of unnecessary features. i wrote a tiny program to take all the images in a directory, do something to them (one at a time in order), and save them in a different directory. it works great. but after building a plugin architecture and threaded render engine, i've come to desire disk buffering. it probably wont improve performance but its what i want. what im thinking is, 1 thread for read, 1 thread for render, and 1 thread for writing. the read thread will have a counter semaphore that will signal the render thread when x number of images have been placed on the stack (doubly linked list) at which time the render thread will start pluggin away at the BOTTOM of the image stack (fifo). as soon as x frames are rendered, the write thread will also begin writing files to disk and plucking them off the stack. does this sound like a good method for implementing this? this was just kind of my first thought on the subject, and i thought someone might be able to give a better architecture and save me some headache and time. thanks!
|
|
|
|
|
I wanted to generate custom error msg at compile/link phase.
GCC provdes __attribute__ to generate compiletime error. e.g if you declare a function as
void get() __attribute((deprecated));
and if you access this function, it will generate warning message that this function is deprecated.
How do I generate custom msg insted of depprecated?????
How can we do in VC++?
|
|
|
|
|
|
Your subject and message ask for three different things: An error, a warning, and a custom message.
As mentioned, #pragma message can generate custom messages, but #pragma error generates custom errors.
A kludgy thing to do is to #define the method name into a #pragma error that halts compilation. I think I have seen that done before... Something like:
#define YourDepedFunc( P1, P2 ) #pragma error This is deprecated
Peace!
-=- James
Tip for inexperienced drivers: "Professional Driver on Closed Course" does not mean "your Dumb Ass on a Public Road"! Articles -- Products: Delete FXP Files & Check Favorites
|
|
|
|
|
I have to write a very small app in VC++ for my small shop. They want it written in VC++, otherwise I'd do this in Java or C#.
Anyway, at one point, they want to record which NT USER performed a transaction.
They specifically said:
"We want whatever Windows XP recognizes the current user as. So, whoever is logged into Windows, user their ID."
How do I do this? In really easy in Java and C#, but I don't know offhand how to do it in VC++.
Info:
Windows XP Pro
(Some MIGHT have Win2000, but 99% have XP)
I did this once in VB (might have hit a .dll to get the info) and it still works under XP. But the code is gone, so I don't know which DLL.
Thanks,
Chris
|
|
|
|
|
Might GetUserName be what you're after?
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Is there any way to boot up a computer automatically at a specific time from a program,
ie run the program, call a function (???) and then switch off the computer, and then the computer would start up automatically at the specified time.
If not then is there some way of bringing the computer out of hibernation in a similar way???
Thanks
|
|
|
|
|
I'm not sure what you mean, but if you mean to restart a computer at specified time it is possible of course. Below you have a function for rebooting the computer. It works with all Windows versions. Call it with the in parameter EWX_REBOOT and the system will be rebooted:
BOOL WindowsExitOrReboot(UINT flags)<br />
{<br />
if (IsWindowsNT()) {
HANDLE hToken; <br />
TOKEN_PRIVILEGES tkp; <br />
<br />
SetLastError(ERROR_SUCCESS);<br />
if (!OpenProcessToken(GetCurrentProcess(), TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, &hToken)) <br />
return FALSE;<br />
<br />
LookupPrivilegeValue(NULL, SE_SHUTDOWN_NAME, &tkp.Privileges[0].Luid); <br />
tkp.PrivilegeCount = 1;
tkp.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED; <br />
<br />
AdjustTokenPrivileges(hToken, FALSE, &tkp, 0, (PTOKEN_PRIVILEGES)NULL, 0); <br />
if (GetLastError() != ERROR_SUCCESS) return FALSE;<br />
<br />
if (!ExitWindowsEx(flags | EWX_FORCE, 0)) return FALSE;<br />
return TRUE;<br />
}<br />
else {
if (!ExitWindowsEx(flags, 0)) return FALSE;<br />
return TRUE;<br />
}<br />
}
But if you mean to shut down the computer for a time and then let it start automatically I don't think it is possible. Not without some hardware.
|
|
|
|
|
I actually meant is there any way to turn the computer on automatically at a specific time, when it has been turned off manually. For example could I program the computer to boot up at 8 o'clock every morning?
If not, is there any way to bring the computer out of standby mode in the same way, ie bring the computer out of standby at 8 o'clock every morning.
Thanks
|
|
|
|
|
Hain i think you are seaching for wake on Lan feature type application.
i am able to boot computer through network at giving time.
bascially it functioning is like this->
You send a packet containg the subnet mask of you network to that particular computer which is in off state this feature only feasible for ATX cabinet computer & lan card with wake on lan feature
Happy programming
-----------------------------
"I Think It will Work"
Formerly Known As "Alok The Programmer" at CP
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|