Nowe posty

Autor Wątek: Problem z dsniff 2.3  (Przeczytany 3233 razy)

arti040

  • Gość
Problem z dsniff 2.3
« dnia: 2005-06-26, 21:18:19 »
Witam,
czy ktos moglby mi wytlumaczyc krok po kroku jak przypisuje sie wartosci do zmiennej w ponizszym przkladzie? :

double y=9, a=2.8;
int i=4;

main()
{

y=(y=i=a++, ++i, y*=a+i-1)+i++;

cout << y endl << i endl;
}

jk33

  • Gość
Problem z dsniff 2.3
« Odpowiedź #1 dnia: 2005-06-26, 21:50:21 »
2005-06-26 21:18:19 arti040 napisał:

> Witam,
 > czy ktos moglby mi wytlumaczyc krok po kroku jak przypisuje sie wartosci do zmiennej w
 > ponizszym przkladzie? :
 >
 > double y=9, a=2.8;
 > int i=4;
 >
 > main()
 > {
 >
 > y=(y=i=a++, ++i, y*=a+i-1)+i++;
 >
 > cout << y endl << i endl;
 > }
 >

Program jest rzeczywiscie zagmatwany.

więc:
najpierw wykonywane jest y=i=a++
w takiej kolejnosci:
i=a; a jest 2,8 , ale poniewaz
i to int, czesc ulamkowa
jest ucieta -> i=2
pozniej
y=i,
na koncu a++,
czyli mamy juz i=2,y=2,a=3.8

dalej ++i,
czyli jest i=3,y=2,a=3.8

kolejno y*=a+i-1
czyli y = y * (a+i-1) = 2*(3.8+3-1) = 11.6

teraz wartosc ostatniego wyrazenia w nawiasie
podstawiana jest za caly nawias:
y = 11.6 + i++

mamy wiec:
y=11.6+3=14.6
i++ -> i=4
a=3.8

mam nadzieje, ze nie pomylilem sie nigdzie.

pozdrawiam

PS nigdy nie rob podobnych rzeczy we wlasnych
programach, bo potem nikt inny, a nawet
ty nie bedzie wiedzial co chciales
zrobic.

arti040

  • Gość
Problem z dsniff 2.3
« Odpowiedź #2 dnia: 2005-06-26, 22:01:11 »
> najpierw wykonywane jest y=i=a++
 > w takiej kolejnosci:
 > i=a; a jest 2,8 , ale poniewaz
 > i to int, czesc ulamkowa
 > jest ucieta -> i=2
 > pozniej
 > y=i,
 > na koncu a++,
 > czyli mamy juz i=2,y=2,a=3.8

A gdyby bylo  y=i=++a  to,
i=3, y=3, a=3.8 tak?

btw: to jedno zadan na egzaminie, ktory oblalem ;)
Na podstawie zrodla mialem wskazac wartosci poszczegolnych zmiennych. Dlatego teraz ucze sie jak sie je przyporzadkowywuje.

jk33

  • Gość
Problem z dsniff 2.3
« Odpowiedź #3 dnia: 2005-06-27, 12:34:36 »
2005-06-26 22:01:11 arti040 napisał:

 > y=i=++a
 > i=3, y=3, a=3.8 tak?
Tak, tak by bylo


chudy01

  • Gość
Problem z dsniff 2.3
« Odpowiedź #4 dnia: 2005-06-26, 21:09:32 »
Witam.

Jestem tu nowy, linuksa mam od okolo tygodnia (Mandriva LE 2005). Moj problem zrodzil sie podczas instalacji sniffera "dsniff" w wersji 2.3. Podczas robienia ./configure pojawia sie nastepujacy blad:

checking for Berkeley DB with 1.85 compatibility... configure: error: Berkeley DB with 1.85 compatibility not found

Hmm, jak mniemam chodzi tu o jakas kompatybilnosc bazy danych Berekeley.

Ze stronki http://www.sleepycat.com/ sciagnelem caly ten pakiet i zainstalowalem go wg ponizszej instrukcji:

To do a standard UNIX build of Berkeley DB, change to the build_unix directory and then enter the following two commands:


../dist/configure
make

This will build the Berkeley DB library.



To install the Berkeley DB library, enter the following command:


make install

