|
Parturiunt montes, nascetur ridiculus mus.
|
|
|
|
|
Hello everybody.
I`m working on a project about Man In The Middle Attack by ARP poisoning method.
In this project I need to work like as a router. For example suppose In My Lan there is two other device (a modem & a laptop). I says to laptop that I`m the modem to fraud it. whenever the laptop wants to send a packet to outside of the LAN, sends the packet to me! All thing I need is I want to send the received packet to the modem & sends the response to victim laptop.
How can I do it programmatically?
Thanks a lot. Ya Ali.
|
|
|
|
|
I don't think anyone here is going to help you to create a program that can be used for illegal purposes.
|
|
|
|
|
There is already at least a program that does this rather good. It's called "Ettercap". No need to reinvent the wheel.
-- Gisle V.
|
|
|
|
|
I made two program , client and server.
The client program send a big data to the server using "send" windows API. I used a thread to send the data. in this case , my server took 5 minutes to receive 500Mb data. I want to reduce the time it takes.there any way to do that ?
tú xương
|
|
|
|
|
Without knowing anything about your programs, your computers or your network it is impossible to make a useful suggestion.
|
|
|
|
|
Exactly. On our internal network that is wired with terribly expensive switches it was possible to reach constant 100MByte/sec with good hardware and windows but some things had to be tweaked for that. The SO_SNDBUF and SO_RCVBUF socket options are definitely among these tweakable things, I used 1-2 megabytes if I remember right.
|
|
|
|
|
I think you should tell the OP about that.
|
|
|
|
|
Come on Richard, we all know moving them closer together makes it faster!
"The whole idea that carbon dioxide is the main cause of the recent global warming is based on a guess that was proved false by empirical evidence during the 1990s." climate-models-go-cold
|
|
|
|
|
You first have to test how your average speed (about 13 Mbit/s) compares with the speed of your network and then (if it is the case) investigate to find out the bottleneck. You should probably first check your own code, I strongly doubt the (possible) bottleneck is caused by the send call.
Veni, vidi, vici.
|
|
|
|
|
Get a faster network card....
"The whole idea that carbon dioxide is the main cause of the recent global warming is based on a guess that was proved false by empirical evidence during the 1990s." climate-models-go-cold
|
|
|
|
|
If your connection is faster, then yes.
In general, to achieve maximum performance, you will need a high performance protocol and I am not sure the Send API you are referring to falls into that category.
Typical characteristics for high performance protocols are:
* UDP based
* Packet loss tolerant
* Latency tolerant
You may have to write your own protocol, or Google for "high performance open source UDP file transfer" and you may find something.
Regards
|
|
|
|
|
I am preparing for my exams and i just found this question from previous question papers:
Give the C Expression for the following algebric expression :
1. ab^4c^2-d/m-n
2. ab-[{(e+f)^9}/c}]
Please help me as i am preparing for my exams and haven't read this topic yet.
help plz
|
|
|
|
|
himanshuchawla4393 wrote: and haven't read this topic yet. Then I suggest you read it; it will not help you if you just copy the answers from other people without understanding what it means. You can find all the information you need at http://msdn.microsoft.com/en-us/library/fw5abdx6.aspx[^].
|
|
|
|
|
Hi,
I am new to MFC. Can anybody tell me how to check the CDateTimeCtrl is dirty or not
Thanks in advance
|
|
|
|
|
Depends what you mean by "dirty".
|
|
|
|
|
Call its GetTime() method to get the currently selected date/time from the control. Then use COleDateTime::GetStatus() to check the validity.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|
|
|
I find a error in the thread code: i call stop to screen saver in the other thread, more slow, than the thread where check if is all in stop; so the first don't know that if is all stopped; now it works - i'm sorry.
At the moment remains the problem regarding the hook: if i have the focus in my application, it works, but if i open the notepad and change focus, this hook don't works. Feel like the hook is "attacked" only on my application: It's due to the fact that the winthread object is called inside my application ? I have to change hook code ?
Thank you
Drugo
|
|
|
|
|
Today i'm find the correct way to work; i don't know why, but i'm fixed on the way to count time for starts screen saver inside my application, so i need hooks; i try to use hooks (i need global hook) and it works, but i think it's better in another way: the correct way is leave the screen saver administration to the system and enable it or disable it when occurs; the correct way is:
- Read if the screen saver is enabled from the system (so i know if i have to use it)
- If disabled i do nothing
- If enabled, disable it
- Run all on my application
- If device is sleeping for 1 minute, enable screen saver and reset counting
- If device is current in use, disable screen saver and reset counting
The rest it' better leave to the system: in this way i have only a delay of one minute for screen saver starting.
Now it works fine; i'm sorry for these post.
Thank you
Drugo
|
|
|
|
|
In an application i wrote years ago, i need to have a handle to printer propertiers device mode structure; i searched documents and i finded this function (DocumentProperties()); i searched example, i tried to use it, i writed code and the application works yet.
Now i have to write similar application and i note when i call this function, it cause a first-chance exception (only when i call it to know the size of buffer); so i try with the old application and also that cause the exception; i try to solve it, but the the example i find and the documentation i have tell me that the use of the function i make it's correct; the funny fact is this method works very well in release mode and with the old application the customer don't have problems.
The code is this:
BOOL PrinterSettings(LPTSTR pszPrinterName, BOOL bSet)
{
if (_tcslen(pszPrinterName) <= 0)
return FALSE;
if (bSet && theApp.m_hBarcodePrinterDev == NULL)
return FALSE;
PRINTER_DEFAULTS pd;
DWORD dwNeeded;
LONG lFlag;
HANDLE hPrinter = NULL;
DEVMODE FAR* pDevMode = NULL;
PRINTER_INFO_2* pPrintInfo2 = NULL;
BOOL bReturn = TRUE;
ZeroMemory(&pd, sizeof(pd));
pd.DesiredAccess = PRINTER_ALL_ACCESS;
bReturn = OpenPrinter(pszPrinterName, &hPrinter, &pd);
if (bReturn)
{
SetLastError(0);
bReturn = GetPrinter(hPrinter, 2, 0, 0, &dwNeeded);
if (!bReturn && (GetLastError() == ERROR_INSUFFICIENT_BUFFER) && dwNeeded > 0)
bReturn = TRUE;
}
if (bReturn && (dwNeeded <= 0))
bReturn = FALSE;
if (bReturn)
pPrintInfo2 = (PRINTER_INFO_2 *) GlobalAlloc (GPTR, dwNeeded);
if (bReturn && pPrintInfo2 == NULL)
bReturn = FALSE;
if (bReturn)
bReturn = GetPrinter(hPrinter, 2, (LPBYTE) pPrintInfo2, dwNeeded, &dwNeeded);
if (bReturn && pPrintInfo2->pDevMode == NULL)
{
dwNeeded = DocumentProperties(NULL, hPrinter, pszPrinterName, NULL, NULL, 0);
if (dwNeeded <= 0)
bReturn = FALSE;
if (bReturn)
pDevMode = (DEVMODE FAR*) GlobalAlloc(GHND, dwNeeded);
if (bReturn && pDevMode == NULL)
bReturn = FALSE;
if (bReturn)
{
lFlag = DocumentProperties(NULL, hPrinter, pszPrinterName, pDevMode, NULL,DM_OUT_BUFFER);
if (lFlag != IDOK || pDevMode == NULL)
bReturn = FALSE;
}
if (bReturn)
pPrintInfo2->pDevMode = pDevMode;
}
if (bReturn && pPrintInfo2->pDevMode == NULL)
bReturn = FALSE;
if (bReturn && bSet)
{
pPrintInfo2->pDevMode = (DEVMODE FAR*)::GlobalLock(theApp.m_hBarcodePrinterDev);
DWORD dwAttrib = pPrintInfo2->Attributes;
dwAttrib &= ~(PRINTER_ATTRIBUTE_WORK_OFFLINE);
pPrintInfo2->Attributes = dwAttrib;
lFlag = DocumentProperties(NULL, hPrinter, pszPrinterName, pPrintInfo2->pDevMode,
pPrintInfo2->pDevMode, DM_IN_BUFFER | DM_OUT_BUFFER);
if (lFlag != IDOK)
bReturn = FALSE;
if (bReturn)
bReturn = SetPrinter(hPrinter, 2, (LPBYTE) pPrintInfo2, 0);
GlobalUnlock(theApp.m_hBarcodePrinterDev);
}
if (bReturn && !bSet)
{
GlobalFree(theApp.m_hBarcodePrinterDev);
dwNeeded = DocumentProperties(NULL, hPrinter, pszPrinterName, NULL, NULL, 0);
if (dwNeeded <= 0)
bReturn = FALSE;
if (bReturn)
theApp.m_hBarcodePrinterDev = ::GlobalAlloc(GPTR, dwNeeded);
if (bReturn && theApp.m_hBarcodePrinterDev == NULL)
bReturn = FALSE;
if (bReturn)
{
lFlag = DocumentProperties(NULL, hPrinter, pszPrinterName,
(DEVMODE FAR*) theApp.m_hBarcodePrinterDev, NULL, DM_OUT_BUFFER);
if (lFlag != IDOK || theApp.m_hBarcodePrinterDev == NULL)
bReturn = FALSE;
}
if (bReturn && theApp.m_hBarcodePrinterDev == NULL)
bReturn = FALSE;
}
if (pPrintInfo2)
GlobalFree(pPrintInfo2);
if (pDevMode)
GlobalFree(pDevMode);
if (hPrinter)
ClosePrinter(hPrinter);
return bReturn;
};
Something can help me ?
Thanks
Drugo
|
|
|
|
|
What is the exception and where does it occur?
|
|
|
|
|
Whene the execution arrives in one of two lines i signed, compiler write:
First-chance exception in MyApp.exe (KERNEL32.DLL): 0xE06D7363: Microsoft C++ Exception.
First-chance exception in MyApp.exe (KERNEL32.DLL): 0xE06D7363: Microsoft C++ Exception.
but the function works normally.
Thanks
Drugo
|
|
|
|
|
These are not compiler messages, they look more like the messages you see in the debug log and can be ignored. Unless you get an exception inside your program, which causes the application to fail, you do not need to take any action.
|
|
|
|
|
... and what do you think could to be due this message ?
Thanks
Drugo
|
|
|
|