Sunday, April 24, 2011

Error when apply C code to your C++ code

If you get the error message when compiling your C code by C++ compiler.

error: invalid conversion from 'const void*' to 'const unsigned char*'

const void *data;
const unsigned char *sp = data;

Please modify to
const unsigned char *sp = static_cast< const unsigned char* >(data);

Or,
void *resbuf;
uint8_t *hval = resbuf;

Please modify to
uint8_t *hval = static_cast< uint8_t * >(resbuf);

Then you gen pass compiler.

Refer from following,
http://discussion.forum.nokia.com/forum/showthread.php?152300-Open-C-syntax-problem-for-invalid-conversion
http://www.velocityreviews.com/forums/t456262-cannot-convert-const-void-to-const-char-in-c.html

Wednesday, March 2, 2011

NPF設定為自動開啟

http://ask.wireshark.org/questions/1281/npf-driver-problem-in-windows-7

應該是我換了新版的Wireshark和Wincap後,npf被設定成了demand start,
參考上面連結,很清楚的可以設定為auto-start。


Run a cmd.exe as administrator and run the command sc qc npf.

You should get some output like this:

C:\Windows\system32>sc qc npf
[SC] QueryServiceConfig SUCCESS

SERVICE_NAME: npf
        TYPE               : 1  KERNEL_DRIVER
        START_TYPE         : 2   AUTO_START
        ERROR_CONTROL      : 1   NORMAL
        BINARY_PATH_NAME   : system32\drivers\npf.sys
        LOAD_ORDER_GROUP   :
        TAG                : 0
        DISPLAY_NAME       : NetGroup Packet Filter Driver
        DEPENDENCIES       :
        SERVICE_START_NAME :
If your driver is not properly started, activate it with the command sc start npf

Finally, to start the service automatically, use the command sc config npf start=auto

Remember to run your cmd.exe as administrator when issuing these command.

Clicky

Clicky Web Analytics