Wszystko odbylo sie bez klopotow, pakiet skompilowal sie poprawnie tyle ze podczas ./configure dsniffa dalej pojawia sie ten sam problem dotyczacy tego pakiety (jego kompatybilnosci, a moze braku?)

Jezeli ktos bardziej zaawansowany wie co poradzic prosilbym o pomoc.

rosek

  • Gość
Problem z dsniff 2.3
« Odpowiedź #5 dnia: 2005-07-04, 11:09:59 »
spróbuj tak:
Berkeley DB

../dist/configure --enable-compat185
make
make install

a potem dsniff:
 
./configure --with-db=i tu katalog z Berkeleyem

zapewne /usr/local/Berkeley.4.3

chris3k

  • Gość
Problem z dsniff 2.3
« Odpowiedź #6 dnia: 2006-01-08, 16:12:46 »
ja rowniez mam problem z dsniffem 2.3, przy makeowaniu wywala mi taki blad =

gcc -g -O2 -D_BSD_SOURCE -D_BSD_SOURCE -D__BSD_SOURCE -D__FAVOR_BSD -DHAVE_NET_ETHERNET_H -DLIBNET_LIL_ENDIAN -DDSNIFF_LIBDIR="/usr/local/lib/" -I. -I/usr/local/include -I/usr/local/include  -I/usr/local/BerkeleyDB.4.4/include -I/usr/local/ssl/include  -I./missing -c ./sshcrypto.c
sshcrypto.c:25: error: field `key' has incomplete type
sshcrypto.c:30: error: syntax error before "des_key_schedule"
sshcrypto.c:30: warning: no semicolon at end of struct or union
sshcrypto.c:31: warning: data definition has no type or storage class
sshcrypto.c:32: error: syntax error before '}' token
sshcrypto.c: In function `blowfish_encrypt':
sshcrypto.c:131: error: `BF_ENCRYPT' undeclared (first use in this function)
sshcrypto.c:131: error: (Each undeclared identifier is reported only once
sshcrypto.c:131: error: for each function it appears in.)
sshcrypto.c: In function `blowfish_decrypt':
sshcrypto.c:143: error: `BF_DECRYPT' undeclared (first use in this function)
sshcrypto.c: In function `des3_init':
sshcrypto.c:153: error: dereferencing pointer to incomplete type
sshcrypto.c:156: error: dereferencing pointer to incomplete type
sshcrypto.c:157: error: dereferencing pointer to incomplete type
sshcrypto.c:160: error: dereferencing pointer to incomplete type
sshcrypto.c:162: error: dereferencing pointer to incomplete type
sshcrypto.c:164: error: dereferencing pointer to incomplete type
sshcrypto.c:164: error: dereferencing pointer to incomplete type
sshcrypto.c:164: error: dereferencing pointer to incomplete type
sshcrypto.c:164: error: dereferencing pointer to incomplete type
sshcrypto.c:165: error: dereferencing pointer to incomplete type
sshcrypto.c:165: error: dereferencing pointer to incomplete type
sshcrypto.c:165: error: dereferencing pointer to incomplete type
sshcrypto.c:165: error: dereferencing pointer to incomplete type
sshcrypto.c:166: error: dereferencing pointer to incomplete type
sshcrypto.c:166: error: dereferencing pointer to incomplete type
sshcrypto.c:166: error: dereferencing pointer to incomplete type
sshcrypto.c:166: error: dereferencing pointer to incomplete type
sshcrypto.c: In function `des3_encrypt':
sshcrypto.c:176: error: dereferencing pointer to incomplete type
sshcrypto.c:176: error: dereferencing pointer to incomplete type
sshcrypto.c:178: error: dereferencing pointer to incomplete type
sshcrypto.c:178: error: dereferencing pointer to incomplete type
sshcrypto.c:178: error: `DES_ENCRYPT' undeclared (first use in this function)
sshcrypto.c:179: error: dereferencing pointer to incomplete type
sshcrypto.c:179: error: dereferencing pointer to incomplete type
sshcrypto.c:179: error: `DES_DECRYPT' undeclared (first use in this function)
sshcrypto.c:180: error: dereferencing pointer to incomplete type
sshcrypto.c:180: error: dereferencing pointer to incomplete type
sshcrypto.c: In function `des3_decrypt':
sshcrypto.c:189: error: dereferencing pointer to incomplete type
sshcrypto.c:189: error: dereferencing pointer to incomplete type
sshcrypto.c:191: error: dereferencing pointer to incomplete type
sshcrypto.c:191: error: dereferencing pointer to incomplete type
sshcrypto.c:191: error: `DES_DECRYPT' undeclared (first use in this function)
sshcrypto.c:192: error: dereferencing pointer to incomplete type
sshcrypto.c:192: error: dereferencing pointer to incomplete type
sshcrypto.c:192: error: `DES_ENCRYPT' undeclared (first use in this function)
sshcrypto.c:193: error: dereferencing pointer to incomplete type
sshcrypto.c:193: error: dereferencing pointer to incomplete type
make: *** [sshcrypto.o] Error 1

cos z nie tak Berkeley'em ? czy moze z sshcrypto.c ?

chris3k

  • Gość
Problem z dsniff 2.3
« Odpowiedź #7 dnia: 2006-01-08, 17:17:18 »
ok juz sobie poradzilem, errorowalo pewnie dlatego ze mam Debiana. Uzylem do instalacji dsniffa:

apt-get install dsniff

+ oczywiscie wczesniej zainstalowalem:

Berkeley DB - http://www.sleepycat.com/
OpenSSL - http://www.openssl.org/
libpcap - http://www.tcpdump.org/
libnids - http://www.packetfactory.net/Projects/Libnids/
libnet - http://www.packetfactory.net/Projects/Libnet/

*** UWAGA! DSNIFF WYMAGA STAREJ WERSJI BIBLIOTEKI LIBNET. ***
Musisz uzyc wersji 1.0.x.

pozdrawiam

jezyk_pl

  • Gość
Problem z dsniff 2.3
« Odpowiedź #8 dnia: 2006-08-20, 22:52:34 »
2005-07-04 11:09:59 rosek napisał:

> spróbuj tak:
 > Berkeley DB
 >
 > ../dist/configure --enable-compat185
 > make
 > make install
 >
 > a potem dsniff:
 >  
 > ./configure --with-db=i tu katalog z Berkeleyem
 >
 > zapewne /usr/local/Berkeley.4.3


wszystko pieknie poszlo do tego momentu. tylko pojawil mi sie kolejny problem. mianowicie po wpisaniu make wywala mi to:

gcc  -o dsniff asn1.o base64.o buf.o hex.o magic.o mount.o pcaputil.o rpc.o tcp_raw.o trigger.o record.o dsniff.o decode.o decode_aim.o decode_citrix.o decode_cvs.o decode_ftp.o decode_hex.o decode_http.o decode_icq.o decode_imap.o decode_irc.o decode_ldap.o decode_mmxp.o decode_mountd.o decode_napster.o decode_nntp.o decode_oracle.o decode_ospf.o decode_pcanywhere.o decode_pop.o decode_portmap.o decode_postgresql.o decode_pptp.o decode_rip.o decode_rlogin.o decode_smb.o decode_smtp.o decode_sniffer.o decode_snmp.o decode_socks.o decode_tds.o decode_telnet.o decode_vrrp.o decode_yp.o decode_x11.o -lresolv -lnsl -lrpcsvc  -L. -lmissing -L/usr/local/lib -lnids -L/usr/local/lib -lpcap -lnet -L/usr/local/BerkeleyDB.4.2/lib -ldb -L/usr/local/ssl/lib -lssl -lcrypto
/usr/local/BerkeleyDB.4.2/lib/libdb.so: undefined reference to `pthread_condattr_setpshared'
/usr/local/BerkeleyDB.4.2/lib/libdb.so: undefined reference to `pthread_mutexattr_destroy'
/usr/local/BerkeleyDB.4.2/lib/libdb.so: undefined reference to `pthread_mutexattr_setpshared'
/usr/local/BerkeleyDB.4.2/lib/libdb.so: undefined reference to `pthread_mutexattr_init'
/usr/local/BerkeleyDB.4.2/lib/libdb.so: undefined reference to `pthread_mutex_trylock'
collect2: ld returned 1 exit status
make: *** [dsniff] Error 1

co jest nie tak ?? ktos moze pomoc ?

jezyk_pl

  • Gość
Problem z dsniff 2.3
« Odpowiedź #9 dnia: 2006-08-20, 22:56:46 »
aha. wszystkie biblioteki zainstalowalem poprawnie. pracuje na suse.