diff --git a/dissasembleRalinkInit/ralink_init.IMPORTANT b/dissasembleRalinkInit/ralink_init.IMPORTANT new file mode 100755 index 0000000..d49e6c0 Binary files /dev/null and b/dissasembleRalinkInit/ralink_init.IMPORTANT differ diff --git a/dissasembleRalinkInit/ralink_init.id0 b/dissasembleRalinkInit/ralink_init.id0 new file mode 100644 index 0000000..ac3153a Binary files /dev/null and b/dissasembleRalinkInit/ralink_init.id0 differ diff --git a/dissasembleRalinkInit/ralink_init.id1 b/dissasembleRalinkInit/ralink_init.id1 new file mode 100644 index 0000000..e69de29 diff --git a/dissasembleRalinkInit/ralink_init.nam b/dissasembleRalinkInit/ralink_init.nam new file mode 100644 index 0000000..e69de29 diff --git a/readme.md b/readme.md index ba559fe..7a82b0f 100644 --- a/readme.md +++ b/readme.md @@ -196,7 +196,433 @@ een van de eerste scripts of executables was een binary file(dcp) waar ik een gr de tweede file die mij interesseerde was een file genaamt mydlink-watch-dog.sh -hierin vond ik enkele dingen uit: het systeem gebruikt een apache webserver en +hierin vond ik enkele dingen uit: het systeem gebruikt een apache webserver en de file van daarnet geeft meerdere functies aan andere programmas, bv in mywatchdog worden deze soort van commands gebruikt: + + + +mdb get dev_model + +wat waarschijnlijk betekend dat het programma mdb een get functie heeft, en dev_model geeft de modelnaam van het systeem terug + +tdb geeft ook enkele get mogelijkheden + +ik denk dat dit betekend dat als ik vulnerabilities vind in dit systeem dat ze ook een kans hebben om te werken op andere dlink camera's aangezien ze checken welke camera je hebt in het script dat waarschijnlijk voor iedereen runned + +dan vond ik de main run methode van de watch dog: + +`` +while [ 1 ] +do + curpid=`cat ${WATCHDOG_PID}` + if [ "0$$" -ne "0$curpid" ]; then + log "Unexpected pid (self: $$ cur: $curpid), exit!" + exit 255 + fi + + if [ "0$has_ca_refresh" = "01" ]; then + # check CA list + need_to_check $MYDLINK_BASE + if [ $? -eq 0 ]; then + refresh_ca $MYDLINK_BASE + fi + fi + + # check running status of mydlink agents + check_alive dcp "-i $LAN_INT -m $MODEL_NAME" + check_alive signalc + + # check if device in privacy mode + if [ "1" -eq "$HAS_MDB" ]; then + PRIVACY_MODE=`$DEV_CMD $GET_PRIV_CMD` + # check format + if [ $? -ne 0 ] || [ "1" -ne "$PRIVACY_MODE" ]; then + PRIVACY_MODE=0 + fi + fi + + # if device in privacy mode, we are not going to check httpd service + if [ "0" -eq "$PRIVACY_MODE" ]; then + # check web services + runs=`expr $runs + $UNIT_CHECK_T` + if [ $runs -ge $HTTP_CHECK_T ]; then + http_port=`$DEV_CMD $PORT_CMD` + https_port=`$DEV_CMD $SPORT_CMD` + + if [ "0$STREAM_CGI" = "0" ]; then + STREAM_CGI=`detect_stream_cgi $http_port` + fi + + health_check_httpd "$http_port" "$https_port" "$STREAM_CGI" + runs=0 + fi + fi + + sleep $UNIT_CHECK_T +done +ยด + + +daarna ben ik gegaan naar de etc map, en jammer genoeg is hier enkel een fstab aanwezig om te tonen hoe de fs gemount moet worden. +maar er is ook een etc_ro folder en daarin zitten meerderen interessante dingen. zoals gensslkey.sh etc, mijn goal was om een config van de httpd server te vinden + +er is een file met de naam build aanwezig wat wss de versie van de firmware is? het bevat gewoon een nummer, mss een build nummer maar ik dacht dat deze specifiek waren voor elk geproduceerd item. mss wordt deze file overschreven wanneer de os runned + +de volgende file is het gensslkey.sh script wat met gebruik van openssl een paar ssl keys aanmaakt + +dan zijn er nog 2 icons aanwezig + +volgende file is inittab +dit houd gewoon enkele locaties bij? + +::sysinit:/etc_ro/rcS +#ttyS1::respawn:/bin/sh +ttyS1::respawn:/bin/login + +ik zal deze files onthouden voor laten maar als ik bv de 2e lijn uncomment en de laatste comment dan denk ik dat als de os opstart dat hij direct opstart in de shell + +volgende file is lld2d.conf, en dit blijkt te maken hebben met het link layer topology discovery protocol. ingebouwde network discovery. het verwijst naar de twee afbeeldingen en de interface waar het zich op zal promoten wss + +volgende file is de message of the day, deze is redelijk tof + +Welcome to + _______ _______ ___ __ ____ _ _ ___ + | ___ \| __ || | |__|| \ | || | / / + | |___| || |__| || |__ __ | \| || |/ / + | _ /| _ || || || |\ || \ + |__| \__\|__| |__||______||__||_| \____||_|\___\ + + =System Architecture Department= + + +mss in mijn bootsequence steken voor mezelf + +dan is er een openssl config file (openssl.cnf) + +momenteel niet het meest interessante dat er is maar kan later handig lijken + +volgende file is rcS en dit is een shell script? er stond posix in het begin bij mijn file command + +dit kan de boot sequence zijn van de os? + +het start de nvram_daemon op en enabled de usb hot-plug feature en dan wacht hij tot de nvram_daemon opgestart is + +dan start hij een script op dat internet.sh noet, wat eigenlijk wel interessant is. +oh en der zijn comments van de devs in deze file wat geweldig is: + + + +internet.sh + +#for telnet debugging +#security issue - don't run telnetd here -- andy 2012-07-03 +#telnetd + + +en dan zet het de log op, deze zou wel tof zijn om eens te displayen + + +release was de laatste file en houd gewoon een nummer van de laatste release firmware datum + +volgende folder + + +linuxigd +dit bevat een gif bestand en een config + +gif afbeelding is gewoon van een kleine pc + +en dan is er een config file die upnpd.conf noemt +dit is dus voor een universal plug and play systeem dat op deze server runned. + +volgende map + +ppp +verwachtelijk point to point protocol +bevat 3 folders +3g: wat blanco is +peers: wat ook blanco is +en plugins: wat ook blanco is :( + + +de usb folder is ook leeg + +nu de web folder, dit is de folder waar ik het meeste hoop voor heb +hier zijn een pak afbeeldingen te vinden, deze komen waarschijnlijk op de webpagina later + +dan zijn er ook enkele mappen aanwezig + +api +hier zijn enkele jar files aanwezig + + +ik heb deze gedissasembled en euh. kmoe dr nog naar kijken +gebruik gemaakt van java xf en jad en de andere heb ik geextract met gcab + + +dit was dus de api map + +de volgende map is de cgi map, en deze bevat een gans pak scripts + +audiocfg.cgi is een config voor de audio +cgiversion.cgi is letterlijk een file die de cgiversion toont +common.cgi houd een groot stuk commen data bij door bepaalde functies te callen (model brand version build name etc) +datetime.cgi houd data bij over de datetime +daynight.cgi een script dat de dag nacht scheduled zodat de ir sensor aan kan op de juiste momenten +dbglevel.cgi houd bij welk debug level de os heeft, mss een tof idee om dit hoger te zetten en dan te repacken en zien wat dit geeft als firmware voor de camera +email.Cgi een scehduler voor de email service, houd username en password bij, dit lijkt niet super veilig, maar sure +iactiveuser.cgi toont de eerste user van de active user table +iaudio.cgi houd een pak vars bij van of de audio enabled is het volume codec en sample rate +iimage.cgi houd info over de video bij (resolutie framrate etc) +image.cgi houd dezelfde info bij van iimage.cgi denk ik? nvm klein beetje meer info zoals antiflicker +inetwork.cgi houd ip adress bij, en andere shit, zoals de bonjour service wat ik denk dat een apple service is +isysdevice.cgi meer info over het apparaat +isystem.cgi andere info over het apparaat +iwireless info over het wireless interface van het apparaat +motion.cgi settings voor de motion sensor +networkcgi info over network settings +sdbdetectoin.cgi sound detection settings +sitesurvey.cgi runned sitesurveylist(); +strminfo.cgi wss streaminfo settings +upgradestatus toont laatste download status +upload.cgi heeft een pak ftp info, mss is er dus ook een ftp server op dit apparaat +user.cgi enabled acces control mss? no idea tbh +userlist.cgi geeft de list van users weer +usermod.cgi geeft opties om een user aan te passen? wacht mss zijn deze allemaal om settings aan te passen, in welk geval nu kan je dus hiermee de group en naam en pass van de user aanpassen +wireless.cgi set de keys enzo voor wireless connectivity + + + +dus nu we dit gezien hebben willen we wss die commands runnen om dan onze eigen user toe te voegen + + + +de volgende folder die we gaan bekijken is pack +deze bevat een pak lzma bestanden, die we dus elk gaan uitpakken +na de eerste uit te pakken kan ik zien dat dit een html bestand moet voorstellen + +deze heb ik dan allemaal uitgepakt want fuck it, en dus gaan we ze nu een voor een afgaan +(file zegt dat ze allemaal data zijn dus fuck me) + +het zijn allemaal html files + + +web bleek niet zo nuttig te zijn als ik hoopte + +dan hebben we in de map wireless een config file staan in de onderliggende map rt28.... +deze heeft een login en passwoord staan + +dit blijkt de ssid te zijn vaan een router genaamd: +https://wikidevi.com/wiki/Belkin_F5D8233-4_v1 + + + +in de map wlan vinden wen een binary met de naam RT5350_AP_1T1R_V1_0.bin + +dit is de naam van een wifi module dus wss de wireless driver van dit apparaat + +de laatste map xml is blanco + + + +nu als we terug kijken was er een interessante file +bin/login + +dus mijn volgende doelwit is de bin folder +hier zijn een doenbaar aantal scripts aanwezig dus ik kan ze allemaal eigenlijk wel bekijken, laten we dus starten bij a en we komen login wel tegen wanneer we et tegen komen + + + +alphapd: ELF 32-bit LSB executable, MIPS, MIPS-II version 1 (SYSV), dynamically linked, interpreter /lib/ld-uClibc.so.0, stripped +ash: symbolic link to busybox +ated: ELF 32-bit LSB executable, MIPS, MIPS-II version 1 (SYSV), dynamically linked, interpreter /lib/ld-uClibc.so.0, stripped +audiopush: ELF 32-bit LSB executable, MIPS, MIPS-II version 1 (SYSV), dynamically linked, interpreter /lib/ld-uClibc.so.0, stripped +busybox: ELF 32-bit LSB executable, MIPS, MIPS-II version 1 (SYSV), dynamically linked, interpreter /lib/ld-uClibc.so.0, stripped +cat: symbolic link to busybox +chmod: symbolic link to busybox +cp: symbolic link to busybox +date: symbolic link to busybox +echo: symbolic link to busybox +gpio: ELF 32-bit LSB executable, MIPS, MIPS-II version 1 (SYSV), dynamically linked, interpreter /lib/ld-uClibc.so.0, stripped +grep: symbolic link to busybox +htmlunpack: ELF 32-bit LSB executable, MIPS, MIPS-II version 1 (SYSV), dynamically linked, interpreter /lib/ld-uClibc.so.0, stripped +i2c: ELF 32-bit LSB executable, MIPS, MIPS-II version 1 (SYSV), dynamically linked, interpreter /lib/ld-uClibc.so.0, stripped +imagetp: ELF 32-bit LSB executable, MIPS, MIPS-II version 1 (SYSV), dynamically linked, interpreter /lib/ld-uClibc.so.0, stripped +inadyn: ELF 32-bit LSB executable, MIPS, MIPS-II version 1 (SYSV), dynamically linked, interpreter /lib/ld-uClibc.so.0, stripped +iperf: ELF 32-bit LSB executable, MIPS, MIPS-II version 1 (SYSV), dynamically linked, interpreter /lib/ld-uClibc.so.0, stripped +ipush: ELF 32-bit LSB executable, MIPS, MIPS-II version 1 (SYSV), dynamically linked, interpreter /lib/ld-uClibc.so.0, stripped +iwpriv: ELF 32-bit LSB executable, MIPS, MIPS-II version 1 (SYSV), dynamically linked, interpreter /lib/ld-uClibc.so.0, stripped +kill: symbolic link to busybox +lanconfig: ELF 32-bit LSB executable, MIPS, MIPS-II version 1 (SYSV), dynamically linked, interpreter /lib/ld-uClibc.so.0, stripped +lld2d: ELF 32-bit LSB executable, MIPS, MIPS32 version 1 (SYSV), dynamically linked, interpreter /lib/ld-uClibc.so.0, stripped +login: symbolic link to busybox +ls: symbolic link to busybox +mail: ELF 32-bit LSB executable, MIPS, MIPS-II version 1 (SYSV), dynamically linked, interpreter /lib/ld-uClibc.so.0, stripped +mdb: ELF 32-bit LSB executable, MIPS, MIPS-II version 1 (SYSV), dynamically linked, interpreter /lib/ld-uClibc.so.0, stripped +mii_mgr: ELF 32-bit LSB executable, MIPS, MIPS-II version 1 (SYSV), dynamically linked, interpreter /lib/ld-uClibc.so.0, stripped +mkdir: symbolic link to busybox +mknod: symbolic link to busybox +mount: symbolic link to busybox +msmtp: ELF 32-bit LSB executable, MIPS, MIPS-II version 1 (SYSV), dynamically linked, interpreter /lib/ld-uClibc.so.0, stripped +mtd_write: ELF 32-bit LSB executable, MIPS, MIPS-II version 1 (SYSV), dynamically linked, interpreter /lib/ld-uClibc.so.0, stripped +mydlinkevent: ELF 32-bit LSB executable, MIPS, MIPS-II version 1 (SYSV), dynamically linked, interpreter /lib/ld-uClibc.so.0, stripped +netstat: symbolic link to busybox +notifystream: ELF 32-bit LSB executable, MIPS, MIPS-II version 1 (SYSV), dynamically linked, interpreter /lib/ld-uClibc.so.0, stripped +ntpclient: ELF 32-bit LSB executable, MIPS, MIPS-II version 1 (SYSV), dynamically linked, interpreter /lib/ld-uClibc.so.0, stripped +nvram_daemon: ELF 32-bit LSB executable, MIPS, MIPS-II version 1 (SYSV), dynamically linked, interpreter /lib/ld-uClibc.so.0, stripped +nvram_get: symbolic link to ralink_init +nvram_set: symbolic link to ralink_init +openssl: ELF 32-bit LSB executable, MIPS, MIPS-II version 1 (SYSV), dynamically linked, interpreter /lib/ld-uClibc.so.0, stripped +ov7740: ELF 32-bit LSB executable, MIPS, MIPS-II version 1 (SYSV), dynamically linked, interpreter /lib/ld-uClibc.so.0, stripped +pcmcmd: ELF 32-bit LSB executable, MIPS, MIPS-II version 1 (SYSV), dynamically linked, interpreter /lib/ld-uClibc.so.0, stripped +ping: symbolic link to busybox +pppoecd: ELF 32-bit LSB executable, MIPS, MIPS-II version 1 (SYSV), dynamically linked, interpreter /lib/ld-uClibc.so.0, stripped +ps: symbolic link to busybox +pwd: symbolic link to busybox +ralink_init: ELF 32-bit LSB executable, MIPS, MIPS-II version 1 (SYSV), dynamically linked, interpreter /lib/ld-uClibc.so.0, stripped +reg: ELF 32-bit LSB executable, MIPS, MIPS-II version 1 (SYSV), dynamically linked, interpreter /lib/ld-uClibc.so.0, stripped +rm: symbolic link to busybox +schedule: ELF 32-bit LSB executable, MIPS, MIPS-II version 1 (SYSV), dynamically linked, interpreter /lib/ld-uClibc.so.0, stripped +sed: symbolic link to busybox +sh: symbolic link to busybox +sleep: symbolic link to busybox +sounddb: ELF 32-bit LSB executable, MIPS, MIPS-II version 1 (SYSV), dynamically linked, interpreter /lib/ld-uClibc.so.0, stripped +switch: ELF 32-bit LSB executable, MIPS, MIPS-II version 1 (SYSV), dynamically linked, interpreter /lib/ld-uClibc.so.0, stripped +sync: symbolic link to busybox +touch: symbolic link to busybox +umount: symbolic link to busybox +upgradefw: ELF 32-bit LSB executable, MIPS, MIPS-II version 1 (SYSV), dynamically linked, interpreter /lib/ld-uClibc.so.0, stripped +uvc_stream: ELF 32-bit LSB executable, MIPS, MIPS-II version 1 (SYSV), dynamically linked, interpreter /lib/ld-uClibc.so.0, stripped +alphapd: ELF 32-bit LSB executable, MIPS, MIPS-II version 1 (SYSV), dynamically linked, interpreter /lib/ld-uClibc.so.0, stripped +ash: symbolic link to busybox +ated: ELF 32-bit LSB executable, MIPS, MIPS-II version 1 (SYSV), dynamically linked, interpreter /lib/ld-uClibc.so.0, stripped +audiopush: ELF 32-bit LSB executable, MIPS, MIPS-II version 1 (SYSV), dynamically linked, interpreter /lib/ld-uClibc.so.0, stripped +busybox: ELF 32-bit LSB executable, MIPS, MIPS-II version 1 (SYSV), dynamically linked, interpreter /lib/ld-uClibc.so.0, stripped +cat: symbolic link to busybox +chmod: symbolic link to busybox +cp: symbolic link to busybox +date: symbolic link to busybox +echo: symbolic link to busybox +gpio: ELF 32-bit LSB executable, MIPS, MIPS-II version 1 (SYSV), dynamically linked, interpreter /lib/ld-uClibc.so.0, stripped +grep: symbolic link to busybox +htmlunpack: ELF 32-bit LSB executable, MIPS, MIPS-II version 1 (SYSV), dynamically linked, interpreter /lib/ld-uClibc.so.0, stripped +i2c: ELF 32-bit LSB executable, MIPS, MIPS-II version 1 (SYSV), dynamically linked, interpreter /lib/ld-uClibc.so.0, stripped +imagetp: ELF 32-bit LSB executable, MIPS, MIPS-II version 1 (SYSV), dynamically linked, interpreter /lib/ld-uClibc.so.0, stripped +inadyn: ELF 32-bit LSB executable, MIPS, MIPS-II version 1 (SYSV), dynamically linked, interpreter /lib/ld-uClibc.so.0, stripped +iperf: ELF 32-bit LSB executable, MIPS, MIPS-II version 1 (SYSV), dynamically linked, interpreter /lib/ld-uClibc.so.0, stripped +ipush: ELF 32-bit LSB executable, MIPS, MIPS-II version 1 (SYSV), dynamically linked, interpreter /lib/ld-uClibc.so.0, stripped +iwpriv: ELF 32-bit LSB executable, MIPS, MIPS-II version 1 (SYSV), dynamically linked, interpreter /lib/ld-uClibc.so.0, stripped +kill: symbolic link to busybox +lanconfig: ELF 32-bit LSB executable, MIPS, MIPS-II version 1 (SYSV), dynamically linked, interpreter /lib/ld-uClibc.so.0, stripped +lld2d: ELF 32-bit LSB executable, MIPS, MIPS32 version 1 (SYSV), dynamically linked, interpreter /lib/ld-uClibc.so.0, stripped +login: symbolic link to busybox +ls: symbolic link to busybox +mail: ELF 32-bit LSB executable, MIPS, MIPS-II version 1 (SYSV), dynamically linked, interpreter /lib/ld-uClibc.so.0, stripped +mdb: ELF 32-bit LSB executable, MIPS, MIPS-II version 1 (SYSV), dynamically linked, interpreter /lib/ld-uClibc.so.0, stripped +mii_mgr: ELF 32-bit LSB executable, MIPS, MIPS-II version 1 (SYSV), dynamically linked, interpreter /lib/ld-uClibc.so.0, stripped +mkdir: symbolic link to busybox +mknod: symbolic link to busybox +mount: symbolic link to busybox +msmtp: ELF 32-bit LSB executable, MIPS, MIPS-II version 1 (SYSV), dynamically linked, interpreter /lib/ld-uClibc.so.0, stripped +mtd_write: ELF 32-bit LSB executable, MIPS, MIPS-II version 1 (SYSV), dynamically linked, interpreter /lib/ld-uClibc.so.0, stripped +mydlinkevent: ELF 32-bit LSB executable, MIPS, MIPS-II version 1 (SYSV), dynamically linked, interpreter /lib/ld-uClibc.so.0, stripped +netstat: symbolic link to busybox +notifystream: ELF 32-bit LSB executable, MIPS, MIPS-II version 1 (SYSV), dynamically linked, interpreter /lib/ld-uClibc.so.0, stripped +ntpclient: ELF 32-bit LSB executable, MIPS, MIPS-II version 1 (SYSV), dynamically linked, interpreter /lib/ld-uClibc.so.0, stripped +nvram_daemon: ELF 32-bit LSB executable, MIPS, MIPS-II version 1 (SYSV), dynamically linked, interpreter /lib/ld-uClibc.so.0, stripped +nvram_get: symbolic link to ralink_init +nvram_set: symbolic link to ralink_init +openssl: ELF 32-bit LSB executable, MIPS, MIPS-II version 1 (SYSV), dynamically linked, interpreter /lib/ld-uClibc.so.0, stripped +ov7740: ELF 32-bit LSB executable, MIPS, MIPS-II version 1 (SYSV), dynamically linked, interpreter /lib/ld-uClibc.so.0, stripped +pcmcmd: ELF 32-bit LSB executable, MIPS, MIPS-II version 1 (SYSV), dynamically linked, interpreter /lib/ld-uClibc.so.0, stripped +ping: symbolic link to busybox +pppoecd: ELF 32-bit LSB executable, MIPS, MIPS-II version 1 (SYSV), dynamically linked, interpreter /lib/ld-uClibc.so.0, stripped +ps: symbolic link to busybox +pwd: symbolic link to busybox +ralink_init: ELF 32-bit LSB executable, MIPS, MIPS-II version 1 (SYSV), dynamically linked, interpreter /lib/ld-uClibc.so.0, stripped +reg: ELF 32-bit LSB executable, MIPS, MIPS-II version 1 (SYSV), dynamically linked, interpreter /lib/ld-uClibc.so.0, stripped +rm: symbolic link to busybox +schedule: ELF 32-bit LSB executable, MIPS, MIPS-II version 1 (SYSV), dynamically linked, interpreter /lib/ld-uClibc.so.0, stripped +sed: symbolic link to busybox +sh: symbolic link to busybox +sleep: symbolic link to busybox +sounddb: ELF 32-bit LSB executable, MIPS, MIPS-II version 1 (SYSV), dynamically linked, interpreter /lib/ld-uClibc.so.0, stripped +switch: ELF 32-bit LSB executable, MIPS, MIPS-II version 1 (SYSV), dynamically linked, interpreter /lib/ld-uClibc.so.0, stripped +sync: symbolic link to busybox +touch: symbolic link to busybox +umount: symbolic link to busybox +upgradefw: ELF 32-bit LSB executable, MIPS, MIPS-II version 1 (SYSV), dynamically linked, interpreter /lib/ld-uClibc.so.0, stripped +uvc_stream: ELF 32-bit LSB executable, MIPS, MIPS-II version 1 (SYSV), dynamically linked, interpreter /lib/ld-uClibc.so.0, stripped + + + +so bin wasn't that usefull, however +there's also an fs/sbin location, and this one seems more usefull +i copied it to further inspect it, and i've removed de busy box links from it so i only have the selfmade scripts +all of them are executable by anyone + + +so, what do they do, lets start off with predictions because this might take time + +acodec "codec stuff" +automount_boot mounts stuff that needs to be mounted, might hold some info thats worth it +automount same shit i think +cameraname doesn't seem super important, just getrs the name of the camera module +chpasswd this one will be amazingly good if we can find a way to execute it, probably changes the password of user x +config-dns just what it says on the tin +config-igmpproxy.sh something to do with proxy's have to search what igmp means +config.sh this could be anything, def worth checking +config-udhcpd dhcp settings +cpubusy no idea cpu management? +ddns dns settings +dhcp dhcp settings +focus no idea +internet no idea, presumably to do with the webserver +lan lan settings +ntp ntp settings +pppoe plug and play stuff? +snort i don't know but i recognize this name +ucp no idea +udev no idea +udhcpc dhcp stuff +video script to start the video feed maybe +vpn-passthru vpn stuff +web something about the websrever +wlan wireless stuff +zcip no idea + + + +so, lets look at the important ones + +automounts: + +mounts media en dev with the parameter it's given? it's weird + +chpasswd.sh: + +gets the username and password from nvram, which is wild, and then if no user is set exists, if it is, it changes the password using chpasswd which i don't get wtf it's doing, but steven wrote it in 2015 + +it like writes the password to temporary storage and then issues the chpasswd command with those username and password and then it removes the temporary storage written stuff + + +config for now isn't as usefull as i thought + + +cpubusy copy's shit into a file and echo's some shit and does it again, forever, it seems to overload the cpu? or like try to run out all other services by keeping that stuff up + + +next up was the script internet.sh +and this one gave me an insane idea, so, nvram gets the username right? so there has to be some place that sets it, and i looked for some stuff, and there's a file in bin that uses it, i searched for it using the command: + +grep -rnw '.' -e 'nvram_set' + +so this file has to be usefull since it has this set in it, i'm copying it to the main dir to check + + + + + + diff --git a/verb/binary/attemp2/fs/cpio/etc_ro/web/api/aplug/META-INF/MANIFEST.MF b/verb/binary/attemp2/fs/cpio/etc_ro/web/api/aplug/META-INF/MANIFEST.MF new file mode 100644 index 0000000..b8b1b90 --- /dev/null +++ b/verb/binary/attemp2/fs/cpio/etc_ro/web/api/aplug/META-INF/MANIFEST.MF @@ -0,0 +1,29 @@ +Manifest-Version: 1.0 +Application-Name: aplug +Permissions: all-permissions +Created-By: 1.5.0_22 (Sun Microsystems Inc.) +Caller-Allowable-Codebase: * +Main-Class: aplug +Codebase: * + +Name: aplug$Talkie.class +SHA1-Digest: 2aVNEt1UmXZxsGDqKuMWyMSdJNo= + +Name: aplug$TS.class +SHA1-Digest: bcCulMO2JAF/cEyPAaq+MlpJFNY= + +Name: aplug.class +SHA1-Digest: Xq72uaqog4K4CxU+aaRTHI6lnbI= + +Name: aplug$ACS_Control.class +SHA1-Digest: dlTPvwzdBrmN8uHUeUeyV2wKXG0= + +Name: aplug$SI.class +SHA1-Digest: Cf2RT0iFdv2VDDI+DznPMBWi63w= + +Name: aplug$ACS_Audio.class +SHA1-Digest: 0MVKIbdmw41F2CP3X8wlN1o3H0g= + +Name: aplug$AU.class +SHA1-Digest: 6BD9xeWhsDRn6sJ4roR85fvIW3c= + diff --git a/verb/binary/attemp2/fs/cpio/etc_ro/web/api/aplug/META-INF/WWW_DLIN.RSA b/verb/binary/attemp2/fs/cpio/etc_ro/web/api/aplug/META-INF/WWW_DLIN.RSA new file mode 100644 index 0000000..12e9e75 Binary files /dev/null and b/verb/binary/attemp2/fs/cpio/etc_ro/web/api/aplug/META-INF/WWW_DLIN.RSA differ diff --git a/verb/binary/attemp2/fs/cpio/etc_ro/web/api/aplug/META-INF/WWW_DLIN.SF b/verb/binary/attemp2/fs/cpio/etc_ro/web/api/aplug/META-INF/WWW_DLIN.SF new file mode 100644 index 0000000..ba463e6 --- /dev/null +++ b/verb/binary/attemp2/fs/cpio/etc_ro/web/api/aplug/META-INF/WWW_DLIN.SF @@ -0,0 +1,26 @@ +Signature-Version: 1.0 +SHA1-Digest-Manifest-Main-Attributes: UBp7e9hhiW9jTs0aB5k+hWchTpw= +Created-By: 1.6.0_45 (Sun Microsystems Inc.) +SHA1-Digest-Manifest: 1oXVrSmx4HV21apD+8+2AR+RNNI= + +Name: aplug$Talkie.class +SHA1-Digest: EP5wpvCzDUkUzp+/p3+ukV+t+/M= + +Name: aplug$TS.class +SHA1-Digest: KOmQFfuWyt6wZAkJN2gZuXsjQYA= + +Name: aplug.class +SHA1-Digest: 6zuZlxCL+jRUigu/O+yhygmQEMM= + +Name: aplug$ACS_Control.class +SHA1-Digest: G3Cxz5qKFceS3FaAhkrlV+AV3dc= + +Name: aplug$SI.class +SHA1-Digest: 6UqL3yyydR4/ynbgZGVoq2I01fk= + +Name: aplug$ACS_Audio.class +SHA1-Digest: i1cFnbJWe0uE5vHT4vrjCPvYLJ0= + +Name: aplug$AU.class +SHA1-Digest: wYFYPf9xYN37zWkEJ/+DHdoILRo= + diff --git a/verb/binary/attemp2/fs/cpio/etc_ro/web/api/aplug/aplug$ACS_Audio.class b/verb/binary/attemp2/fs/cpio/etc_ro/web/api/aplug/aplug$ACS_Audio.class new file mode 100644 index 0000000..0807447 Binary files /dev/null and b/verb/binary/attemp2/fs/cpio/etc_ro/web/api/aplug/aplug$ACS_Audio.class differ diff --git a/verb/binary/attemp2/fs/cpio/etc_ro/web/api/aplug/aplug$ACS_Control.class b/verb/binary/attemp2/fs/cpio/etc_ro/web/api/aplug/aplug$ACS_Control.class new file mode 100644 index 0000000..6df2312 Binary files /dev/null and b/verb/binary/attemp2/fs/cpio/etc_ro/web/api/aplug/aplug$ACS_Control.class differ diff --git a/verb/binary/attemp2/fs/cpio/etc_ro/web/api/aplug/aplug$AU.class b/verb/binary/attemp2/fs/cpio/etc_ro/web/api/aplug/aplug$AU.class new file mode 100644 index 0000000..7abb6f8 Binary files /dev/null and b/verb/binary/attemp2/fs/cpio/etc_ro/web/api/aplug/aplug$AU.class differ diff --git a/verb/binary/attemp2/fs/cpio/etc_ro/web/api/aplug/aplug$SI.class b/verb/binary/attemp2/fs/cpio/etc_ro/web/api/aplug/aplug$SI.class new file mode 100644 index 0000000..a13d0d6 Binary files /dev/null and b/verb/binary/attemp2/fs/cpio/etc_ro/web/api/aplug/aplug$SI.class differ diff --git a/verb/binary/attemp2/fs/cpio/etc_ro/web/api/aplug/aplug$TS.class b/verb/binary/attemp2/fs/cpio/etc_ro/web/api/aplug/aplug$TS.class new file mode 100644 index 0000000..9856259 Binary files /dev/null and b/verb/binary/attemp2/fs/cpio/etc_ro/web/api/aplug/aplug$TS.class differ diff --git a/verb/binary/attemp2/fs/cpio/etc_ro/web/api/aplug/aplug$Talkie.class b/verb/binary/attemp2/fs/cpio/etc_ro/web/api/aplug/aplug$Talkie.class new file mode 100644 index 0000000..9004ff2 Binary files /dev/null and b/verb/binary/attemp2/fs/cpio/etc_ro/web/api/aplug/aplug$Talkie.class differ diff --git a/verb/binary/attemp2/fs/cpio/etc_ro/web/api/aplug/aplug.class b/verb/binary/attemp2/fs/cpio/etc_ro/web/api/aplug/aplug.class new file mode 100644 index 0000000..ad79477 Binary files /dev/null and b/verb/binary/attemp2/fs/cpio/etc_ro/web/api/aplug/aplug.class differ diff --git a/verb/binary/attemp2/fs/cpio/etc_ro/web/api/aplug/aplug.jad b/verb/binary/attemp2/fs/cpio/etc_ro/web/api/aplug/aplug.jad new file mode 100644 index 0000000..75c18d2 --- /dev/null +++ b/verb/binary/attemp2/fs/cpio/etc_ro/web/api/aplug/aplug.jad @@ -0,0 +1,2409 @@ +// Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. +// Jad home page: http://www.geocities.com/kpdus/jad.html +// Decompiler options: packimports(3) +// Source File Name: aplug.java + +import java.applet.Applet; +import java.awt.*; +import java.awt.event.MouseEvent; +import java.awt.event.MouseListener; +import java.awt.image.MemoryImageSource; +import java.awt.image.PixelGrabber; +import java.io.*; +import java.net.Socket; +import java.net.URL; +import java.nio.ByteBuffer; +import java.nio.ByteOrder; +import java.security.MessageDigest; +import java.util.Date; +import java.util.Random; +import javax.sound.sampled.*; + +public class aplug extends Applet + implements Runnable, MouseListener +{ + class ACS_Audio + { + + void prepare_audio_header(int i) + { + Date date = new Date(); + long l = date.getTime(); + SequenceNumber++; + DataLength = i; + TimeSec = (int)(l / 1000L); + TimeUSec = (int)((l % 1000L) * 1000L); + rec.putInt(0, HdrID); + rec.putInt(4, HdrLength); + rec.putInt(8, DataLength); + rec.putInt(12, SequenceNumber); + rec.putInt(16, TimeSec); + rec.putInt(20, TimeUSec); + rec.putInt(24, DataCheckSum); + rec.putShort(28, Format); + rec.putShort(30, Channels); + rec.putShort(32, SampleRate); + rec.putShort(34, SampleBits); + rec.putInt(36, Reserved); + } + + int HdrID; + int HdrLength; + int DataLength; + int SequenceNumber; + int TimeSec; + int TimeUSec; + int DataCheckSum; + short Format; + short Channels; + short SampleRate; + short SampleBits; + int Reserved; + byte buf[]; + ByteBuffer rec; + final aplug this$0; + + ACS_Audio() + { + this$0 = aplug.this; + super(); + HdrID = 0xf6010000; + HdrLength = 40; + DataLength = 1024; + SequenceNumber = 0; + TimeSec = 0; + TimeUSec = 0; + DataCheckSum = 0; + Format = 16; + Channels = 1; + SampleRate = -21436; + SampleBits = 16; + Reserved = 0; + buf = new byte[1064]; + rec = ByteBuffer.wrap(buf).order(ByteOrder.LITTLE_ENDIAN); + } + } + + class ACS_Control + { + + void prepare_control_header(int i) + { + Date date = new Date(); + long l = date.getTime(); + SequenceNumber++; + ControlCode = DataCheckSum = i; + TimeSec = (int)(l / 1000L); + TimeUSec = (int)((l % 1000L) * 1000L); + rec.putInt(0, HdrID); + rec.putInt(4, HdrLength); + rec.putInt(8, DataLength); + rec.putInt(12, SequenceNumber); + rec.putInt(16, TimeSec); + rec.putInt(20, TimeUSec); + rec.putInt(24, DataCheckSum); + rec.putInt(28, ControlCode); + } + + int HdrID; + int HdrLength; + int DataLength; + int SequenceNumber; + int TimeSec; + int TimeUSec; + int DataCheckSum; + int ControlCode; + byte buf[]; + ByteBuffer rec; + final aplug this$0; + + ACS_Control() + { + this$0 = aplug.this; + super(); + HdrID = 0xf7010000; + HdrLength = 32; + DataLength = 4; + SequenceNumber = 0; + TimeSec = 0; + TimeUSec = 0; + DataCheckSum = 0; + ControlCode = 0; + buf = new byte[32]; + rec = ByteBuffer.wrap(buf).order(ByteOrder.LITTLE_ENDIAN); + } + } + + class Talkie extends Thread + { + + public TargetDataLine GetTDLFromAF(AudioFormat audioformat) + throws OutOfMemoryError + { + Object obj = null; + javax.sound.sampled.DataLine.Info info; + info = new javax.sound.sampled.DataLine.Info(javax/sound/sampled/TargetDataLine, audioformat); + if(AudioSystem.isLineSupported(info)) + break MISSING_BLOCK_LABEL_60; + System.out.println((new StringBuilder()).append("GetTDLFromAF: AudioSystem.isLineSupported(").append(info).append(") = ").append(AudioSystem.isLineSupported(info)).toString()); + return null; + TargetDataLine targetdataline; + try + { + targetdataline = (TargetDataLine)AudioSystem.getLine(info); + if(targetdataline != null) + targetdataline.open(audioformat); + else + System.out.println("GetTDLFromAF: Can not get target data line!"); + } + catch(LineUnavailableException lineunavailableexception) + { + System.out.println((new StringBuilder()).append("GetTDLFromAF: ").append(lineunavailableexception).toString()); + lineunavailableexception.printStackTrace(); + return null; + } + return targetdataline; + } + + public AudioInputStream GetSourceAIS(TargetDataLine targetdataline) + throws OutOfMemoryError + { + Object obj = null; + if(targetdataline == null) + { + return null; + } else + { + AudioInputStream audioinputstream = new AudioInputStream(targetdataline); + return audioinputstream; + } + } + + public int GetAuthentication() + { + Object obj = null; + Object obj1 = null; + Object obj2 = null; + Object obj3 = null; + boolean flag = false; + byte abyte0[] = new byte[1500]; + boolean flag1 = false; + Object obj4 = null; + int i = 0; + try + { + String s = new String("POST /dev2/dgtalkie.cgi HTTP/1.0\r\nContent-length: 0\r\nUser-Agent: user\r\nAuthorization: Basic "); + s = s.concat(m_sPassword); + s = s.concat("\r\n\r\n"); + byte abyte1[] = s.getBytes("8859_1"); + Socket socket; + if(m_iRemotePort.intValue() == 8481 || m_iRemotePort.intValue() == 80) + socket = new Socket(m_sRemoteHost, 80); + else + socket = new Socket(m_sRemoteHost, m_iRemotePort.intValue()); + socket.setSoTimeout(30000); + socket.setKeepAlive(true); + DataInputStream datainputstream = new DataInputStream(socket.getInputStream()); + DataOutputStream dataoutputstream = new DataOutputStream(socket.getOutputStream()); + dataoutputstream.write(abyte1); + BufferedReader bufferedreader = new BufferedReader(new InputStreamReader(socket.getInputStream())); + String s1 = bufferedreader.readLine(); + if(s1 != null && s1.indexOf("HTTP/") >= 0) + if(s1.indexOf("200") >= 0) + i = 0; + else + i = 1; + do + { + String s2; + if((s2 = bufferedreader.readLine()) == null) + break; + if(s2.indexOf("WWW-Authenticate: ") < 0) + continue; + int j = s2.indexOf("realm=") + 7; + int k = s2.indexOf('"', j); + realm = s2.substring(j, k); + j = s2.indexOf("qop=") + 5; + k = s2.indexOf('"', j); + qop = s2.substring(j, k); + j = s2.indexOf("nonce=") + 7; + k = s2.indexOf('"', j); + nonce = s2.substring(j, k); + break; + } while(true); + datainputstream.close(); + dataoutputstream.close(); + bufferedreader.close(); + socket.close(); + datainputstream = null; + dataoutputstream = null; + bufferedreader = null; + socket = null; + } + catch(Exception exception) + { + System.err.println(exception); + i = -1; + } + return i; + } + + public void run() + { + Socket socket; + DataInputStream datainputstream; + DataOutputStream dataoutputstream; + byte abyte0[]; + TargetDataLine targetdataline; + AudioInputStream audioinputstream; + Object obj = null; + socket = null; + datainputstream = null; + dataoutputstream = null; + boolean flag = false; + abyte0 = new byte[1500]; + boolean flag1 = false; + Object obj1 = null; + Object obj3 = null; + Object obj5 = null; + targetdataline = null; + audioinputstream = null; + Object obj6 = null; + if(drawLine) + return; +_L2: + if(!m_bImageThreadRun) + break; /* Loop/switch isn't completed */ + if(!m_AudioOut) + { + Thread.currentThread(); + Thread.sleep(200L); + continue; /* Loop/switch isn't completed */ + } + int j = GetAuthentication(); + if(j < 0) + { + StopAudioOut(); + continue; /* Loop/switch isn't completed */ + } + try + { + String s = new String("POST /dev2/dgtalkie.cgi HTTP/1.0\r\nContent-type: audio/x-wave\r\nContent-length: "); + s = s.concat(Integer.toString(0x77359400, 10)); + s = s.concat("\r\nUser-Agent: user\r\nAuthorization: "); + if(j == 1) + { + String s1 = GetDigestAuthentication("POST", "/dev2/dgtalkie.cgi", realm, qop, nonce); + s = s.concat(s1); + } else + { + s = s.concat("Basic "); + s = s.concat(m_sPassword); + } + s = s.concat("\r\n\r\n"); + byte abyte1[] = s.getBytes("8859_1"); + if(m_iRemotePort.intValue() == 8481 || m_iRemotePort.intValue() == 80) + socket = new Socket(m_sRemoteHost, 80); + else + socket = new Socket(m_sRemoteHost, m_iRemotePort.intValue()); + socket.setSoTimeout(30000); + socket.setKeepAlive(true); + datainputstream = new DataInputStream(socket.getInputStream()); + dataoutputstream = new DataOutputStream(socket.getOutputStream()); + dataoutputstream.write(abyte1); + AudioOutStatus = 1; + acsControl.prepare_control_header(1); + dataoutputstream.write(acsControl.buf, 0, acsControl.buf.length); + dataoutputstream.flush(); + acsControl.prepare_control_header(2); + dataoutputstream.write(acsControl.buf, 0, acsControl.buf.length); + dataoutputstream.flush(); + acsControl.prepare_control_header(4); + dataoutputstream.write(acsControl.buf, 0, acsControl.buf.length); + dataoutputstream.flush(); + AudioFormat audioformat = new AudioFormat(16000F, 16, 1, true, false); + if((targetdataline = GetTDLFromAF(audioformat)) == null) + System.out.println("ReadMicrophoneToIPCam: Can't get Target DataLine."); + else + if((audioinputstream = GetSourceAIS(targetdataline)) == null) + System.out.println("ReadMicrophoneToIPCam: Can't get Source Input Stream."); + if(targetdataline == null || audioinputstream == null) + { + if(targetdataline != null) + targetdataline.close(); + if(audioinputstream != null) + audioinputstream.close(); + m_AudioOut = false; + AudioOutStatus = -3; + throw new Exception("Can't get microphone device."); + } + targetdataline.start(); + int i = 0; + do + { + if(i == -1 || !m_AudioOut) + break; + Thread.currentThread(); + Thread.sleep(10L); + if(audioinputstream.available() >= 1024) + { + acsAudio.prepare_audio_header(1024); + i = audioinputstream.read(acsAudio.buf, acsAudio.HdrLength, 1024); + if(i == 1024) + dataoutputstream.write(acsAudio.buf, 0, acsAudio.buf.length); + } + } while(true); + if(m_AudioOut) + StopAudioOut(); + AudioOutStatus = 0; + acsControl.prepare_control_header(5); + dataoutputstream.write(acsControl.buf, 0, acsControl.buf.length); + acsControl.prepare_control_header(3); + dataoutputstream.write(acsControl.buf, 0, acsControl.buf.length); + acsControl.prepare_control_header(6); + dataoutputstream.write(acsControl.buf, 0, acsControl.buf.length); + datainputstream.read(abyte0, 0, 64); + } + catch(Exception exception) + { + exception.printStackTrace(); + m_AudioOut = false; + mute_start_time = System.currentTimeMillis(); + if(AudioOutStatus >= 0) + AudioOutStatus = -4; + } + try + { + audioinputstream.close(); + targetdataline.close(); + Object obj2 = null; + Object obj4 = null; + datainputstream.close(); + dataoutputstream.close(); + socket.close(); + datainputstream = null; + dataoutputstream = null; + socket = null; + } + catch(Exception exception1) + { + exception1.printStackTrace(); + m_AudioOut = false; + } + if(true) goto _L2; else goto _L1 +_L1: + } + + String realm; + String qop; + String nonce; + final aplug this$0; + + Talkie() + { + this$0 = aplug.this; + super(); + realm = null; + qop = null; + nonce = null; + } + } + + class AU extends Thread + { + + public void run() + { + if(drawLine) + return; + do + { + if(!m_bImageThreadRun) + break; + try + { + if(algorithm == 0 || algorithm == 2) + sTmp = new String("GET /audio.cgi HTTP/1.0\r\nUser-Agent: user\r\nAuthorization: Basic "); + else + sTmp = new String("GET /dgaudio.cgi HTTP/1.0\r\nUser-Agent: user\r\nAuthorization: Basic "); + sTmp = sTmp.concat(m_sPassword); + sTmp = sTmp.concat("\r\n\r\n"); + m_GetSoundString = sTmp.getBytes("8859_1"); + do + { + Thread.currentThread(); + Thread.sleep(100L); + if(m_iRemotePort.intValue() == 8481 || m_iRemotePort.intValue() == 80) + m_sktSound = new Socket(m_sRemoteHost, 80); + else + m_sktSound = new Socket(m_sRemoteHost, m_iRemotePort.intValue()); + m_sktSound.setSoTimeout(30000); + m_sktSound.setKeepAlive(true); + m_soundInput = new DataInputStream(m_sktSound.getInputStream()); + m_soundOutput = new DataOutputStream(m_sktSound.getOutputStream()); + m_soundOutput.write(m_GetSoundString); + m_soundInput.read(rData, 0, 64); + String s = new String(rData, 0, 64); + if(s != null && s.indexOf("HTTP/") >= 0) + { + if(s.indexOf("200") >= 0) + break; + if(s.indexOf("501") >= 0) + delay_try = true; + } + BufferedReader bufferedreader = new BufferedReader(new InputStreamReader(m_sktSound.getInputStream())); + do + { + String s1; + if((s1 = bufferedreader.readLine()) == null) + break; + if(s1.indexOf("WWW-Authenticate: ") < 0) + continue; + int i = s1.indexOf("realm=") + 7; + int j = s1.indexOf('"', i); + realm = s1.substring(i, j); + i = s1.indexOf("qop=") + 5; + j = s1.indexOf('"', i); + qop = s1.substring(i, j); + i = s1.indexOf("nonce=") + 7; + j = s1.indexOf('"', i); + nonce = s1.substring(i, j); + break; + } while(true); + if(algorithm == 0) + { + sTmp = new String("GET /audio.cgi HTTP/1.0\r\nUser-Agent: user\r\nAuthorization: Basic "); + sTmp = sTmp.concat(m_sPassword); + } else + if(algorithm == 1) + { + String s2 = GetDigestAuthentication("GET", "/dgaudio.cgi", realm, qop, nonce); + sTmp = new String("GET /dgaudio.cgi HTTP/1.0\r\nUser-Agent: user\r\nAuthorization: "); + sTmp = sTmp.concat(s2); + } else + { + String s3 = GetDigestAuthentication("GET", "/audio.cgi", realm, qop, nonce); + sTmp = new String("GET /audio.cgi HTTP/1.0\r\nUser-Agent: user\r\nAuthorization: "); + sTmp = sTmp.concat(s3); + } + sTmp = sTmp.concat("\r\n\r\n"); + m_GetSoundString = sTmp.getBytes("8859_1"); + m_soundInput.close(); + m_soundOutput.close(); + bufferedreader.close(); + m_sktSound.close(); + m_soundInput = null; + m_soundOutput = null; + bufferedreader = null; + m_sktSound = null; + if(delay_try) + { + Thread.currentThread(); + Thread.sleep(10000L); + } + delay_try = false; + } while(true); + nRead = 0; + boolean flag = false; + int j1; + do + { + nRead = nRead + m_soundInput.read(rData, nRead, rData.length - nRead); + j1 = 0; + do + { + if(j1 >= nRead - 7) + break; + if(rData[j1] == 13 && rData[j1 + 1] == 10 && rData[j1 + 2] == 13 && rData[j1 + 3] == 10 && rData[j1 + 4] == 82 && rData[j1 + 5] == 73 && rData[j1 + 6] == 70 && rData[j1 + 7] == 70) + { + flag = true; + j1 += 4; + break; + } + j1++; + } while(true); + Thread.currentThread(); + Thread.sleep(3L); + } while(nRead != -1 && !flag); + long l = (long)rData[j1 + 27] << 24 & 0xffffffffff000000L | (long)rData[j1 + 26] << 16 & 0xff0000L | (long)rData[j1 + 25] << 8 & 65280L | (long)rData[j1 + 24] & 255L; + int k = rData[j1 + 22] + (rData[j1 + 23] << 8); + int i1 = rData[j1 + 34] + (rData[j1 + 35] << 8); + j1 += 44; + soundFormat = new AudioFormat(l, i1, k, true, false); + info = new javax.sound.sampled.DataLine.Info(javax/sound/sampled/SourceDataLine, soundFormat, InternalBufferSize); + line = (SourceDataLine)AudioSystem.getLine(info); + line.open(soundFormat, InternalBufferSize); + int k1 = line.getBufferSize(); + muteControl = (BooleanControl)line.getControl(javax.sound.sampled.BooleanControl.Type.MUTE); + mute_start_time = System.currentTimeMillis(); + int l1 = rData[j1 + 63] << 8 + rData[j1 + 62]; + nRead = 0; + int k2 = k * 256; + retry = 0; + do + { + if(nRead == -1 || !m_bImageThreadRun) + break; + if(mute_start_time != 0L) + if(System.currentTimeMillis() - mute_start_time >= 1000L) + { + line.start(); + mute_start_time = 0L; + turn_sound_on = true; + } else + { + m_soundInput.read(rData, 0, rData.length); + } + if(SoundOn == 0 || m_AudioOut && m_TwoWay == 0) + { + if(turn_sound_off) + { + turn_sound_off = false; + line.stop(); + } + Thread.currentThread(); + Thread.sleep(30L); + m_soundInput.read(rData, 0, rData.length); + } else + { + Thread.currentThread(); + Thread.sleep(8L); + nRead = m_soundInput.read(rData, 0, rData.length); + if(turn_sound_on && nRead >= 64) + { + turn_sound_on = false; + line.flush(); + for(int j2 = 0; j2 < 32; j2++) + { + int i2 = (l1 / 32) * j2; + rData[j2 * 2] = (byte)(i2 & 0xff); + rData[j2 * 2 + 1] = (byte)(i2 >> 8 & 0xff); + } + + } + if(nRead > 0 && (k1 - line.available()) / k2 < 50) + if(line.available() >= nRead) + line.write(rData, 0, nRead); + else + line.flush(); + } + } while(true); + } + catch(Exception exception) + { + exception.printStackTrace(); + } + try + { + line.flush(); + line.stop(); + line.close(); + line = null; + soundFormat = null; + info = null; + m_soundInput.close(); + m_soundOutput.close(); + m_sktSound.close(); + m_soundInput = null; + m_soundOutput = null; + m_sktSound = null; + } + catch(Exception exception1) + { + System.err.println(exception1); + } + } while(true); + } + + int ExternalBufferSize; + int InternalBufferSize; + SourceDataLine line; + String sTmp; + Socket m_sktSound; + DataInputStream m_soundInput; + DataOutputStream m_soundOutput; + AudioFormat soundFormat; + javax.sound.sampled.DataLine.Info info; + int nRead; + int retry; + byte rData[]; + byte m_GetSoundString[]; + String realm; + String qop; + String nonce; + boolean delay_try; + final aplug this$0; + + AU() + { + this$0 = aplug.this; + super(); + ExternalBufferSize = 64000; + InternalBufferSize = 64000; + line = null; + sTmp = null; + m_sktSound = null; + m_soundInput = null; + m_soundOutput = null; + soundFormat = null; + info = null; + nRead = 0; + retry = 0; + rData = new byte[ExternalBufferSize]; + realm = null; + qop = null; + nonce = null; + delay_try = false; + } + } + + class TS extends Thread + { + + public void run() + { + while(m_bImageThreadRun) + { + if(m_bIsPostDataConnect) + PostData(); + try + { + Thread.currentThread(); + Thread.sleep(30L); + } + catch(Exception exception) { } + } + } + + public void PostData() + { + byte abyte1[] = new byte[512]; + String s = new String(""); + String s2 = new String(""); + String s4 = new String(""); + String s5 = new String(""); + boolean flag = false; + boolean flag1 = false; + String s6 = null; + String s7 = null; + String s8 = null; + BufferedReader bufferedreader = null; + try + { + switch(post_function) + { + case 1: // '\001' + s4 = s4.concat("POST /iocontrol.cgi HTTP/1.0\r\n"); + s2 = new String("/iocontrol.cgi"); + break; + + case 2: // '\002' + s4 = s4.concat("POST /pantiltcontrol.cgi HTTP/1.0\r\n"); + s2 = new String("/pantiltcontrol.cgi"); + break; + + case 3: // '\003' + s4 = s4.concat("POST /audiocontrol.cgi HTTP/1.0\r\n"); + s2 = new String("/audiocontrol.cgi"); + break; + + case 4: // '\004' + s4 = s4.concat("POST /motion.cgi HTTP/1.0\r\n"); + s2 = new String("/motion.cgi"); + break; + } + s4 = s4.concat("Content-length: "); + String s3 = Integer.toString(m_postdata.length(), 10); + s4 = s4.concat(s3); + s4 = s4.concat("\r\n"); + do + { + if(m_iRemotePort.intValue() == 8481 || m_iRemotePort.intValue() == 80) + m_sktPostData = new Socket(m_sRemoteHost, 80); + else + m_sktPostData = new Socket(m_sRemoteHost, m_iRemotePort.intValue()); + m_sktPostData.setSoTimeout(m_iTimeout.intValue()); + m_PostDataInput = new DataInputStream(m_sktPostData.getInputStream()); + m_PostDataOutput = new DataOutputStream(m_sktPostData.getOutputStream()); + String s1 = s4; + if(flag) + { + s1 = s1.concat("User-Agent: user\r\nAuthorization: "); + s1 = s1.concat(s5); + } else + { + s1 = s1.concat("User-Agent: user\r\nAuthorization: Basic "); + s1 = s1.concat(m_sPassword); + } + s1 = s1.concat("\r\n\r\n"); + s1 = s1.concat(m_postdata); + byte abyte0[] = s1.getBytes("8859_1"); + m_PostDataOutput.write(abyte0); + Thread.currentThread(); + Thread.sleep(30L); + bufferedreader = new BufferedReader(new InputStreamReader(m_sktPostData.getInputStream())); + String s9 = bufferedreader.readLine(); + if(s9 != null && s9.indexOf("HTTP/") >= 0 && s9.indexOf("401") == -1 || flag1) + break; + do + { + String s10; + if((s10 = bufferedreader.readLine()) == null) + break; + if(s10.indexOf("WWW-Authenticate: ") < 0) + continue; + int i = s10.indexOf("realm=") + 7; + int j = s10.indexOf('"', i); + s6 = s10.substring(i, j); + i = s10.indexOf("qop=") + 5; + j = s10.indexOf('"', i); + s7 = s10.substring(i, j); + i = s10.indexOf("nonce=") + 7; + j = s10.indexOf('"', i); + s8 = s10.substring(i, j); + break; + } while(true); + flag1 = true; + if(algorithm > 0) + { + s5 = GetDigestAuthentication("POST", s2, s6, s7, s8); + flag = true; + } + m_PostDataInput.close(); + m_PostDataOutput.close(); + bufferedreader.close(); + m_sktPostData.close(); + m_PostDataInput = null; + m_PostDataOutput = null; + bufferedreader = null; + m_sktPostData = null; + } while(true); + } + catch(Exception exception) + { + System.err.println(exception); + m_bIsPostDataConnect = false; + m_PostingData = false; + m_PostingPanTiltData = false; + return; + } + m_PostingData = false; + try + { + m_PostDataInput.close(); + m_PostDataOutput.close(); + bufferedreader.close(); + m_sktPostData.close(); + Object obj = null; + m_PostDataInput = null; + m_PostDataOutput = null; + bufferedreader = null; + m_sktPostData = null; + } + catch(Exception exception1) + { + System.err.println(exception1); + } + if(!m_PostingData && !m_PostingPanTiltData) + m_bIsPostDataConnect = false; + } + + final aplug this$0; + + TS() + { + this$0 = aplug.this; + super(); + } + } + + class SI extends Thread + { + + public boolean CreateBlockImage() + { + int i = imgHeight; + int j = imgWidth; + int ai[] = new int[j * i]; + int k = j / block_num; + int l = i / block_num; + boolean flag = false; + PixelGrabber pixelgrabber; + if(j != m_imgCamera.getWidth(null)) + { + Image image = m_imgCamera.getScaledInstance(j, i, 1); + pixelgrabber = new PixelGrabber(image, 0, 0, j, i, ai, 0, j); + } else + { + pixelgrabber = new PixelGrabber(m_imgCamera, 0, 0, j, i, ai, 0, j); + } + try + { + pixelgrabber.grabPixels(); + } + catch(InterruptedException interruptedexception) + { + m_imgProcess = null; + return false; + } +label0: + for(int k2 = 0; k2 < i; k2++) + { + if(k2 > 0 && k2 % l == 0) + { + if(!flag) + { + for(int i1 = 0; i1 < j * 2; i1++) + ai[j * k2 + i1] = ai[j * k2 + i1] & 0xff000000 | 0xff; + + continue; + } + for(int j1 = 0; j1 < j * 4; j1++) + ai[j * (k2 - 2) + j1] = ai[j * (k2 - 2) + j1] & 0xff000000 | 0xff; + + continue; + } + int k1 = 1; + do + { + if(k1 >= block_num) + continue label0; + if(flag) + { + ai[(j * k2 + k * k1) - 2] = ai[(j * k2 + k * k1) - 2] & 0xff000000 | 0xff; + ai[(j * k2 + k * k1) - 1] = ai[(j * k2 + k * k1) - 1] & 0xff000000 | 0xff; + } + ai[j * k2 + k * k1] = ai[j * k2 + k * k1] & 0xff000000 | 0xff; + ai[j * k2 + k * k1 + 1] = ai[j * k2 + k * k1 + 1] & 0xff000000 | 0xff; + k1++; + } while(true); + } + + for(int i4 = 0; i4 < block_num * block_num; i4++) + { + if((block_on >> i4 & 1) == 0) + continue; + byte byte0 = 8; + int i3 = (i4 % block_num) * k; + int j3 = i3 + k; + int k3 = (i4 / block_num) * l; + int l3 = k3 + l; + if(flag) + byte0 = 16; + for(int l2 = k3; l2 < l3; l2++) + { + if(l2 > k3 && l2 % byte0 == 0) + { + for(int l1 = i3; l1 < j3; l1++) + ai[j * l2 + l1] = ai[j * l2 + l1] & 0xff000000 | 0xff; + + if(!flag) + continue; + for(int i2 = i3; i2 < j3; i2++) + ai[j * (l2 + 1) + i2] = ai[j * (l2 + 1) + i2] & 0xff000000 | 0xff; + + continue; + } + for(int j2 = i3 + byte0; j2 < j3; j2 += byte0) + { + ai[j * l2 + j2] = ai[j * l2 + j2] & 0xff000000 | 0xff; + if(flag) + ai[j * l2 + j2 + 1] = ai[j * l2 + j2 + 1] & 0xff000000 | 0xff; + } + + } + + } + + m_imgProcess = createImage(new MemoryImageSource(j, i, ai, 0, j)); + ai = null; + pixelgrabber = null; + return m_imgProcess != null; + } + + public boolean CreateNewImage() + { + int i = m_imgCamera.getHeight(null); + int j = m_imgCamera.getWidth(null); + int ai[] = new int[j * i]; + int k = j / block_num; + int l = i / block_num; + PixelGrabber pixelgrabber = new PixelGrabber(m_imgCamera, 0, 0, j, i, ai, 0, j); + try + { + pixelgrabber.grabPixels(); + } + catch(InterruptedException interruptedexception) + { + m_imgProcess = null; + return false; + } + m_imgProcess = createImage(new MemoryImageSource(j, i, ai, 0, j)); + ai = null; + pixelgrabber = null; + return m_imgProcess != null; + } + + public void run() + { + int i = 100; + Thread thread = Thread.currentThread(); + thread.setPriority(10); + String s = System.getProperty("os.name"); + if(s.indexOf("Windows") >= 0) + { + os_windows = true; + } else + { + os_windows = false; + i = 100; + } +label0: + do + try + { +label1: + { + if(!m_bImageThreadRun) + break label0; + if(!BufferReady) + break label1; + m_imgCamera = null; + m_imgProcess = null; + long l = System.currentTimeMillis(); + m_imgCamera = Toolkit.getDefaultToolkit().createImage(imgbuf, 0, iLength); + m_lNumFrames = m_lNumFrames + 1L; + if(m_imgCamera != null) + { + while(!Toolkit.getDefaultToolkit().prepareImage(m_imgCamera, m_imgCamera.getWidth(null), m_imgCamera.getHeight(null), null)) + { + Thread _tmp = thread; + Thread.sleep(1L); + if(System.currentTimeMillis() - l > (long)i) + { + BufferReady = false; + break label1; + } + } + if(m_imgCamera != null) + { + if(drawLine) + { + if(!CreateBlockImage()) + { + BufferReady = false; + break label1; + } + } else + if(!os_windows && !CreateNewImage()) + { + BufferReady = false; + break label1; + } + Thread _tmp1 = thread; + Thread.sleep(3L); + repaint(); + } + } + BufferReady = false; + } + Thread _tmp2 = thread; + Thread.sleep(2L); + continue; + } + catch(Exception exception) + { + break; + } + while(true); + } + + final aplug this$0; + + SI() + { + this$0 = aplug.this; + super(); + } + } + + + public aplug() + { + MAX_BUFFER_SIZE = 0x400000; + sub_idx = new int[8]; + sub_length = new int[8]; + algorithm = 0; + nc = 1; + m_TwoWay = 0; + m_imgCamera = null; + m_imgProcess = null; + BufferReady = false; + imgbuf = new byte[0x100000]; + tmpbuf = new byte[MAX_BUFFER_SIZE + 0x20000]; + rcvbuf = new byte[1024]; + m_sTimeString = new String("2004-01-01 00:00:00 am"); + HorizontalPosition = 0; + VerticalPosition = 0; + PositionName = new String("test"); + m_PanSingleMoveDegree = 0; + m_TiltSingleMoveDegree = 0; + CV_OK = -1; + CV_ERROR = 0; + ratio = 1; + scale_method = 0; + imgWidth = 0; + imgHeight = 0; + drawLine = false; + block_num = 5; + block_on = 0; + SoundOn = 1; + test_cnt = 0; + os_windows = true; + mute_start_time = 0L; + muteControl = null; + turn_sound_on = false; + turn_sound_off = false; + m_MotionFlag = 0; + acsControl = new ACS_Control(); + acsAudio = new ACS_Audio(); + AudioOutStatus = 0; + m_AudioOut = false; + } + + public void init() + { + try + { + if(getParameter("RemoteHost") != null) + { + m_sRemoteHost = getParameter("RemoteHost"); + } else + { + m_urlRemoteHost = getCodeBase(); + m_sRemoteHost = m_urlRemoteHost.getHost(); + } + imgHeight = getHeight(); + imgWidth = getWidth(); + if(getParameter("Algorithm") != null) + algorithm = Integer.parseInt(getParameter("Algorithm")); + m_iRemotePort = Integer.valueOf(getParameter("RemotePort")); + m_iTimeout = Integer.valueOf(getParameter("Timeout")); + m_lPreviewFrameRate = Long.valueOf(getParameter("PreviewFrameRate")); + m_dRotateAngle = Double.valueOf(getParameter("RotateAngle")); + m_sPassword = getParameter("DeviceSerialNo"); + m_baPassword = m_sPassword.getBytes("8859_1"); + if(getParameter("SetMotionDetection") != null && Integer.parseInt(getParameter("SetMotionDetection")) > 0) + { + drawLine = true; + String s = getParameter("MotionDetectionBlockSet"); + block_on = 0; + if(s != null) + { + int i = s.length(); + if(i > 25) + i = 25; + for(int j = 0; j < i; j++) + if(s.charAt(j) == '1') + block_on = block_on | 1 << j; + + } + } + if(getParameter("TwoWay") != null) + m_TwoWay = Integer.parseInt(getParameter("TwoWay")); + String s1; + if(algorithm == 0 || algorithm == 2) + s1 = new String("GET /mjpeg.cgi HTTP/1.0\r\nUser-Agent: user\r\nAuthorization: Basic "); + else + s1 = new String("GET /dgvideo.cgi HTTP/1.0\r\nUser-Agent: user\r\nAuthorization: Basic "); + s1 = s1.concat(m_sPassword); + s1 = s1.concat("\r\n\r\n"); + m_GetImageString = s1.getBytes("8859_1"); + s1 = new String("GET /IOCONTROL.CGI HTTP/1.0\r\nUser-Agent: user\r\nAuthorization: Basic "); + s1 = s1.concat(m_sPassword); + s1 = s1.concat("\r\n\r\n"); + m_baCliCmdGetRealTimeData = s1.getBytes("8859_1"); + sub_idx[0] = 0; + s1 = new String("Content-type: image/jpeg\r\n\r\n"); + sub_length[0] = s1.length(); + sub_idx[1] = s1.length(); + s1 = s1.concat("\r\n\r\n--video boundary--\r\n"); + sub_length[1] = s1.length() - sub_idx[1]; + sub_idx[2] = s1.length(); + s1 = s1.concat("Content-length: "); + sub_length[2] = s1.length() - sub_idx[2]; + sub_idx[3] = s1.length(); + s1 = s1.concat("Trigger1="); + sub_length[3] = s1.length() - sub_idx[3]; + sub_idx[4] = s1.length(); + s1 = s1.concat("Trigger2="); + sub_length[4] = s1.length() - sub_idx[4]; + sub_idx[5] = s1.length(); + s1 = s1.concat("ImageUpload="); + sub_length[5] = s1.length() - sub_idx[5]; + sub_idx[6] = s1.length(); + s1 = s1.concat("Date: "); + sub_length[6] = s1.length() - sub_idx[6]; + sub_idx[7] = s1.length(); + s1 = s1.concat("ImageEmail="); + sub_length[7] = s1.length() - sub_idx[7]; + substring = s1.getBytes(); + m_lNumFrames = 0L; + m_lTimerPrev = System.currentTimeMillis(); + m_lTimerNow = System.currentTimeMillis(); + m_fFrameRate = 0.0F; + m_bImageThreadRun = false; + m_bRealTimeDataThreadRun = false; + m_bIsRealTimeDataConnect = false; + m_bIsPostDataConnect = false; + m_PostingData = false; + m_PostingPanTiltData = false; + addMouseListener(this); + } + catch(Exception exception) + { + System.err.println(exception); + } + } + + public void mouseClicked(MouseEvent mouseevent) + { + } + + public void mousePressed(MouseEvent mouseevent) + { + int i = mouseevent.getX(); + int j = mouseevent.getY(); + if(!drawLine || i >= imgWidth || j >= imgHeight) + { + return; + } else + { + int k = i / (imgWidth / block_num); + int l = j / (imgHeight / block_num); + block_on = block_on ^ 1 << l * block_num + k; + SetMotionDetect(); + return; + } + } + + public void mouseReleased(MouseEvent mouseevent) + { + } + + public void mouseEntered(MouseEvent mouseevent) + { + } + + public void mouseExited(MouseEvent mouseevent) + { + } + + public void destroy() + { + m_bImageThreadRun = false; + try + { + m_Input.close(); + m_Output.close(); + m_sktClient.close(); + } + catch(Exception exception) + { + System.err.println(exception); + } + } + + public void start() + { + Play(); + } + + public void stop() + { + Stop(); + } + + public void paint(Graphics g) + { + if(m_imgCamera != null) + { + int i = m_imgCamera.getHeight(null); + int j = m_imgCamera.getWidth(null); + imgHeight = getHeight(); + imgWidth = getWidth(); + if(!drawLine) + { + if(os_windows) + g.drawImage(m_imgCamera, 0, 0, imgWidth, imgHeight, (j * (ratio - 1)) / ratio / 2, (i * (ratio - 1)) / ratio / 2, (j * (ratio - 1)) / ratio / 2 + j / ratio, (i * (ratio - 1)) / ratio / 2 + i / ratio, this); + else + if(m_imgProcess != null) + g.drawImage(m_imgProcess, 0, 0, imgWidth, imgHeight, (j * (ratio - 1)) / ratio / 2, (i * (ratio - 1)) / ratio / 2, (j * (ratio - 1)) / ratio / 2 + j / ratio, (i * (ratio - 1)) / ratio / 2 + i / ratio, this); + } else + if(m_imgProcess != null) + g.drawImage(m_imgProcess, 0, 0, imgWidth, imgHeight, this); + } + } + + public void update(Graphics g) + { + paint(g); + } + + public String CvtHex(byte abyte0[]) + { + byte abyte1[] = new byte[abyte0.length * 2]; + for(int i = 0; i < abyte0.length; i++) + { + byte byte0 = (byte)(abyte0[i] >> 4 & 0xf); + if(byte0 <= 9) + abyte1[i * 2] = (byte)(byte0 + 48); + else + abyte1[i * 2] = (byte)((byte0 + 97) - 10); + byte0 = (byte)(abyte0[i] & 0xf); + if(byte0 <= 9) + abyte1[i * 2 + 1] = (byte)(byte0 + 48); + else + abyte1[i * 2 + 1] = (byte)((byte0 + 97) - 10); + } + + return new String(abyte1); + } + + public String decode_base64(byte abyte0[], int i) + { + byte abyte1[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".getBytes(); + byte abyte2[] = new byte[4]; + int j = i % 4; + if(j != 0) + return null; + int k1 = 0; + j = 0; + int k = i / 4; + byte abyte3[] = new byte[k * 3]; + for(int l = 0; l < k; l++) + { + for(int i1 = 0; i1 < 4; i1++) + { + if(abyte0[k1] == 61) + { + abyte2[i1] = 0; + j++; + } else + { + int j1 = 0; + do + { + if(j1 >= 64) + break; + if(abyte0[k1] == abyte1[j1]) + { + abyte2[i1] = (byte)j1; + break; + } + j1++; + } while(true); + } + k1++; + } + + abyte3[l * 3] = (byte)((byte)(abyte2[0] << 2 & 0xfc) | (byte)(abyte2[1] >> 4 & 3)); + abyte3[l * 3 + 1] = (byte)((byte)(abyte2[1] << 4 & 0xf0) | (byte)(abyte2[2] >> 2 & 0xf)); + abyte3[l * 3 + 2] = (byte)((byte)(abyte2[2] << 6 & 0xc0) | abyte2[3]); + } + + return new String(abyte3); + } + + public String GetDigestAuthentication(String s, String s1, String s2, String s3, String s4) + { + String s5 = null; + String s6 = null; + String s7 = null; + String s8 = null; + String s9 = null; + String s10 = decode_base64(m_sPassword.getBytes(), m_sPassword.length()); + s6 = s10.substring(0, s10.indexOf(':')); + if(s10.indexOf('\0') >= 0) + s7 = s10.substring(s10.indexOf(':') + 1, s10.indexOf('\0')); + else + s7 = s10.substring(s10.indexOf(':') + 1); + Random random = new Random(); + byte abyte0[] = new byte[16]; + random.nextBytes(abyte0); + s8 = CvtHex(abyte0); + s9 = String.format("%1$08X", new Object[] { + Integer.valueOf(nc) + }); + nc++; + try + { + MessageDigest messagedigest = MessageDigest.getInstance("MD5"); + messagedigest.update(s6.getBytes()); + messagedigest.update((byte)58); + messagedigest.update(s2.getBytes()); + messagedigest.update((byte)58); + messagedigest.update(s7.getBytes()); + String s12 = CvtHex(messagedigest.digest()); + messagedigest.reset(); + messagedigest.update(s.getBytes()); + messagedigest.update((byte)58); + messagedigest.update(s1.getBytes()); + String s13 = CvtHex(messagedigest.digest()); + messagedigest.reset(); + messagedigest.update(s12.getBytes()); + messagedigest.update((byte)58); + messagedigest.update(s4.getBytes()); + messagedigest.update((byte)58); + if(s3.length() > 0) + { + messagedigest.update(s9.getBytes()); + messagedigest.update((byte)58); + messagedigest.update(s8.getBytes()); + messagedigest.update((byte)58); + messagedigest.update(s3.getBytes()); + messagedigest.update((byte)58); + } + messagedigest.update(s13.getBytes()); + s5 = CvtHex(messagedigest.digest()); + } + catch(Exception exception) + { + exception.printStackTrace(); + } + String s11 = String.format("Digest username=\"%1$s\", realm=\"%2$s\", uri=\"%3$s\", algorithm=MD5, nonce=\"%4$s\", cnonce=\"%5$s\", qop=%6$s, nc=%7$s, response=\"%8$s\"", new Object[] { + s6, s2, s1, s4, s8, s3, s9, s5 + }); + return s11; + } + + public void run() + { + boolean flag; + int i3; + String s; + String s1; + String s2; + boolean flag14; + long l6; + Thread thread; + i3 = 0; + boolean flag6 = false; + long l4 = System.currentTimeMillis(); + boolean flag12 = false; + s = null; + s1 = null; + s2 = null; + flag14 = false; + l6 = System.currentTimeMillis(); + flag = true; + m_bIsConnect = false; + thread = Thread.currentThread(); + if(thread != m_trdCameraImage) goto _L2; else goto _L1 +_L1: + int j1; + int i2; + int k3; + long l5; + boolean flag13; + if(!flag || !m_bImageThreadRun) + break; /* Loop/switch isn't completed */ + System.gc(); + try + { + do + { + thread; + Thread.sleep(100L); + if(m_iRemotePort.intValue() == 8481 || m_iRemotePort.intValue() == 80) + m_sktClient = new Socket(m_sRemoteHost, 80); + else + m_sktClient = new Socket(m_sRemoteHost, m_iRemotePort.intValue()); + m_sktClient.setSoTimeout(m_iTimeout.intValue()); + m_Input = new DataInputStream(m_sktClient.getInputStream()); + m_Output = new DataOutputStream(m_sktClient.getOutputStream()); + m_Output.write(m_GetImageString); + m_Input.read(tmpbuf, 0, 64); + String s3 = new String(tmpbuf, 0, 64); + if(s3 != null && s3.indexOf("HTTP/") >= 0) + { + if(s3.indexOf("200") >= 0) + break; + if(s3.indexOf("501") >= 0) + { + System.out.println("too many users, wait 10 sec."); + flag14 = true; + } + } + BufferedReader bufferedreader = new BufferedReader(new InputStreamReader(m_sktClient.getInputStream())); + do + { + String s4; + if((s4 = bufferedreader.readLine()) == null) + break; + if(s4.indexOf("WWW-Authenticate: ") < 0) + continue; + int i4 = s4.indexOf("realm=") + 7; + int j4 = s4.indexOf('"', i4); + s = s4.substring(i4, j4); + i4 = s4.indexOf("qop=") + 5; + j4 = s4.indexOf('"', i4); + s1 = s4.substring(i4, j4); + i4 = s4.indexOf("nonce=") + 7; + j4 = s4.indexOf('"', i4); + s2 = s4.substring(i4, j4); + break; + } while(true); + String s7; + if(algorithm == 0) + { + s7 = new String("GET /mjpeg.cgi HTTP/1.0\r\nUser-Agent: user\r\nAuthorization: Basic "); + s7 = s7.concat(m_sPassword); + } else + if(algorithm == 1) + { + String s5 = GetDigestAuthentication("GET", "/dgvideo.cgi", s, s1, s2); + s7 = new String("GET /dgvideo.cgi HTTP/1.0\r\nUser-Agent: user\r\nAuthorization: "); + s7 = s7.concat(s5); + } else + { + String s6 = GetDigestAuthentication("GET", "/mjpeg.cgi", s, s1, s2); + s7 = new String("GET /mjpeg.cgi HTTP/1.0\r\nUser-Agent: user\r\nAuthorization: "); + s7 = s7.concat(s6); + } + s7 = s7.concat("\r\n\r\n"); + m_GetImageString = s7.getBytes("8859_1"); + m_Input.close(); + m_Output.close(); + bufferedreader.close(); + m_sktClient.close(); + m_Input = null; + m_Output = null; + bufferedreader = null; + m_sktClient = null; + if(flag14) + { + thread; + Thread.sleep(10000L); + } + flag14 = false; + } while(true); + m_bIsConnect = true; + } + catch(Exception exception) + { + exception.printStackTrace(); + m_bIsConnect = false; + continue; /* Loop/switch isn't completed */ + } + boolean flag1 = false; + boolean flag2 = false; + j1 = 0; + i2 = -1; + boolean flag7 = false; + k3 = 0; + flag13 = false; + l5 = System.currentTimeMillis(); + BufferReady = false; +_L12: + if(!m_bImageThreadRun) + break MISSING_BLOCK_LABEL_1648; + while(BufferReady) + { + int k1 = m_Input.available(); + if(j1 + k1 > MAX_BUFFER_SIZE) + { + j1 = 0; + i2 = -1; + boolean flag8 = false; + k3 = 0; + } + if(k1 > 0) + { + k1 = m_Input.read(tmpbuf, j1, k1); + boolean flag3 = false; + l5 = System.currentTimeMillis(); + j1 += k1; + } else + if(System.currentTimeMillis() - l5 > 15000L) + { + flag13 = true; + m_bIsConnect = false; + BufferReady = false; + break; + } + thread; + Thread.sleep(2L); + } + boolean flag4 = false; +_L10: + if(!m_bIsConnect) + break MISSING_BLOCK_LABEL_1596; + int l1; + if(k3 < 0 || j1 > MAX_BUFFER_SIZE) + { + j1 = 0; + i2 = -1; + boolean flag9 = false; + k3 = 0; + } + l1 = m_Input.available(); + if(l1 <= 0) goto _L4; else goto _L3 +_L3: + if(i2 == -1) + l1 = m_Input.read(tmpbuf, j1, l1); + else + l1 = m_Input.read(imgbuf, j1, k3); + j1 += l1; + boolean flag5 = false; + l5 = System.currentTimeMillis(); + goto _L5 +_L4: + if(System.currentTimeMillis() - l5 > 15000L) + { + flag13 = true; + break MISSING_BLOCK_LABEL_1596; + } +_L5: + if(j1 <= 0) + break MISSING_BLOCK_LABEL_1566; + if(i2 != -1) goto _L7; else goto _L6 +_L6: + int j3; + j3 = SearchString(0, j1, 2); + if(j3 >= 0) + { + i2 = SearchString(j3, j1, 0); + if(i2 > 0) + i3 = SearchString(j3, i2, 6); + } + if(i2 >= 0) goto _L9; else goto _L8 +_L8: + thread; + Thread.sleep(2L); + goto _L10 +_L9: +label0: + { + if(i3 > 0) + { + int j2 = i3; + m_sTimeString = new String(tmpbuf, j2 + 6, 22); + if(!m_PostingData) + { + m_iIOOut1 = tmpbuf[j2 + 39] - 48; + m_iIOOut2 = tmpbuf[j2 + 38] - 48; + m_imageUpload = tmpbuf[j2 + 37] - 48; + m_imageEmail = tmpbuf[j2 + 36] - 48; + if(tmpbuf[j2 + 35] == 49) + { + l6 = System.currentTimeMillis(); + m_MotionFlag = 1; + } else + if(m_MotionFlag == 1 && System.currentTimeMillis() - l6 > 3000L) + m_MotionFlag = 0; + } + int l3 = 0; + for(int i = 0; i < 3; i++) + l3 = l3 * 10 + (tmpbuf[j2 + 44 + i] - 48); + + HorizontalPosition = l3; + l3 = 0; + for(int j = 0; j < 3; j++) + l3 = l3 * 10 + (tmpbuf[j2 + 48 + j] - 48); + + VerticalPosition = l3; + } + if(j3 < 0) + break MISSING_BLOCK_LABEL_1566; + int k2 = j3; + k2 += sub_length[2]; + k3 = 0; + for(; tmpbuf[k2] >= 48 && tmpbuf[k2] <= 57; k2++) + k3 = k3 * 10 + (tmpbuf[k2] - 48); + + iLength = k3; + boolean flag10 = false; + i2 += sub_length[0]; + j1 -= i2; + if(k3 <= j1) + break label0; + for(int k = 0; k < j1; k++) + imgbuf[k] = tmpbuf[k + i2]; + + k3 -= j1; + thread; + Thread.sleep(2L); + } + goto _L10 + try + { + for(int l = 0; l < k3; l++) + imgbuf[l] = tmpbuf[l + i2]; + + int l2; + if(j1 > k3 * 4) + { + l2 = SearchString(i2 + k3 * 2, j1 - k3 * 2, 2); + if(l2 >= 0) + { + j1 = (j1 + i2) - l2; + } else + { + j1 -= k3; + l2 = i2 + k3; + } + } else + { + j1 -= k3; + l2 = i2 + k3; + } + for(int i1 = 0; i1 < j1; i1++) + tmpbuf[i1] = tmpbuf[i1 + l2]; + + BufferReady = true; + i2 = -1; + continue; /* Loop/switch isn't completed */ + } + catch(Exception exception1) + { + char c = '\u4E20'; + BufferReady = false; + flag13 = true; + } + break MISSING_BLOCK_LABEL_1596; +_L7: + k3 -= l1; + if(k3 <= 0) + { + BufferReady = true; + i2 = -1; + j1 = 0; + continue; /* Loop/switch isn't completed */ + } + thread; + Thread.sleep(2L); + goto _L10 + if(flag13) + break; /* Loop/switch isn't completed */ + thread; + Thread.sleep(3L); + i2 = -1; + boolean flag11 = false; + if(true) goto _L12; else goto _L11 +_L11: + m_bIsConnect = false; + break MISSING_BLOCK_LABEL_1648; + Exception exception2; + exception2; + System.err.println(": Getting image connection broken."); + m_bIsConnect = false; + m_fFrameRate = 0.0F; + try + { + m_Input.close(); + m_Output.close(); + m_sktClient.close(); + m_Input = null; + m_Output = null; + m_sktClient = null; + m_bIsConnect = false; + } + catch(Exception exception3) + { + System.err.println(exception3); + } + if(!m_bImageThreadRun) + flag = false; + if(true) goto _L1; else goto _L2 +_L2: + } + + public int SearchString(int i, int j, int k) + { + if(i < 0) + i = 0; + int l = 0; + l = sub_length[k]; + int k1 = sub_idx[k]; + for(int i1 = i; i1 < (j - l) + 1; i1++) + { + int j1; + for(j1 = 0; j1 < l && tmpbuf[i1 + j1] == substring[j1 + k1]; j1++); + if(j1 == l) + return i1; + } + + return -1; + } + + public int GetRealTimeData() + { + return CV_OK; + } + + public String GetFrameRate() + { + CalculateFrameRate(); + return Float.toString(m_fFrameRate); + } + + public int GetMotionDetectFlag() + { + return block_on; + } + + public void CalculateFrameRate() + { + long l; + m_lTimerNow = System.currentTimeMillis(); + l = m_lTimerNow - m_lTimerPrev; + if(l <= 0L) + { + m_fFrameRate = 0.0F; + m_lNumFrames = 0L; + return; + } + try + { + long l1 = Math.round(((float)m_lNumFrames * 100000F) / (float)l); + m_fFrameRate = (float)l1 / 100F; + m_lNumFrames = 0L; + m_lTimerPrev = m_lTimerNow; + } + catch(Exception exception) + { + System.err.println(exception); + } + return; + } + + public int Play() + { + if(!m_bImageThreadRun) + { + m_bImageThreadRun = true; + m_trdCameraImageShow = new SI(); + m_trdCameraImageShow.start(); + m_trdTriggerState = new TS(); + m_trdTriggerState.start(); + m_trdCameraSound = new AU(); + m_trdCameraSound.start(); + m_trdTalkie = new Talkie(); + m_trdTalkie.start(); + m_trdCameraImage = new Thread(this); + m_trdCameraImage.start(); + } + return CV_OK; + } + + public void Stop() + { + m_bImageThreadRun = false; + } + + public String GetRemoteHost() + { + return m_sRemoteHost; + } + + public int GetRemotePort() + { + return m_iRemotePort.intValue(); + } + + public int SetRemotePort(int i) + { + m_iRemotePort = new Integer(i); + return CV_OK; + } + + public int GetTimeout() + { + return m_iTimeout.intValue(); + } + + public int SetTimeout(int i) + { + m_iTimeout = new Integer(i); + return CV_OK; + } + + public long GetPreviewFrameRate() + { + return m_lPreviewFrameRate.longValue(); + } + + public int SetPreviewFrameRate(long l) + { + m_lPreviewFrameRate = new Long(l); + return CV_OK; + } + + public double GetRotateAngle() + { + return m_dRotateAngle.doubleValue(); + } + + public int SetRotateAngle(double d) + { + m_dRotateAngle = new Double(d); + return CV_OK; + } + + private boolean CompareByteArray(byte abyte0[], byte abyte1[], int i) + { + for(int j = 0; j < i; j++) + if(abyte0[j] != abyte1[j]) + return false; + + return true; + } + + public int GetIOIn1() + { + return m_iIOIn1; + } + + public int GetIOIn2() + { + return m_iIOIn2; + } + + public int GetImageUpload() + { + return m_imageUpload; + } + + public int GetImageEmail() + { + return m_imageEmail; + } + + public int GetIOOut1() + { + return m_iIOOut1; + } + + public int GetIOOut2() + { + return m_iIOOut2; + } + + public int SetTriggerState(int i, int j, int k, int l) + { + int i1 = 0; + if(!m_bIsConnect) + return CV_ERROR; + while(m_PostingData || m_PostingPanTiltData) + { + if(++i1 > 15) + return CV_ERROR; + try + { + Thread.currentThread(); + Thread.sleep(20L); + } + catch(Exception exception) { } + } + m_PostingData = true; + m_bIsRealTimeDataConnect = false; + post_function = 1; + m_postdata = new String(""); + if(i == 0) + m_postdata = m_postdata.concat("Trigger1=0&"); + else + m_postdata = m_postdata.concat("Trigger1=1&"); + if(j == 0) + m_postdata = m_postdata.concat("Trigger2=0&"); + else + m_postdata = m_postdata.concat("Trigger2=1&"); + if(k == 0) + m_postdata = m_postdata.concat("ImageUpload=0&"); + else + m_postdata = m_postdata.concat("ImageUpload=1&"); + if(l == 0) + m_postdata = m_postdata.concat("ImageEmail=0\r\n\r\n"); + else + m_postdata = m_postdata.concat("ImageEmail=1\r\n\r\n"); + m_iIOOut1 = i; + m_iIOOut2 = j; + m_imageUpload = k; + m_imageEmail = l; + m_bIsPostDataConnect = true; + return CV_OK; + } + + public int SetIOOut1(int i) + { + return SetTriggerState(i, m_iIOOut2, m_imageUpload, m_imageEmail); + } + + public int SetIOOut2(int i) + { + return SetTriggerState(m_iIOOut1, i, m_imageUpload, m_imageEmail); + } + + public int SetImageUpload(int i) + { + return SetTriggerState(m_iIOOut1, m_iIOOut2, i, m_imageEmail); + } + + public int SetImageEmail(int i) + { + return SetTriggerState(m_iIOOut1, m_iIOOut2, m_imageUpload, i); + } + + public int GetYear() + { + return m_iYear; + } + + public int GetMonth() + { + return m_iMonth; + } + + public int GetDay() + { + return m_iDay; + } + + public int GetDate() + { + return m_iDate; + } + + public int GetHour() + { + return m_iHour; + } + + public int GetMinute() + { + return m_iMinute; + } + + public int GetSecond() + { + return m_iSecond; + } + + public String GetTimeString() + { + return m_sTimeString; + } + + public String GetVersion() + { + String s = "20030123"; + return s; + } + + public boolean GetIsConnect() + { + return m_bIsConnect; + } + + public int GetHorizontalPosition() + { + return HorizontalPosition; + } + + public int GetVerticalPosition() + { + return VerticalPosition; + } + + public int SetPanTilt(int i, int j) + { + int k = 0; + if(!m_bIsConnect) + return CV_ERROR; + while(m_PostingData || m_PostingPanTiltData) + { + if(++k > 15) + return CV_ERROR; + try + { + Thread.currentThread(); + Thread.sleep(20L); + } + catch(Exception exception) { } + } + m_PostingData = true; + m_bIsRealTimeDataConnect = false; + String s6 = new String(""); + switch(i) + { + case 1: // '\001' + s6 = s6.concat("PanSingleMoveDegree="); + String s = Integer.toString(m_PanSingleMoveDegree, 10); + s6 = s6.concat(s); + s6 = s6.concat("&TiltSingleMoveDegree="); + s = Integer.toString(m_TiltSingleMoveDegree, 10); + s6 = s6.concat(s); + s6 = s6.concat("&PanTiltSingleMove="); + s = Integer.toString(j, 10); + s6 = s6.concat(s); + break; + + case 2: // '\002' + s6 = s6.concat("PanTiltPresetPositionMove="); + String s1 = Integer.toString(j, 10); + s6 = s6.concat(s1); + break; + + case 3: // '\003' + s6 = s6.concat("PanTiltHorizontal="); + String s2 = Integer.toString(HorizontalPosition, 10); + s6 = s6.concat(s2); + s6 = s6.concat("&PanTiltVertical="); + s2 = Integer.toString(VerticalPosition, 10); + s6 = s6.concat(s2); + s6 = s6.concat("&SetName="); + s6 = s6.concat(PositionName); + s6 = s6.concat("&SetPosition="); + s2 = Integer.toString(j, 10); + s6 = s6.concat(s2); + break; + + case 4: // '\004' + s6 = s6.concat("ClearPosition="); + String s3 = Integer.toString(j, 10); + s6 = s6.concat(s3); + break; + + case 5: // '\005' + s6 = s6.concat("PanTiltSwingMode="); + String s4 = Integer.toString(j, 10); + s6 = s6.concat(s4); + break; + } + s6 = s6.concat("\r\n\r\n"); + String s5 = Integer.toString(s6.length(), 10); + post_function = 2; + m_postdata = new String(""); + m_postdata = m_postdata.concat(s6); + m_bIsPostDataConnect = true; + return CV_OK; + } + + public int MovePanTiltDegree(int i) + { + return SetPanTilt(1, i); + } + + public int MovePanTiltPosition(int i) + { + return SetPanTilt(2, i); + } + + public int SetPosition(int i) + { + return SetPanTilt(3, i); + } + + public int ClearPosition(int i) + { + return SetPanTilt(4, i); + } + + public int SwingMode(int i) + { + return SetPanTilt(5, i); + } + + public int PanSingleMoveDegree(int i) + { + m_PanSingleMoveDegree = i; + return 0; + } + + public int TiltSingleMoveDegree(int i) + { + m_TiltSingleMoveDegree = i; + return 0; + } + + public int SetName(String s) + { + PositionName = new String("654321"); + return 0; + } + + public int Zoom(int i) + { + ratio = i; + return 0; + } + + public int SetSound(int i) + { + if(m_AudioOut && m_TwoWay == 0) + return 0; + int j = 0; + Object obj = null; + String s = new String(""); + if(SoundOn != i) + if(i == 1) + mute_start_time = System.currentTimeMillis(); + else + turn_sound_off = true; + SoundOn = i; + if(!m_bIsConnect) + return CV_ERROR; + while(m_PostingData) + { + if(++j > 15) + return CV_ERROR; + try + { + Thread.currentThread(); + Thread.sleep(20L); + } + catch(Exception exception) { } + } + m_PostingData = true; + s = s.concat("AudioMute="); + s = s.concat(SoundOn != 0 ? "0" : "1"); + s = s.concat("\r\n\r\n"); + post_function = 3; + m_postdata = new String(""); + m_postdata = m_postdata.concat(s); + obj = null; + s = null; + m_bIsPostDataConnect = true; + return 0; + } + + public int SetMotionDetect() + { + int i = 0; + String s = new String(""); + if(!m_bIsConnect) + return CV_ERROR; + while(m_PostingData) + { + if(++i > 15) + return CV_ERROR; + try + { + Thread.currentThread(); + Thread.sleep(20L); + } + catch(Exception exception) { } + } + m_PostingData = true; + s = s.concat("ConfigTemp=Java&MotionDetectionBlockSet="); + for(int j = 0; j < 25; j++) + s = s.concat((block_on & 1 << j) == 0 ? "0" : "1"); + + s = s.concat("\r\n\r\n"); + post_function = 4; + m_postdata = new String(""); + m_postdata = m_postdata.concat(s); + m_bIsPostDataConnect = true; + return CV_OK; + } + + public int GetMotionFlag() + { + return m_MotionFlag; + } + + public void StartAudioOut() + { + m_AudioOut = true; + if(m_TwoWay == 0) + turn_sound_off = true; + } + + public void StopAudioOut() + { + m_AudioOut = false; + AudioOutStatus = 0; + if(m_TwoWay == 0) + mute_start_time = System.currentTimeMillis(); + } + + public int CheckAudioOutStatus() + { + int i = AudioOutStatus; + if(AudioOutStatus < 0) + AudioOutStatus = 0; + return i; + } + + public void ComputePasswordEncryption20(byte abyte0[], byte abyte1[], byte abyte2[]) + { + for(int i = 0; i < 20; i++) + abyte0[i] = abyte1[i]; + + for(int j = 0; j < 2; j++) + { + for(int k = 0; k < 20; k++) + { + abyte0[k] ^= abyte2[k + j * 20]; + byte byte1 = (byte)(abyte0[k] & 0xf); + byte byte0 = (byte)(abyte0[k] & 0xfffffff0); + if((abyte0[k] & 1) != 0) + { + byte1 ^= abyte2[k + j * 20 + 40]; + byte1 &= 0xf; + } + if((abyte0[k] & 0x10) != 0) + { + byte0 ^= abyte2[k + j * 20 + 40]; + byte0 &= 0xf0; + } + abyte0[k] = (byte)(byte0 | byte1); + } + + } + + } + + private int MAX_BUFFER_SIZE; + private String m_sRemoteHost; + private URL m_urlRemoteHost; + private Integer m_iRemotePort; + private Integer m_iTimeout; + private Long m_lPreviewFrameRate; + private Long m_lCameraInfoRefreshRate; + private Double m_dRotateAngle; + private String m_sPassword; + private byte m_baPassword[]; + private String m_postdata; + private String m_postpantiltdata; + private int sub_idx[]; + private int sub_length[]; + private byte substring[]; + private int algorithm; + private int nc; + private int m_TwoWay; + private Thread m_trdCameraImage; + private SI m_trdCameraImageShow; + private TS m_trdTriggerState; + private AU m_trdCameraSound; + private Image m_imgCamera; + private Image m_imgProcess; + private int iLength; + private boolean BufferReady; + private byte imgbuf[]; + private byte tmpbuf[]; + private byte rcvbuf[]; + private Socket m_sktClient; + private DataInputStream m_Input; + private DataOutputStream m_Output; + private Socket m_sktPostData; + private DataInputStream m_PostDataInput; + private DataOutputStream m_PostDataOutput; + private boolean m_bImageThreadRun; + private boolean m_bRealTimeDataThreadRun; + private boolean m_bIsRealTimeDataConnect; + private boolean m_bIsConnect; + private boolean m_bIsPostDataConnect; + private boolean m_PostingData; + private boolean m_PostingPanTiltData; + private long m_lNumFrames; + private long m_lTimerPrev; + private long m_lTimerNow; + private float m_fFrameRate; + private int m_imageUpload; + private int m_imageEmail; + private int m_iIOIn1; + private int m_iIOIn2; + private int m_iIOOut1; + private int m_iIOOut2; + private int m_iSecond; + private int m_iMinute; + private int m_iHour; + private int m_iDate; + private int m_iMonth; + private int m_iDay; + private int m_iYear; + private String m_sTimeString; + private byte m_GetImageString[]; + private byte m_baCliCmdGetRealTimeData[]; + private int HorizontalPosition; + private int VerticalPosition; + private String PositionName; + private int m_PanSingleMoveDegree; + private int m_TiltSingleMoveDegree; + private int CV_OK; + private int CV_ERROR; + private int ratio; + private int scale_method; + private int imgWidth; + private int imgHeight; + private boolean drawLine; + private int block_num; + private int block_on; + private int SoundOn; + private int test_cnt; + private boolean os_windows; + private long mute_start_time; + private BooleanControl muteControl; + private boolean turn_sound_on; + private boolean turn_sound_off; + private int post_function; + private int m_MotionFlag; + private Talkie m_trdTalkie; + private ACS_Control acsControl; + private ACS_Audio acsAudio; + private int AudioOutStatus; + private boolean m_AudioOut; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +} diff --git a/verb/binary/attemp2/fs/cpio/etc_ro/web/api/aplug/aplug.jar b/verb/binary/attemp2/fs/cpio/etc_ro/web/api/aplug/aplug.jar new file mode 100644 index 0000000..b549b47 Binary files /dev/null and b/verb/binary/attemp2/fs/cpio/etc_ro/web/api/aplug/aplug.jar differ diff --git a/verb/binary/attemp2/fs/cpio/etc_ro/web/api/aplugLiteDl/aplugLiteDL.cab b/verb/binary/attemp2/fs/cpio/etc_ro/web/api/aplugLiteDl/aplugLiteDL.cab new file mode 100644 index 0000000..362e387 Binary files /dev/null and b/verb/binary/attemp2/fs/cpio/etc_ro/web/api/aplugLiteDl/aplugLiteDL.cab differ diff --git a/verb/binary/attemp2/fs/cpio/etc_ro/web/api/aplugLiteDl/aplugLiteDL.inf b/verb/binary/attemp2/fs/cpio/etc_ro/web/api/aplugLiteDl/aplugLiteDL.inf new file mode 100644 index 0000000..ff7cae1 --- /dev/null +++ b/verb/binary/attemp2/fs/cpio/etc_ro/web/api/aplugLiteDl/aplugLiteDL.inf @@ -0,0 +1,25 @@ +[version] + signature="$CHICAGO$" + AdvancedINF=2.0 +[Add.Code] + msvcrt.dll=msvcrt.dll + mfc42.dll=mfc42.dll + olepro32.dll=olepro32.dll + aplugLiteDL.ocx=aplugLiteDL.ocx +[aplugLiteDL.ocx] + file-win32-x86=thiscab + clsid={7191F0AC-D686-46A8-BFCC-EA61778C74DD} + FileVersion=2,3,2,41 + RegisterServer=yes +[msvcrt.dll] + FileVersion=4,20,0,6164 + hook=mfc42installer +[mfc42.dll] + FileVersion=4,2,0,6256 + hook=mfc42installer +[olepro32.dll] + FileVersion=4,2,0,6068 + hook=mfc42installer +[mfc42installer] + file-win32-x86=http://activex.microsoft.com/controls/vc/mfc42.cab + run=%EXTRACT_DIR%\mfc42.exe diff --git a/verb/binary/attemp2/fs/cpio/etc_ro/web/api/aplugLiteDl/aplugLiteDL.ocx b/verb/binary/attemp2/fs/cpio/etc_ro/web/api/aplugLiteDl/aplugLiteDL.ocx new file mode 100644 index 0000000..76da528 Binary files /dev/null and b/verb/binary/attemp2/fs/cpio/etc_ro/web/api/aplugLiteDl/aplugLiteDL.ocx differ diff --git a/verb/binary/attemp2/fs/cpio/etc_ro/web/api/sounddb/META-INF/MANIFEST.MF b/verb/binary/attemp2/fs/cpio/etc_ro/web/api/sounddb/META-INF/MANIFEST.MF new file mode 100644 index 0000000..8632656 --- /dev/null +++ b/verb/binary/attemp2/fs/cpio/etc_ro/web/api/sounddb/META-INF/MANIFEST.MF @@ -0,0 +1,14 @@ +Manifest-Version: 1.0 +Application-Name: sounddb +Permissions: all-permissions +Created-By: 1.7.0_04 (Oracle Corporation) +Caller-Allowable-Codebase: * +Main-Class: sounddb +Codebase: * + +Name: sounddb.class +SHA1-Digest: 5R8mF2pBzyk5sHynPfeR1i251Lc= + +Name: sounddb$AU.class +SHA1-Digest: acxsN9J44TUSmYa1ylUKWfjJDsE= + diff --git a/verb/binary/attemp2/fs/cpio/etc_ro/web/api/sounddb/META-INF/WWW_DLIN.RSA b/verb/binary/attemp2/fs/cpio/etc_ro/web/api/sounddb/META-INF/WWW_DLIN.RSA new file mode 100644 index 0000000..5a5ffdb Binary files /dev/null and b/verb/binary/attemp2/fs/cpio/etc_ro/web/api/sounddb/META-INF/WWW_DLIN.RSA differ diff --git a/verb/binary/attemp2/fs/cpio/etc_ro/web/api/sounddb/META-INF/WWW_DLIN.SF b/verb/binary/attemp2/fs/cpio/etc_ro/web/api/sounddb/META-INF/WWW_DLIN.SF new file mode 100644 index 0000000..da1eaf3 --- /dev/null +++ b/verb/binary/attemp2/fs/cpio/etc_ro/web/api/sounddb/META-INF/WWW_DLIN.SF @@ -0,0 +1,11 @@ +Signature-Version: 1.0 +SHA1-Digest-Manifest-Main-Attributes: X2n8mlKX04cpcm8vj/5IQrf0lS8= +Created-By: 1.6.0_45 (Sun Microsystems Inc.) +SHA1-Digest-Manifest: g9+nyeyOuSAUhC6IQNp3xKUGmYU= + +Name: sounddb.class +SHA1-Digest: DXHVlhyw2rWuueIRRQ6F1jBUOdI= + +Name: sounddb$AU.class +SHA1-Digest: MsGGwNhpi46N81Zp9g5+BpdOMfA= + diff --git a/verb/binary/attemp2/fs/cpio/etc_ro/web/api/sounddb/sounddb$AU.class b/verb/binary/attemp2/fs/cpio/etc_ro/web/api/sounddb/sounddb$AU.class new file mode 100644 index 0000000..063012d Binary files /dev/null and b/verb/binary/attemp2/fs/cpio/etc_ro/web/api/sounddb/sounddb$AU.class differ diff --git a/verb/binary/attemp2/fs/cpio/etc_ro/web/api/sounddb/sounddb.class b/verb/binary/attemp2/fs/cpio/etc_ro/web/api/sounddb/sounddb.class new file mode 100644 index 0000000..92e9e6b Binary files /dev/null and b/verb/binary/attemp2/fs/cpio/etc_ro/web/api/sounddb/sounddb.class differ diff --git a/verb/binary/attemp2/fs/cpio/etc_ro/web/api/sounddb/sounddb.jad b/verb/binary/attemp2/fs/cpio/etc_ro/web/api/sounddb/sounddb.jad new file mode 100644 index 0000000..be32af1 --- /dev/null +++ b/verb/binary/attemp2/fs/cpio/etc_ro/web/api/sounddb/sounddb.jad @@ -0,0 +1,545 @@ +// Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. +// Jad home page: http://www.geocities.com/kpdus/jad.html +// Decompiler options: packimports(3) +// Source File Name: sounddb.java + +import java.applet.Applet; +import java.awt.*; +import java.io.*; +import java.net.Socket; +import java.net.URL; +import java.security.MessageDigest; +import java.util.Random; +import javax.sound.sampled.*; + +public class sounddb extends Applet + implements Runnable +{ + class AU extends Thread + { + + public void run() + { + do + { + if(!ThreadRun) + break; + try + { + if(algorithm == 0 || algorithm == 2) + sTmp = new String("GET /audio.cgi HTTP/1.0\r\nUser-Agent: user\r\nAuthorization: Basic "); + else + sTmp = new String("GET /dgaudio.cgi HTTP/1.0\r\nUser-Agent: user\r\nAuthorization: Basic "); + sTmp = sTmp.concat(m_sPassword); + sTmp = sTmp.concat("\r\n\r\n"); + m_GetSoundString = sTmp.getBytes("8859_1"); + do + { + Thread.currentThread(); + Thread.sleep(100L); + if(m_iRemotePort.intValue() == 8481 || m_iRemotePort.intValue() == 80) + m_sktSound = new Socket(m_sRemoteHost, 80); + else + m_sktSound = new Socket(m_sRemoteHost, m_iRemotePort.intValue()); + m_sktSound.setSoTimeout(30000); + m_sktSound.setKeepAlive(true); + m_soundInput = new DataInputStream(m_sktSound.getInputStream()); + m_soundOutput = new DataOutputStream(m_sktSound.getOutputStream()); + m_soundOutput.write(m_GetSoundString); + m_soundInput.read(rData, 0, 64); + String s = new String(rData, 0, 64); + if(s != null && s.indexOf("HTTP/") >= 0 && s.indexOf("200") >= 0) + break; + BufferedReader bufferedreader = new BufferedReader(new InputStreamReader(m_sktSound.getInputStream())); + do + { + String s1; + if((s1 = bufferedreader.readLine()) == null) + break; + if(s1.indexOf("WWW-Authenticate: ") < 0) + continue; + int i = s1.indexOf("realm=") + 7; + int j = s1.indexOf('"', i); + realm = s1.substring(i, j); + i = s1.indexOf("qop=") + 5; + j = s1.indexOf('"', i); + qop = s1.substring(i, j); + i = s1.indexOf("nonce=") + 7; + j = s1.indexOf('"', i); + nonce = s1.substring(i, j); + break; + } while(true); + if(algorithm == 0) + { + sTmp = new String("GET /audio.cgi HTTP/1.0\r\nUser-Agent: user\r\nAuthorization: Basic "); + sTmp = sTmp.concat(m_sPassword); + } else + if(algorithm == 1) + { + String s2 = GetDigestAuthentication("/dgaudio.cgi", realm, qop, nonce); + sTmp = new String("GET /dgaudio.cgi HTTP/1.0\r\nUser-Agent: user\r\nAuthorization: "); + sTmp = sTmp.concat(s2); + } else + { + String s3 = GetDigestAuthentication("/audio.cgi", realm, qop, nonce); + sTmp = new String("GET /audio.cgi HTTP/1.0\r\nUser-Agent: user\r\nAuthorization: "); + sTmp = sTmp.concat(s3); + } + sTmp = sTmp.concat("\r\n\r\n"); + m_GetSoundString = sTmp.getBytes("8859_1"); + m_soundInput.close(); + m_soundOutput.close(); + bufferedreader.close(); + m_sktSound.close(); + m_soundInput = null; + m_soundOutput = null; + bufferedreader = null; + m_sktSound = null; + } while(true); + nRead = 0; + boolean flag = false; + int j1; + do + { + nRead = nRead + m_soundInput.read(rData, nRead, rData.length - nRead); + j1 = 0; + do + { + if(j1 >= nRead - 7) + break; + if(rData[j1] == 13 && rData[j1 + 1] == 10 && rData[j1 + 2] == 13 && rData[j1 + 3] == 10 && rData[j1 + 4] == 82 && rData[j1 + 5] == 73 && rData[j1 + 6] == 70 && rData[j1 + 7] == 70) + { + flag = true; + j1 += 4; + break; + } + j1++; + } while(true); + Thread.currentThread(); + Thread.sleep(3L); + } while(nRead != -1 && !flag); + long l = (long)rData[j1 + 24] + ((long)rData[j1 + 25] << 8) + ((long)rData[j1 + 26] << 16) + ((long)rData[j1 + 27] << 24); + int k = rData[j1 + 22] + (rData[j1 + 23] << 8); + int i1 = rData[j1 + 34] + (rData[j1 + 35] << 8); + j1 += 44; + soundFormat = new AudioFormat(l, i1, k, true, false); + info = new javax.sound.sampled.DataLine.Info(javax/sound/sampled/SourceDataLine, soundFormat, InternalBufferSize); + line = (SourceDataLine)AudioSystem.getLine(info); + line.open(soundFormat, InternalBufferSize); + int k1 = line.getBufferSize(); + mute_start_time = System.currentTimeMillis(); + int l1 = rData[j1 + 63] << 8 + rData[j1 + 62]; + nRead = 0; + int i2 = k * 256; + retry = 0; + do + { + if(nRead == -1 || !ThreadRun) + break; + if(mute_start_time != 0L) + { + if(System.currentTimeMillis() - mute_start_time > 1000L) + { + line.start(); + mute_start_time = 0L; + } else + { + m_soundInput.read(rData, 0, rData.length); + } + Thread.currentThread(); + Thread.sleep(50L); + } else + { + Thread.currentThread(); + Thread.sleep(8L); + nRead = m_soundInput.read(rData, 0, rData.length); + if(nRead > 0 && (k1 - line.available()) / i2 < 50) + if(line.available() >= nRead) + line.write(rData, 0, nRead); + else + line.flush(); + } + } while(true); + } + catch(Exception exception) + { + System.err.println(exception); + } + try + { + line.flush(); + line.stop(); + line.close(); + line = null; + soundFormat = null; + info = null; + m_soundInput.close(); + m_soundOutput.close(); + m_sktSound.close(); + m_soundInput = null; + m_soundOutput = null; + m_sktSound = null; + } + catch(Exception exception1) + { + System.err.println(exception1); + } + } while(true); + } + + int ExternalBufferSize; + int InternalBufferSize; + SourceDataLine line; + String sTmp; + Socket m_sktSound; + DataInputStream m_soundInput; + DataOutputStream m_soundOutput; + AudioFormat soundFormat; + javax.sound.sampled.DataLine.Info info; + int nRead; + int retry; + byte rData[]; + byte m_GetSoundString[]; + String realm; + String qop; + String nonce; + final sounddb this$0; + + AU() + { + this$0 = sounddb.this; + super(); + ExternalBufferSize = 64000; + InternalBufferSize = 64000; + line = null; + sTmp = null; + m_sktSound = null; + m_soundInput = null; + m_soundOutput = null; + soundFormat = null; + info = null; + nRead = 0; + retry = 0; + rData = new byte[ExternalBufferSize]; + realm = null; + qop = null; + nonce = null; + } + } + + + public sounddb() + { + serverAddress = null; + db_val = new int[17]; + detection_level = 85; + ThreadRun = false; + algorithm = 0; + nc = 1; + mute_start_time = 0L; + } + + public void init() + { + try + { + if(getParameter("RemoteHost") != null) + { + m_sRemoteHost = getParameter("RemoteHost"); + } else + { + m_urlRemoteHost = getCodeBase(); + m_sRemoteHost = m_urlRemoteHost.getHost(); + } + m_iRemotePort = Integer.valueOf(getParameter("RemotePort")); + m_sPassword = getParameter("DeviceSerialNo"); + if(getParameter("DetectionLevel") != null) + detection_level = Integer.parseInt(getParameter("DetectionLevel")); + if(getParameter("Algorithm") != null) + algorithm = Integer.parseInt(getParameter("Algorithm")); + } + catch(Exception exception) + { + System.err.println(exception); + } + } + + public void run() + { + Thread thread = Thread.currentThread(); + for(int i = 0; i < 17; i++) + db_val[i] = 0; + + boolean flag = false; + byte abyte0[] = new byte[512]; + byte abyte1[] = new byte[512]; + Object obj = null; + Object obj1 = null; + Object obj2 = null; + Object obj3 = null; + while(ThreadRun) + try + { + String s = new String("GET /sounddb.cgi HTTP/1.0\r\nUser-Agent: user\r\nAuthorization: Basic "); + s = s.concat(m_sPassword); + s = s.concat("\r\n\r\n"); + byte abyte2[] = s.getBytes("8859_1"); + Socket socket; + if(m_iRemotePort.intValue() == 8481 || m_iRemotePort.intValue() == 80) + socket = new Socket(m_sRemoteHost, 80); + else + socket = new Socket(m_sRemoteHost, m_iRemotePort.intValue()); + socket.setSoTimeout(10000); + socket.setKeepAlive(true); + DataInputStream datainputstream = new DataInputStream(socket.getInputStream()); + DataOutputStream dataoutputstream = new DataOutputStream(socket.getOutputStream()); + dataoutputstream.write(abyte2); + int k; + while((k = datainputstream.read(abyte0, 0, 256)) >= 0) + { + if(k == 1) + { + for(int j = 16; j > 0; j--) + db_val[j] = db_val[j - 1]; + + db_val[0] = abyte0[0]; + if(db_val[0] > 100) + db_val[0] = 100; + if(db_val[0] < 0) + db_val[0] = 0; + repaint(); + } + if(db_val[0] >= detection_level) + Toolkit.getDefaultToolkit().beep(); + thread; + Thread.sleep(500L); + } + datainputstream.close(); + dataoutputstream.close(); + socket.close(); + datainputstream = null; + dataoutputstream = null; + socket = null; + } + catch(Exception exception) + { + exception.printStackTrace(); + } + finally + { + throw exception1; + } + } + + public void start() + { + ThreadRun = true; + m_trdCameraSound = new AU(); + m_trdCameraSound.start(); + m_sounddb = new Thread(this); + m_sounddb.start(); + } + + public void Stop() + { + ThreadRun = false; + } + + public void destroy() + { + ThreadRun = false; + } + + public void paint(Graphics g) + { + g.setColor(Color.black); + g.fillRect(0, 0, 576, 240); + g.setColor(Color.gray); + for(int i = 0; i < 6; i++) + g.drawLine(30, i * 40, 575, i * 40); + + g.setColor(Color.lightGray); + g.fillRect(30, 0, 2, 240); + g.fillRect(30, 238, 546, 2); + g.drawString("100", 2, 10); + g.drawString("90", 8, 45); + g.drawString("80", 8, 85); + g.drawString("70", 8, 125); + g.drawString("60", 8, 165); + g.drawString("50", 8, 205); + g.drawString("40", 8, 235); + for(int j = 0; j < 17; j++) + { + if(db_val[j] <= 40) + continue; + if(db_val[j] >= detection_level) + g.setColor(Color.magenta); + else + g.setColor(Color.blue); + g.fillRect(32 + j * 32, 240 - (db_val[j] - 40) * 4, 30, (db_val[j] - 40) * 4 - 2); + } + + g.setColor(Color.red); + if(detection_level >= 100) + g.drawLine(32, 0, 576, 0); + else + if(detection_level <= 40) + g.drawLine(32, 238, 576, 238); + else + g.drawLine(32, 240 - (detection_level - 40) * 4, 576, 240 - (detection_level - 40) * 4); + } + + public void update(Graphics g) + { + paint(g); + } + + public String CvtHex(byte abyte0[]) + { + byte abyte1[] = new byte[abyte0.length * 2]; + for(int i = 0; i < abyte0.length; i++) + { + byte byte0 = (byte)(abyte0[i] >> 4 & 0xf); + if(byte0 <= 9) + abyte1[i * 2] = (byte)(byte0 + 48); + else + abyte1[i * 2] = (byte)((byte0 + 97) - 10); + byte0 = (byte)(abyte0[i] & 0xf); + if(byte0 <= 9) + abyte1[i * 2 + 1] = (byte)(byte0 + 48); + else + abyte1[i * 2 + 1] = (byte)((byte0 + 97) - 10); + } + + return new String(abyte1); + } + + public String decode_base64(byte abyte0[], int i) + { + byte abyte1[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".getBytes(); + byte abyte2[] = new byte[4]; + int j = i % 4; + if(j != 0) + return null; + int k1 = 0; + j = 0; + int k = i / 4; + byte abyte3[] = new byte[k * 3]; + for(int l = 0; l < k; l++) + { + for(int i1 = 0; i1 < 4; i1++) + { + if(abyte0[k1] == 61) + { + abyte2[i1] = 0; + j++; + } else + { + int j1 = 0; + do + { + if(j1 >= 64) + break; + if(abyte0[k1] == abyte1[j1]) + { + abyte2[i1] = (byte)j1; + break; + } + j1++; + } while(true); + } + k1++; + } + + abyte3[l * 3] = (byte)((byte)(abyte2[0] << 2 & 0xfc) | (byte)(abyte2[1] >> 4 & 3)); + abyte3[l * 3 + 1] = (byte)((byte)(abyte2[1] << 4 & 0xf0) | (byte)(abyte2[2] >> 2 & 0xf)); + abyte3[l * 3 + 2] = (byte)((byte)(abyte2[2] << 6 & 0xc0) | abyte2[3]); + } + + return new String(abyte3); + } + + public String GetDigestAuthentication(String s, String s1, String s2, String s3) + { + String s4 = null; + String s5 = null; + String s6 = null; + String s7 = null; + String s8 = null; + String s9 = new String("GET"); + String s10 = decode_base64(m_sPassword.getBytes(), m_sPassword.length()); + s5 = s10.substring(0, s10.indexOf(':')); + if(s10.indexOf('\0') >= 0) + s6 = s10.substring(s10.indexOf(':') + 1, s10.indexOf('\0')); + else + s6 = s10.substring(s10.indexOf(':') + 1); + Random random = new Random(); + byte abyte0[] = new byte[16]; + random.nextBytes(abyte0); + s7 = CvtHex(abyte0); + s8 = String.format("%1$08X", new Object[] { + Integer.valueOf(nc) + }); + nc++; + try + { + MessageDigest messagedigest = MessageDigest.getInstance("MD5"); + messagedigest.update(s5.getBytes()); + messagedigest.update((byte)58); + messagedigest.update(s1.getBytes()); + messagedigest.update((byte)58); + messagedigest.update(s6.getBytes()); + String s12 = CvtHex(messagedigest.digest()); + messagedigest.reset(); + messagedigest.update(s9.getBytes()); + messagedigest.update((byte)58); + messagedigest.update(s.getBytes()); + String s13 = CvtHex(messagedigest.digest()); + messagedigest.reset(); + messagedigest.update(s12.getBytes()); + messagedigest.update((byte)58); + messagedigest.update(s3.getBytes()); + messagedigest.update((byte)58); + if(s2.length() > 0) + { + messagedigest.update(s8.getBytes()); + messagedigest.update((byte)58); + messagedigest.update(s7.getBytes()); + messagedigest.update((byte)58); + messagedigest.update(s2.getBytes()); + messagedigest.update((byte)58); + } + messagedigest.update(s13.getBytes()); + s4 = CvtHex(messagedigest.digest()); + } + catch(Exception exception) + { + exception.printStackTrace(); + } + String s11 = String.format("Digest username=\"%1$s\", realm=\"%2$s\", uri=\"%3$s\", algorithm=MD5, nonce=\"%4$s\", cnonce=\"%5$s\", qop=%6$s, nc=%7$s, response=\"%8$s\"", new Object[] { + s5, s1, s, s3, s7, s2, s8, s4 + }); + return s11; + } + + private Thread m_sounddb; + private String m_sRemoteHost; + private URL m_urlRemoteHost; + private Integer m_iRemotePort; + private String m_sPassword; + private URL serverAddress; + private int db_val[]; + private int detection_level; + private boolean ThreadRun; + private int algorithm; + private int nc; + private AU m_trdCameraSound; + private long mute_start_time; + + + + + + + +} diff --git a/verb/binary/attemp2/fs/cpio/etc_ro/web/api/sounddb/sounddb.jar b/verb/binary/attemp2/fs/cpio/etc_ro/web/api/sounddb/sounddb.jar new file mode 100644 index 0000000..423150a Binary files /dev/null and b/verb/binary/attemp2/fs/cpio/etc_ro/web/api/sounddb/sounddb.jar differ diff --git a/verb/binary/attemp2/fs/cpio/etc_ro/web/pack/cht b/verb/binary/attemp2/fs/cpio/etc_ro/web/pack/cht new file mode 100644 index 0000000..deab2e1 Binary files /dev/null and b/verb/binary/attemp2/fs/cpio/etc_ro/web/pack/cht differ diff --git a/verb/binary/attemp2/fs/cpio/etc_ro/web/pack/dbgulf b/verb/binary/attemp2/fs/cpio/etc_ro/web/pack/dbgulf new file mode 100644 index 0000000..1d3012c Binary files /dev/null and b/verb/binary/attemp2/fs/cpio/etc_ro/web/pack/dbgulf differ diff --git a/verb/binary/attemp2/fs/cpio/etc_ro/web/pack/eng b/verb/binary/attemp2/fs/cpio/etc_ro/web/pack/eng new file mode 100644 index 0000000..c316255 Binary files /dev/null and b/verb/binary/attemp2/fs/cpio/etc_ro/web/pack/eng differ diff --git a/verb/binary/attemp2/fs/cpio/etc_ro/web/pack/frh b/verb/binary/attemp2/fs/cpio/etc_ro/web/pack/frh new file mode 100644 index 0000000..54579cc Binary files /dev/null and b/verb/binary/attemp2/fs/cpio/etc_ro/web/pack/frh differ diff --git a/verb/binary/attemp2/fs/cpio/etc_ro/web/pack/grm b/verb/binary/attemp2/fs/cpio/etc_ro/web/pack/grm new file mode 100644 index 0000000..ff239ff Binary files /dev/null and b/verb/binary/attemp2/fs/cpio/etc_ro/web/pack/grm differ diff --git a/verb/binary/attemp2/fs/cpio/etc_ro/web/pack/itn b/verb/binary/attemp2/fs/cpio/etc_ro/web/pack/itn new file mode 100644 index 0000000..9406e7f Binary files /dev/null and b/verb/binary/attemp2/fs/cpio/etc_ro/web/pack/itn differ diff --git a/verb/binary/attemp2/fs/cpio/etc_ro/web/pack/kor b/verb/binary/attemp2/fs/cpio/etc_ro/web/pack/kor new file mode 100644 index 0000000..44319f8 Binary files /dev/null and b/verb/binary/attemp2/fs/cpio/etc_ro/web/pack/kor differ diff --git a/verb/binary/attemp2/fs/cpio/etc_ro/web/pack/sph b/verb/binary/attemp2/fs/cpio/etc_ro/web/pack/sph new file mode 100644 index 0000000..d1ae23a Binary files /dev/null and b/verb/binary/attemp2/fs/cpio/etc_ro/web/pack/sph differ diff --git a/verb/binary/attemp2/fs/cpio/etc_ro/web/pack/twn b/verb/binary/attemp2/fs/cpio/etc_ro/web/pack/twn new file mode 100644 index 0000000..78d9983 Binary files /dev/null and b/verb/binary/attemp2/fs/cpio/etc_ro/web/pack/twn differ diff --git a/verb/fs.bin/alphapd b/verb/fs.bin/alphapd new file mode 100755 index 0000000..3ce2112 Binary files /dev/null and b/verb/fs.bin/alphapd differ diff --git a/verb/fs.bin/ash b/verb/fs.bin/ash new file mode 120000 index 0000000..c3fa810 --- /dev/null +++ b/verb/fs.bin/ash @@ -0,0 +1 @@ +busybox \ No newline at end of file diff --git a/verb/fs.bin/ated b/verb/fs.bin/ated new file mode 100755 index 0000000..270b14c Binary files /dev/null and b/verb/fs.bin/ated differ diff --git a/verb/fs.bin/audiopush b/verb/fs.bin/audiopush new file mode 100755 index 0000000..2b1c851 Binary files /dev/null and b/verb/fs.bin/audiopush differ diff --git a/verb/fs.bin/busybox b/verb/fs.bin/busybox new file mode 100755 index 0000000..68b8cbd Binary files /dev/null and b/verb/fs.bin/busybox differ diff --git a/verb/fs.bin/cat b/verb/fs.bin/cat new file mode 120000 index 0000000..c3fa810 --- /dev/null +++ b/verb/fs.bin/cat @@ -0,0 +1 @@ +busybox \ No newline at end of file diff --git a/verb/fs.bin/chmod b/verb/fs.bin/chmod new file mode 120000 index 0000000..c3fa810 --- /dev/null +++ b/verb/fs.bin/chmod @@ -0,0 +1 @@ +busybox \ No newline at end of file diff --git a/verb/fs.bin/cp b/verb/fs.bin/cp new file mode 120000 index 0000000..c3fa810 --- /dev/null +++ b/verb/fs.bin/cp @@ -0,0 +1 @@ +busybox \ No newline at end of file diff --git a/verb/fs.bin/date b/verb/fs.bin/date new file mode 120000 index 0000000..c3fa810 --- /dev/null +++ b/verb/fs.bin/date @@ -0,0 +1 @@ +busybox \ No newline at end of file diff --git a/verb/fs.bin/echo b/verb/fs.bin/echo new file mode 120000 index 0000000..c3fa810 --- /dev/null +++ b/verb/fs.bin/echo @@ -0,0 +1 @@ +busybox \ No newline at end of file diff --git a/verb/fs.bin/gpio b/verb/fs.bin/gpio new file mode 100755 index 0000000..4af31ab Binary files /dev/null and b/verb/fs.bin/gpio differ diff --git a/verb/fs.bin/grep b/verb/fs.bin/grep new file mode 120000 index 0000000..c3fa810 --- /dev/null +++ b/verb/fs.bin/grep @@ -0,0 +1 @@ +busybox \ No newline at end of file diff --git a/verb/fs.bin/htmlunpack b/verb/fs.bin/htmlunpack new file mode 100755 index 0000000..d99368b Binary files /dev/null and b/verb/fs.bin/htmlunpack differ diff --git a/verb/fs.bin/i2c b/verb/fs.bin/i2c new file mode 100755 index 0000000..6a3c36d Binary files /dev/null and b/verb/fs.bin/i2c differ diff --git a/verb/fs.bin/imagetp b/verb/fs.bin/imagetp new file mode 100755 index 0000000..e5c70af Binary files /dev/null and b/verb/fs.bin/imagetp differ diff --git a/verb/fs.bin/inadyn b/verb/fs.bin/inadyn new file mode 100755 index 0000000..2a7387f Binary files /dev/null and b/verb/fs.bin/inadyn differ diff --git a/verb/fs.bin/iperf b/verb/fs.bin/iperf new file mode 100755 index 0000000..834751c Binary files /dev/null and b/verb/fs.bin/iperf differ diff --git a/verb/fs.bin/ipush b/verb/fs.bin/ipush new file mode 100755 index 0000000..0927d11 Binary files /dev/null and b/verb/fs.bin/ipush differ diff --git a/verb/fs.bin/iwpriv b/verb/fs.bin/iwpriv new file mode 100755 index 0000000..4a75c65 Binary files /dev/null and b/verb/fs.bin/iwpriv differ diff --git a/verb/fs.bin/kill b/verb/fs.bin/kill new file mode 120000 index 0000000..c3fa810 --- /dev/null +++ b/verb/fs.bin/kill @@ -0,0 +1 @@ +busybox \ No newline at end of file diff --git a/verb/fs.bin/lanconfig b/verb/fs.bin/lanconfig new file mode 100755 index 0000000..7113b24 Binary files /dev/null and b/verb/fs.bin/lanconfig differ diff --git a/verb/fs.bin/lld2d b/verb/fs.bin/lld2d new file mode 100755 index 0000000..8b528ee Binary files /dev/null and b/verb/fs.bin/lld2d differ diff --git a/verb/fs.bin/login b/verb/fs.bin/login new file mode 120000 index 0000000..c3fa810 --- /dev/null +++ b/verb/fs.bin/login @@ -0,0 +1 @@ +busybox \ No newline at end of file diff --git a/verb/fs.bin/ls b/verb/fs.bin/ls new file mode 120000 index 0000000..c3fa810 --- /dev/null +++ b/verb/fs.bin/ls @@ -0,0 +1 @@ +busybox \ No newline at end of file diff --git a/verb/fs.bin/mail b/verb/fs.bin/mail new file mode 100755 index 0000000..74c50f2 Binary files /dev/null and b/verb/fs.bin/mail differ diff --git a/verb/fs.bin/mdb b/verb/fs.bin/mdb new file mode 100755 index 0000000..4480436 Binary files /dev/null and b/verb/fs.bin/mdb differ diff --git a/verb/fs.bin/mii_mgr b/verb/fs.bin/mii_mgr new file mode 100755 index 0000000..41b2da1 Binary files /dev/null and b/verb/fs.bin/mii_mgr differ diff --git a/verb/fs.bin/mkdir b/verb/fs.bin/mkdir new file mode 120000 index 0000000..c3fa810 --- /dev/null +++ b/verb/fs.bin/mkdir @@ -0,0 +1 @@ +busybox \ No newline at end of file diff --git a/verb/fs.bin/mknod b/verb/fs.bin/mknod new file mode 120000 index 0000000..c3fa810 --- /dev/null +++ b/verb/fs.bin/mknod @@ -0,0 +1 @@ +busybox \ No newline at end of file diff --git a/verb/fs.bin/mount b/verb/fs.bin/mount new file mode 120000 index 0000000..c3fa810 --- /dev/null +++ b/verb/fs.bin/mount @@ -0,0 +1 @@ +busybox \ No newline at end of file diff --git a/verb/fs.bin/msmtp b/verb/fs.bin/msmtp new file mode 100755 index 0000000..cf9418f Binary files /dev/null and b/verb/fs.bin/msmtp differ diff --git a/verb/fs.bin/mtd_write b/verb/fs.bin/mtd_write new file mode 100755 index 0000000..e23cd6f Binary files /dev/null and b/verb/fs.bin/mtd_write differ diff --git a/verb/fs.bin/mydlinkevent b/verb/fs.bin/mydlinkevent new file mode 100755 index 0000000..e944af9 Binary files /dev/null and b/verb/fs.bin/mydlinkevent differ diff --git a/verb/fs.bin/netstat b/verb/fs.bin/netstat new file mode 120000 index 0000000..c3fa810 --- /dev/null +++ b/verb/fs.bin/netstat @@ -0,0 +1 @@ +busybox \ No newline at end of file diff --git a/verb/fs.bin/notifystream b/verb/fs.bin/notifystream new file mode 100755 index 0000000..68c2140 Binary files /dev/null and b/verb/fs.bin/notifystream differ diff --git a/verb/fs.bin/ntpclient b/verb/fs.bin/ntpclient new file mode 100755 index 0000000..35815da Binary files /dev/null and b/verb/fs.bin/ntpclient differ diff --git a/verb/fs.bin/nvram_daemon b/verb/fs.bin/nvram_daemon new file mode 100755 index 0000000..daa1a92 Binary files /dev/null and b/verb/fs.bin/nvram_daemon differ diff --git a/verb/fs.bin/nvram_get b/verb/fs.bin/nvram_get new file mode 120000 index 0000000..511ebd4 --- /dev/null +++ b/verb/fs.bin/nvram_get @@ -0,0 +1 @@ +ralink_init \ No newline at end of file diff --git a/verb/fs.bin/nvram_set b/verb/fs.bin/nvram_set new file mode 120000 index 0000000..511ebd4 --- /dev/null +++ b/verb/fs.bin/nvram_set @@ -0,0 +1 @@ +ralink_init \ No newline at end of file diff --git a/verb/fs.bin/openssl b/verb/fs.bin/openssl new file mode 100755 index 0000000..c2d5c95 Binary files /dev/null and b/verb/fs.bin/openssl differ diff --git a/verb/fs.bin/ov7740 b/verb/fs.bin/ov7740 new file mode 100755 index 0000000..a44acdc Binary files /dev/null and b/verb/fs.bin/ov7740 differ diff --git a/verb/fs.bin/pcmcmd b/verb/fs.bin/pcmcmd new file mode 100755 index 0000000..189b28a Binary files /dev/null and b/verb/fs.bin/pcmcmd differ diff --git a/verb/fs.bin/ping b/verb/fs.bin/ping new file mode 120000 index 0000000..c3fa810 --- /dev/null +++ b/verb/fs.bin/ping @@ -0,0 +1 @@ +busybox \ No newline at end of file diff --git a/verb/fs.bin/pppoecd b/verb/fs.bin/pppoecd new file mode 100755 index 0000000..3282675 Binary files /dev/null and b/verb/fs.bin/pppoecd differ diff --git a/verb/fs.bin/ps b/verb/fs.bin/ps new file mode 120000 index 0000000..c3fa810 --- /dev/null +++ b/verb/fs.bin/ps @@ -0,0 +1 @@ +busybox \ No newline at end of file diff --git a/verb/fs.bin/pwd b/verb/fs.bin/pwd new file mode 120000 index 0000000..c3fa810 --- /dev/null +++ b/verb/fs.bin/pwd @@ -0,0 +1 @@ +busybox \ No newline at end of file diff --git a/verb/fs.bin/ralink_init b/verb/fs.bin/ralink_init new file mode 100755 index 0000000..d49e6c0 Binary files /dev/null and b/verb/fs.bin/ralink_init differ diff --git a/verb/fs.bin/reg b/verb/fs.bin/reg new file mode 100755 index 0000000..1674043 Binary files /dev/null and b/verb/fs.bin/reg differ diff --git a/verb/fs.bin/rm b/verb/fs.bin/rm new file mode 120000 index 0000000..c3fa810 --- /dev/null +++ b/verb/fs.bin/rm @@ -0,0 +1 @@ +busybox \ No newline at end of file diff --git a/verb/fs.bin/schedule b/verb/fs.bin/schedule new file mode 100755 index 0000000..3f78436 Binary files /dev/null and b/verb/fs.bin/schedule differ diff --git a/verb/fs.bin/sed b/verb/fs.bin/sed new file mode 120000 index 0000000..c3fa810 --- /dev/null +++ b/verb/fs.bin/sed @@ -0,0 +1 @@ +busybox \ No newline at end of file diff --git a/verb/fs.bin/sh b/verb/fs.bin/sh new file mode 120000 index 0000000..c3fa810 --- /dev/null +++ b/verb/fs.bin/sh @@ -0,0 +1 @@ +busybox \ No newline at end of file diff --git a/verb/fs.bin/sleep b/verb/fs.bin/sleep new file mode 120000 index 0000000..c3fa810 --- /dev/null +++ b/verb/fs.bin/sleep @@ -0,0 +1 @@ +busybox \ No newline at end of file diff --git a/verb/fs.bin/sounddb b/verb/fs.bin/sounddb new file mode 100755 index 0000000..62388ff Binary files /dev/null and b/verb/fs.bin/sounddb differ diff --git a/verb/fs.bin/switch b/verb/fs.bin/switch new file mode 100755 index 0000000..926ec41 Binary files /dev/null and b/verb/fs.bin/switch differ diff --git a/verb/fs.bin/sync b/verb/fs.bin/sync new file mode 120000 index 0000000..c3fa810 --- /dev/null +++ b/verb/fs.bin/sync @@ -0,0 +1 @@ +busybox \ No newline at end of file diff --git a/verb/fs.bin/touch b/verb/fs.bin/touch new file mode 120000 index 0000000..c3fa810 --- /dev/null +++ b/verb/fs.bin/touch @@ -0,0 +1 @@ +busybox \ No newline at end of file diff --git a/verb/fs.bin/umount b/verb/fs.bin/umount new file mode 120000 index 0000000..c3fa810 --- /dev/null +++ b/verb/fs.bin/umount @@ -0,0 +1 @@ +busybox \ No newline at end of file diff --git a/verb/fs.bin/upgradefw b/verb/fs.bin/upgradefw new file mode 100755 index 0000000..25123a8 Binary files /dev/null and b/verb/fs.bin/upgradefw differ diff --git a/verb/fs.bin/uvc_stream b/verb/fs.bin/uvc_stream new file mode 100755 index 0000000..73c0092 Binary files /dev/null and b/verb/fs.bin/uvc_stream differ diff --git a/verb/fs.etc_ro.web/api/aplug.jar b/verb/fs.etc_ro.web/api/aplug.jar new file mode 100644 index 0000000..b549b47 Binary files /dev/null and b/verb/fs.etc_ro.web/api/aplug.jar differ diff --git a/verb/fs.etc_ro.web/api/aplug/META-INF/MANIFEST.MF b/verb/fs.etc_ro.web/api/aplug/META-INF/MANIFEST.MF new file mode 100644 index 0000000..b8b1b90 --- /dev/null +++ b/verb/fs.etc_ro.web/api/aplug/META-INF/MANIFEST.MF @@ -0,0 +1,29 @@ +Manifest-Version: 1.0 +Application-Name: aplug +Permissions: all-permissions +Created-By: 1.5.0_22 (Sun Microsystems Inc.) +Caller-Allowable-Codebase: * +Main-Class: aplug +Codebase: * + +Name: aplug$Talkie.class +SHA1-Digest: 2aVNEt1UmXZxsGDqKuMWyMSdJNo= + +Name: aplug$TS.class +SHA1-Digest: bcCulMO2JAF/cEyPAaq+MlpJFNY= + +Name: aplug.class +SHA1-Digest: Xq72uaqog4K4CxU+aaRTHI6lnbI= + +Name: aplug$ACS_Control.class +SHA1-Digest: dlTPvwzdBrmN8uHUeUeyV2wKXG0= + +Name: aplug$SI.class +SHA1-Digest: Cf2RT0iFdv2VDDI+DznPMBWi63w= + +Name: aplug$ACS_Audio.class +SHA1-Digest: 0MVKIbdmw41F2CP3X8wlN1o3H0g= + +Name: aplug$AU.class +SHA1-Digest: 6BD9xeWhsDRn6sJ4roR85fvIW3c= + diff --git a/verb/fs.etc_ro.web/api/aplug/META-INF/WWW_DLIN.RSA b/verb/fs.etc_ro.web/api/aplug/META-INF/WWW_DLIN.RSA new file mode 100644 index 0000000..12e9e75 Binary files /dev/null and b/verb/fs.etc_ro.web/api/aplug/META-INF/WWW_DLIN.RSA differ diff --git a/verb/fs.etc_ro.web/api/aplug/META-INF/WWW_DLIN.SF b/verb/fs.etc_ro.web/api/aplug/META-INF/WWW_DLIN.SF new file mode 100644 index 0000000..ba463e6 --- /dev/null +++ b/verb/fs.etc_ro.web/api/aplug/META-INF/WWW_DLIN.SF @@ -0,0 +1,26 @@ +Signature-Version: 1.0 +SHA1-Digest-Manifest-Main-Attributes: UBp7e9hhiW9jTs0aB5k+hWchTpw= +Created-By: 1.6.0_45 (Sun Microsystems Inc.) +SHA1-Digest-Manifest: 1oXVrSmx4HV21apD+8+2AR+RNNI= + +Name: aplug$Talkie.class +SHA1-Digest: EP5wpvCzDUkUzp+/p3+ukV+t+/M= + +Name: aplug$TS.class +SHA1-Digest: KOmQFfuWyt6wZAkJN2gZuXsjQYA= + +Name: aplug.class +SHA1-Digest: 6zuZlxCL+jRUigu/O+yhygmQEMM= + +Name: aplug$ACS_Control.class +SHA1-Digest: G3Cxz5qKFceS3FaAhkrlV+AV3dc= + +Name: aplug$SI.class +SHA1-Digest: 6UqL3yyydR4/ynbgZGVoq2I01fk= + +Name: aplug$ACS_Audio.class +SHA1-Digest: i1cFnbJWe0uE5vHT4vrjCPvYLJ0= + +Name: aplug$AU.class +SHA1-Digest: wYFYPf9xYN37zWkEJ/+DHdoILRo= + diff --git a/verb/fs.etc_ro.web/api/aplug/aplug$ACS_Audio.class b/verb/fs.etc_ro.web/api/aplug/aplug$ACS_Audio.class new file mode 100644 index 0000000..0807447 Binary files /dev/null and b/verb/fs.etc_ro.web/api/aplug/aplug$ACS_Audio.class differ diff --git a/verb/fs.etc_ro.web/api/aplug/aplug$ACS_Control.class b/verb/fs.etc_ro.web/api/aplug/aplug$ACS_Control.class new file mode 100644 index 0000000..6df2312 Binary files /dev/null and b/verb/fs.etc_ro.web/api/aplug/aplug$ACS_Control.class differ diff --git a/verb/fs.etc_ro.web/api/aplug/aplug$AU.class b/verb/fs.etc_ro.web/api/aplug/aplug$AU.class new file mode 100644 index 0000000..7abb6f8 Binary files /dev/null and b/verb/fs.etc_ro.web/api/aplug/aplug$AU.class differ diff --git a/verb/fs.etc_ro.web/api/aplug/aplug$SI.class b/verb/fs.etc_ro.web/api/aplug/aplug$SI.class new file mode 100644 index 0000000..a13d0d6 Binary files /dev/null and b/verb/fs.etc_ro.web/api/aplug/aplug$SI.class differ diff --git a/verb/fs.etc_ro.web/api/aplug/aplug$TS.class b/verb/fs.etc_ro.web/api/aplug/aplug$TS.class new file mode 100644 index 0000000..9856259 Binary files /dev/null and b/verb/fs.etc_ro.web/api/aplug/aplug$TS.class differ diff --git a/verb/fs.etc_ro.web/api/aplug/aplug$Talkie.class b/verb/fs.etc_ro.web/api/aplug/aplug$Talkie.class new file mode 100644 index 0000000..9004ff2 Binary files /dev/null and b/verb/fs.etc_ro.web/api/aplug/aplug$Talkie.class differ diff --git a/verb/fs.etc_ro.web/api/aplug/aplug.class b/verb/fs.etc_ro.web/api/aplug/aplug.class new file mode 100644 index 0000000..ad79477 Binary files /dev/null and b/verb/fs.etc_ro.web/api/aplug/aplug.class differ diff --git a/verb/fs.etc_ro.web/api/aplug/aplug.jad b/verb/fs.etc_ro.web/api/aplug/aplug.jad new file mode 100644 index 0000000..75c18d2 --- /dev/null +++ b/verb/fs.etc_ro.web/api/aplug/aplug.jad @@ -0,0 +1,2409 @@ +// Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. +// Jad home page: http://www.geocities.com/kpdus/jad.html +// Decompiler options: packimports(3) +// Source File Name: aplug.java + +import java.applet.Applet; +import java.awt.*; +import java.awt.event.MouseEvent; +import java.awt.event.MouseListener; +import java.awt.image.MemoryImageSource; +import java.awt.image.PixelGrabber; +import java.io.*; +import java.net.Socket; +import java.net.URL; +import java.nio.ByteBuffer; +import java.nio.ByteOrder; +import java.security.MessageDigest; +import java.util.Date; +import java.util.Random; +import javax.sound.sampled.*; + +public class aplug extends Applet + implements Runnable, MouseListener +{ + class ACS_Audio + { + + void prepare_audio_header(int i) + { + Date date = new Date(); + long l = date.getTime(); + SequenceNumber++; + DataLength = i; + TimeSec = (int)(l / 1000L); + TimeUSec = (int)((l % 1000L) * 1000L); + rec.putInt(0, HdrID); + rec.putInt(4, HdrLength); + rec.putInt(8, DataLength); + rec.putInt(12, SequenceNumber); + rec.putInt(16, TimeSec); + rec.putInt(20, TimeUSec); + rec.putInt(24, DataCheckSum); + rec.putShort(28, Format); + rec.putShort(30, Channels); + rec.putShort(32, SampleRate); + rec.putShort(34, SampleBits); + rec.putInt(36, Reserved); + } + + int HdrID; + int HdrLength; + int DataLength; + int SequenceNumber; + int TimeSec; + int TimeUSec; + int DataCheckSum; + short Format; + short Channels; + short SampleRate; + short SampleBits; + int Reserved; + byte buf[]; + ByteBuffer rec; + final aplug this$0; + + ACS_Audio() + { + this$0 = aplug.this; + super(); + HdrID = 0xf6010000; + HdrLength = 40; + DataLength = 1024; + SequenceNumber = 0; + TimeSec = 0; + TimeUSec = 0; + DataCheckSum = 0; + Format = 16; + Channels = 1; + SampleRate = -21436; + SampleBits = 16; + Reserved = 0; + buf = new byte[1064]; + rec = ByteBuffer.wrap(buf).order(ByteOrder.LITTLE_ENDIAN); + } + } + + class ACS_Control + { + + void prepare_control_header(int i) + { + Date date = new Date(); + long l = date.getTime(); + SequenceNumber++; + ControlCode = DataCheckSum = i; + TimeSec = (int)(l / 1000L); + TimeUSec = (int)((l % 1000L) * 1000L); + rec.putInt(0, HdrID); + rec.putInt(4, HdrLength); + rec.putInt(8, DataLength); + rec.putInt(12, SequenceNumber); + rec.putInt(16, TimeSec); + rec.putInt(20, TimeUSec); + rec.putInt(24, DataCheckSum); + rec.putInt(28, ControlCode); + } + + int HdrID; + int HdrLength; + int DataLength; + int SequenceNumber; + int TimeSec; + int TimeUSec; + int DataCheckSum; + int ControlCode; + byte buf[]; + ByteBuffer rec; + final aplug this$0; + + ACS_Control() + { + this$0 = aplug.this; + super(); + HdrID = 0xf7010000; + HdrLength = 32; + DataLength = 4; + SequenceNumber = 0; + TimeSec = 0; + TimeUSec = 0; + DataCheckSum = 0; + ControlCode = 0; + buf = new byte[32]; + rec = ByteBuffer.wrap(buf).order(ByteOrder.LITTLE_ENDIAN); + } + } + + class Talkie extends Thread + { + + public TargetDataLine GetTDLFromAF(AudioFormat audioformat) + throws OutOfMemoryError + { + Object obj = null; + javax.sound.sampled.DataLine.Info info; + info = new javax.sound.sampled.DataLine.Info(javax/sound/sampled/TargetDataLine, audioformat); + if(AudioSystem.isLineSupported(info)) + break MISSING_BLOCK_LABEL_60; + System.out.println((new StringBuilder()).append("GetTDLFromAF: AudioSystem.isLineSupported(").append(info).append(") = ").append(AudioSystem.isLineSupported(info)).toString()); + return null; + TargetDataLine targetdataline; + try + { + targetdataline = (TargetDataLine)AudioSystem.getLine(info); + if(targetdataline != null) + targetdataline.open(audioformat); + else + System.out.println("GetTDLFromAF: Can not get target data line!"); + } + catch(LineUnavailableException lineunavailableexception) + { + System.out.println((new StringBuilder()).append("GetTDLFromAF: ").append(lineunavailableexception).toString()); + lineunavailableexception.printStackTrace(); + return null; + } + return targetdataline; + } + + public AudioInputStream GetSourceAIS(TargetDataLine targetdataline) + throws OutOfMemoryError + { + Object obj = null; + if(targetdataline == null) + { + return null; + } else + { + AudioInputStream audioinputstream = new AudioInputStream(targetdataline); + return audioinputstream; + } + } + + public int GetAuthentication() + { + Object obj = null; + Object obj1 = null; + Object obj2 = null; + Object obj3 = null; + boolean flag = false; + byte abyte0[] = new byte[1500]; + boolean flag1 = false; + Object obj4 = null; + int i = 0; + try + { + String s = new String("POST /dev2/dgtalkie.cgi HTTP/1.0\r\nContent-length: 0\r\nUser-Agent: user\r\nAuthorization: Basic "); + s = s.concat(m_sPassword); + s = s.concat("\r\n\r\n"); + byte abyte1[] = s.getBytes("8859_1"); + Socket socket; + if(m_iRemotePort.intValue() == 8481 || m_iRemotePort.intValue() == 80) + socket = new Socket(m_sRemoteHost, 80); + else + socket = new Socket(m_sRemoteHost, m_iRemotePort.intValue()); + socket.setSoTimeout(30000); + socket.setKeepAlive(true); + DataInputStream datainputstream = new DataInputStream(socket.getInputStream()); + DataOutputStream dataoutputstream = new DataOutputStream(socket.getOutputStream()); + dataoutputstream.write(abyte1); + BufferedReader bufferedreader = new BufferedReader(new InputStreamReader(socket.getInputStream())); + String s1 = bufferedreader.readLine(); + if(s1 != null && s1.indexOf("HTTP/") >= 0) + if(s1.indexOf("200") >= 0) + i = 0; + else + i = 1; + do + { + String s2; + if((s2 = bufferedreader.readLine()) == null) + break; + if(s2.indexOf("WWW-Authenticate: ") < 0) + continue; + int j = s2.indexOf("realm=") + 7; + int k = s2.indexOf('"', j); + realm = s2.substring(j, k); + j = s2.indexOf("qop=") + 5; + k = s2.indexOf('"', j); + qop = s2.substring(j, k); + j = s2.indexOf("nonce=") + 7; + k = s2.indexOf('"', j); + nonce = s2.substring(j, k); + break; + } while(true); + datainputstream.close(); + dataoutputstream.close(); + bufferedreader.close(); + socket.close(); + datainputstream = null; + dataoutputstream = null; + bufferedreader = null; + socket = null; + } + catch(Exception exception) + { + System.err.println(exception); + i = -1; + } + return i; + } + + public void run() + { + Socket socket; + DataInputStream datainputstream; + DataOutputStream dataoutputstream; + byte abyte0[]; + TargetDataLine targetdataline; + AudioInputStream audioinputstream; + Object obj = null; + socket = null; + datainputstream = null; + dataoutputstream = null; + boolean flag = false; + abyte0 = new byte[1500]; + boolean flag1 = false; + Object obj1 = null; + Object obj3 = null; + Object obj5 = null; + targetdataline = null; + audioinputstream = null; + Object obj6 = null; + if(drawLine) + return; +_L2: + if(!m_bImageThreadRun) + break; /* Loop/switch isn't completed */ + if(!m_AudioOut) + { + Thread.currentThread(); + Thread.sleep(200L); + continue; /* Loop/switch isn't completed */ + } + int j = GetAuthentication(); + if(j < 0) + { + StopAudioOut(); + continue; /* Loop/switch isn't completed */ + } + try + { + String s = new String("POST /dev2/dgtalkie.cgi HTTP/1.0\r\nContent-type: audio/x-wave\r\nContent-length: "); + s = s.concat(Integer.toString(0x77359400, 10)); + s = s.concat("\r\nUser-Agent: user\r\nAuthorization: "); + if(j == 1) + { + String s1 = GetDigestAuthentication("POST", "/dev2/dgtalkie.cgi", realm, qop, nonce); + s = s.concat(s1); + } else + { + s = s.concat("Basic "); + s = s.concat(m_sPassword); + } + s = s.concat("\r\n\r\n"); + byte abyte1[] = s.getBytes("8859_1"); + if(m_iRemotePort.intValue() == 8481 || m_iRemotePort.intValue() == 80) + socket = new Socket(m_sRemoteHost, 80); + else + socket = new Socket(m_sRemoteHost, m_iRemotePort.intValue()); + socket.setSoTimeout(30000); + socket.setKeepAlive(true); + datainputstream = new DataInputStream(socket.getInputStream()); + dataoutputstream = new DataOutputStream(socket.getOutputStream()); + dataoutputstream.write(abyte1); + AudioOutStatus = 1; + acsControl.prepare_control_header(1); + dataoutputstream.write(acsControl.buf, 0, acsControl.buf.length); + dataoutputstream.flush(); + acsControl.prepare_control_header(2); + dataoutputstream.write(acsControl.buf, 0, acsControl.buf.length); + dataoutputstream.flush(); + acsControl.prepare_control_header(4); + dataoutputstream.write(acsControl.buf, 0, acsControl.buf.length); + dataoutputstream.flush(); + AudioFormat audioformat = new AudioFormat(16000F, 16, 1, true, false); + if((targetdataline = GetTDLFromAF(audioformat)) == null) + System.out.println("ReadMicrophoneToIPCam: Can't get Target DataLine."); + else + if((audioinputstream = GetSourceAIS(targetdataline)) == null) + System.out.println("ReadMicrophoneToIPCam: Can't get Source Input Stream."); + if(targetdataline == null || audioinputstream == null) + { + if(targetdataline != null) + targetdataline.close(); + if(audioinputstream != null) + audioinputstream.close(); + m_AudioOut = false; + AudioOutStatus = -3; + throw new Exception("Can't get microphone device."); + } + targetdataline.start(); + int i = 0; + do + { + if(i == -1 || !m_AudioOut) + break; + Thread.currentThread(); + Thread.sleep(10L); + if(audioinputstream.available() >= 1024) + { + acsAudio.prepare_audio_header(1024); + i = audioinputstream.read(acsAudio.buf, acsAudio.HdrLength, 1024); + if(i == 1024) + dataoutputstream.write(acsAudio.buf, 0, acsAudio.buf.length); + } + } while(true); + if(m_AudioOut) + StopAudioOut(); + AudioOutStatus = 0; + acsControl.prepare_control_header(5); + dataoutputstream.write(acsControl.buf, 0, acsControl.buf.length); + acsControl.prepare_control_header(3); + dataoutputstream.write(acsControl.buf, 0, acsControl.buf.length); + acsControl.prepare_control_header(6); + dataoutputstream.write(acsControl.buf, 0, acsControl.buf.length); + datainputstream.read(abyte0, 0, 64); + } + catch(Exception exception) + { + exception.printStackTrace(); + m_AudioOut = false; + mute_start_time = System.currentTimeMillis(); + if(AudioOutStatus >= 0) + AudioOutStatus = -4; + } + try + { + audioinputstream.close(); + targetdataline.close(); + Object obj2 = null; + Object obj4 = null; + datainputstream.close(); + dataoutputstream.close(); + socket.close(); + datainputstream = null; + dataoutputstream = null; + socket = null; + } + catch(Exception exception1) + { + exception1.printStackTrace(); + m_AudioOut = false; + } + if(true) goto _L2; else goto _L1 +_L1: + } + + String realm; + String qop; + String nonce; + final aplug this$0; + + Talkie() + { + this$0 = aplug.this; + super(); + realm = null; + qop = null; + nonce = null; + } + } + + class AU extends Thread + { + + public void run() + { + if(drawLine) + return; + do + { + if(!m_bImageThreadRun) + break; + try + { + if(algorithm == 0 || algorithm == 2) + sTmp = new String("GET /audio.cgi HTTP/1.0\r\nUser-Agent: user\r\nAuthorization: Basic "); + else + sTmp = new String("GET /dgaudio.cgi HTTP/1.0\r\nUser-Agent: user\r\nAuthorization: Basic "); + sTmp = sTmp.concat(m_sPassword); + sTmp = sTmp.concat("\r\n\r\n"); + m_GetSoundString = sTmp.getBytes("8859_1"); + do + { + Thread.currentThread(); + Thread.sleep(100L); + if(m_iRemotePort.intValue() == 8481 || m_iRemotePort.intValue() == 80) + m_sktSound = new Socket(m_sRemoteHost, 80); + else + m_sktSound = new Socket(m_sRemoteHost, m_iRemotePort.intValue()); + m_sktSound.setSoTimeout(30000); + m_sktSound.setKeepAlive(true); + m_soundInput = new DataInputStream(m_sktSound.getInputStream()); + m_soundOutput = new DataOutputStream(m_sktSound.getOutputStream()); + m_soundOutput.write(m_GetSoundString); + m_soundInput.read(rData, 0, 64); + String s = new String(rData, 0, 64); + if(s != null && s.indexOf("HTTP/") >= 0) + { + if(s.indexOf("200") >= 0) + break; + if(s.indexOf("501") >= 0) + delay_try = true; + } + BufferedReader bufferedreader = new BufferedReader(new InputStreamReader(m_sktSound.getInputStream())); + do + { + String s1; + if((s1 = bufferedreader.readLine()) == null) + break; + if(s1.indexOf("WWW-Authenticate: ") < 0) + continue; + int i = s1.indexOf("realm=") + 7; + int j = s1.indexOf('"', i); + realm = s1.substring(i, j); + i = s1.indexOf("qop=") + 5; + j = s1.indexOf('"', i); + qop = s1.substring(i, j); + i = s1.indexOf("nonce=") + 7; + j = s1.indexOf('"', i); + nonce = s1.substring(i, j); + break; + } while(true); + if(algorithm == 0) + { + sTmp = new String("GET /audio.cgi HTTP/1.0\r\nUser-Agent: user\r\nAuthorization: Basic "); + sTmp = sTmp.concat(m_sPassword); + } else + if(algorithm == 1) + { + String s2 = GetDigestAuthentication("GET", "/dgaudio.cgi", realm, qop, nonce); + sTmp = new String("GET /dgaudio.cgi HTTP/1.0\r\nUser-Agent: user\r\nAuthorization: "); + sTmp = sTmp.concat(s2); + } else + { + String s3 = GetDigestAuthentication("GET", "/audio.cgi", realm, qop, nonce); + sTmp = new String("GET /audio.cgi HTTP/1.0\r\nUser-Agent: user\r\nAuthorization: "); + sTmp = sTmp.concat(s3); + } + sTmp = sTmp.concat("\r\n\r\n"); + m_GetSoundString = sTmp.getBytes("8859_1"); + m_soundInput.close(); + m_soundOutput.close(); + bufferedreader.close(); + m_sktSound.close(); + m_soundInput = null; + m_soundOutput = null; + bufferedreader = null; + m_sktSound = null; + if(delay_try) + { + Thread.currentThread(); + Thread.sleep(10000L); + } + delay_try = false; + } while(true); + nRead = 0; + boolean flag = false; + int j1; + do + { + nRead = nRead + m_soundInput.read(rData, nRead, rData.length - nRead); + j1 = 0; + do + { + if(j1 >= nRead - 7) + break; + if(rData[j1] == 13 && rData[j1 + 1] == 10 && rData[j1 + 2] == 13 && rData[j1 + 3] == 10 && rData[j1 + 4] == 82 && rData[j1 + 5] == 73 && rData[j1 + 6] == 70 && rData[j1 + 7] == 70) + { + flag = true; + j1 += 4; + break; + } + j1++; + } while(true); + Thread.currentThread(); + Thread.sleep(3L); + } while(nRead != -1 && !flag); + long l = (long)rData[j1 + 27] << 24 & 0xffffffffff000000L | (long)rData[j1 + 26] << 16 & 0xff0000L | (long)rData[j1 + 25] << 8 & 65280L | (long)rData[j1 + 24] & 255L; + int k = rData[j1 + 22] + (rData[j1 + 23] << 8); + int i1 = rData[j1 + 34] + (rData[j1 + 35] << 8); + j1 += 44; + soundFormat = new AudioFormat(l, i1, k, true, false); + info = new javax.sound.sampled.DataLine.Info(javax/sound/sampled/SourceDataLine, soundFormat, InternalBufferSize); + line = (SourceDataLine)AudioSystem.getLine(info); + line.open(soundFormat, InternalBufferSize); + int k1 = line.getBufferSize(); + muteControl = (BooleanControl)line.getControl(javax.sound.sampled.BooleanControl.Type.MUTE); + mute_start_time = System.currentTimeMillis(); + int l1 = rData[j1 + 63] << 8 + rData[j1 + 62]; + nRead = 0; + int k2 = k * 256; + retry = 0; + do + { + if(nRead == -1 || !m_bImageThreadRun) + break; + if(mute_start_time != 0L) + if(System.currentTimeMillis() - mute_start_time >= 1000L) + { + line.start(); + mute_start_time = 0L; + turn_sound_on = true; + } else + { + m_soundInput.read(rData, 0, rData.length); + } + if(SoundOn == 0 || m_AudioOut && m_TwoWay == 0) + { + if(turn_sound_off) + { + turn_sound_off = false; + line.stop(); + } + Thread.currentThread(); + Thread.sleep(30L); + m_soundInput.read(rData, 0, rData.length); + } else + { + Thread.currentThread(); + Thread.sleep(8L); + nRead = m_soundInput.read(rData, 0, rData.length); + if(turn_sound_on && nRead >= 64) + { + turn_sound_on = false; + line.flush(); + for(int j2 = 0; j2 < 32; j2++) + { + int i2 = (l1 / 32) * j2; + rData[j2 * 2] = (byte)(i2 & 0xff); + rData[j2 * 2 + 1] = (byte)(i2 >> 8 & 0xff); + } + + } + if(nRead > 0 && (k1 - line.available()) / k2 < 50) + if(line.available() >= nRead) + line.write(rData, 0, nRead); + else + line.flush(); + } + } while(true); + } + catch(Exception exception) + { + exception.printStackTrace(); + } + try + { + line.flush(); + line.stop(); + line.close(); + line = null; + soundFormat = null; + info = null; + m_soundInput.close(); + m_soundOutput.close(); + m_sktSound.close(); + m_soundInput = null; + m_soundOutput = null; + m_sktSound = null; + } + catch(Exception exception1) + { + System.err.println(exception1); + } + } while(true); + } + + int ExternalBufferSize; + int InternalBufferSize; + SourceDataLine line; + String sTmp; + Socket m_sktSound; + DataInputStream m_soundInput; + DataOutputStream m_soundOutput; + AudioFormat soundFormat; + javax.sound.sampled.DataLine.Info info; + int nRead; + int retry; + byte rData[]; + byte m_GetSoundString[]; + String realm; + String qop; + String nonce; + boolean delay_try; + final aplug this$0; + + AU() + { + this$0 = aplug.this; + super(); + ExternalBufferSize = 64000; + InternalBufferSize = 64000; + line = null; + sTmp = null; + m_sktSound = null; + m_soundInput = null; + m_soundOutput = null; + soundFormat = null; + info = null; + nRead = 0; + retry = 0; + rData = new byte[ExternalBufferSize]; + realm = null; + qop = null; + nonce = null; + delay_try = false; + } + } + + class TS extends Thread + { + + public void run() + { + while(m_bImageThreadRun) + { + if(m_bIsPostDataConnect) + PostData(); + try + { + Thread.currentThread(); + Thread.sleep(30L); + } + catch(Exception exception) { } + } + } + + public void PostData() + { + byte abyte1[] = new byte[512]; + String s = new String(""); + String s2 = new String(""); + String s4 = new String(""); + String s5 = new String(""); + boolean flag = false; + boolean flag1 = false; + String s6 = null; + String s7 = null; + String s8 = null; + BufferedReader bufferedreader = null; + try + { + switch(post_function) + { + case 1: // '\001' + s4 = s4.concat("POST /iocontrol.cgi HTTP/1.0\r\n"); + s2 = new String("/iocontrol.cgi"); + break; + + case 2: // '\002' + s4 = s4.concat("POST /pantiltcontrol.cgi HTTP/1.0\r\n"); + s2 = new String("/pantiltcontrol.cgi"); + break; + + case 3: // '\003' + s4 = s4.concat("POST /audiocontrol.cgi HTTP/1.0\r\n"); + s2 = new String("/audiocontrol.cgi"); + break; + + case 4: // '\004' + s4 = s4.concat("POST /motion.cgi HTTP/1.0\r\n"); + s2 = new String("/motion.cgi"); + break; + } + s4 = s4.concat("Content-length: "); + String s3 = Integer.toString(m_postdata.length(), 10); + s4 = s4.concat(s3); + s4 = s4.concat("\r\n"); + do + { + if(m_iRemotePort.intValue() == 8481 || m_iRemotePort.intValue() == 80) + m_sktPostData = new Socket(m_sRemoteHost, 80); + else + m_sktPostData = new Socket(m_sRemoteHost, m_iRemotePort.intValue()); + m_sktPostData.setSoTimeout(m_iTimeout.intValue()); + m_PostDataInput = new DataInputStream(m_sktPostData.getInputStream()); + m_PostDataOutput = new DataOutputStream(m_sktPostData.getOutputStream()); + String s1 = s4; + if(flag) + { + s1 = s1.concat("User-Agent: user\r\nAuthorization: "); + s1 = s1.concat(s5); + } else + { + s1 = s1.concat("User-Agent: user\r\nAuthorization: Basic "); + s1 = s1.concat(m_sPassword); + } + s1 = s1.concat("\r\n\r\n"); + s1 = s1.concat(m_postdata); + byte abyte0[] = s1.getBytes("8859_1"); + m_PostDataOutput.write(abyte0); + Thread.currentThread(); + Thread.sleep(30L); + bufferedreader = new BufferedReader(new InputStreamReader(m_sktPostData.getInputStream())); + String s9 = bufferedreader.readLine(); + if(s9 != null && s9.indexOf("HTTP/") >= 0 && s9.indexOf("401") == -1 || flag1) + break; + do + { + String s10; + if((s10 = bufferedreader.readLine()) == null) + break; + if(s10.indexOf("WWW-Authenticate: ") < 0) + continue; + int i = s10.indexOf("realm=") + 7; + int j = s10.indexOf('"', i); + s6 = s10.substring(i, j); + i = s10.indexOf("qop=") + 5; + j = s10.indexOf('"', i); + s7 = s10.substring(i, j); + i = s10.indexOf("nonce=") + 7; + j = s10.indexOf('"', i); + s8 = s10.substring(i, j); + break; + } while(true); + flag1 = true; + if(algorithm > 0) + { + s5 = GetDigestAuthentication("POST", s2, s6, s7, s8); + flag = true; + } + m_PostDataInput.close(); + m_PostDataOutput.close(); + bufferedreader.close(); + m_sktPostData.close(); + m_PostDataInput = null; + m_PostDataOutput = null; + bufferedreader = null; + m_sktPostData = null; + } while(true); + } + catch(Exception exception) + { + System.err.println(exception); + m_bIsPostDataConnect = false; + m_PostingData = false; + m_PostingPanTiltData = false; + return; + } + m_PostingData = false; + try + { + m_PostDataInput.close(); + m_PostDataOutput.close(); + bufferedreader.close(); + m_sktPostData.close(); + Object obj = null; + m_PostDataInput = null; + m_PostDataOutput = null; + bufferedreader = null; + m_sktPostData = null; + } + catch(Exception exception1) + { + System.err.println(exception1); + } + if(!m_PostingData && !m_PostingPanTiltData) + m_bIsPostDataConnect = false; + } + + final aplug this$0; + + TS() + { + this$0 = aplug.this; + super(); + } + } + + class SI extends Thread + { + + public boolean CreateBlockImage() + { + int i = imgHeight; + int j = imgWidth; + int ai[] = new int[j * i]; + int k = j / block_num; + int l = i / block_num; + boolean flag = false; + PixelGrabber pixelgrabber; + if(j != m_imgCamera.getWidth(null)) + { + Image image = m_imgCamera.getScaledInstance(j, i, 1); + pixelgrabber = new PixelGrabber(image, 0, 0, j, i, ai, 0, j); + } else + { + pixelgrabber = new PixelGrabber(m_imgCamera, 0, 0, j, i, ai, 0, j); + } + try + { + pixelgrabber.grabPixels(); + } + catch(InterruptedException interruptedexception) + { + m_imgProcess = null; + return false; + } +label0: + for(int k2 = 0; k2 < i; k2++) + { + if(k2 > 0 && k2 % l == 0) + { + if(!flag) + { + for(int i1 = 0; i1 < j * 2; i1++) + ai[j * k2 + i1] = ai[j * k2 + i1] & 0xff000000 | 0xff; + + continue; + } + for(int j1 = 0; j1 < j * 4; j1++) + ai[j * (k2 - 2) + j1] = ai[j * (k2 - 2) + j1] & 0xff000000 | 0xff; + + continue; + } + int k1 = 1; + do + { + if(k1 >= block_num) + continue label0; + if(flag) + { + ai[(j * k2 + k * k1) - 2] = ai[(j * k2 + k * k1) - 2] & 0xff000000 | 0xff; + ai[(j * k2 + k * k1) - 1] = ai[(j * k2 + k * k1) - 1] & 0xff000000 | 0xff; + } + ai[j * k2 + k * k1] = ai[j * k2 + k * k1] & 0xff000000 | 0xff; + ai[j * k2 + k * k1 + 1] = ai[j * k2 + k * k1 + 1] & 0xff000000 | 0xff; + k1++; + } while(true); + } + + for(int i4 = 0; i4 < block_num * block_num; i4++) + { + if((block_on >> i4 & 1) == 0) + continue; + byte byte0 = 8; + int i3 = (i4 % block_num) * k; + int j3 = i3 + k; + int k3 = (i4 / block_num) * l; + int l3 = k3 + l; + if(flag) + byte0 = 16; + for(int l2 = k3; l2 < l3; l2++) + { + if(l2 > k3 && l2 % byte0 == 0) + { + for(int l1 = i3; l1 < j3; l1++) + ai[j * l2 + l1] = ai[j * l2 + l1] & 0xff000000 | 0xff; + + if(!flag) + continue; + for(int i2 = i3; i2 < j3; i2++) + ai[j * (l2 + 1) + i2] = ai[j * (l2 + 1) + i2] & 0xff000000 | 0xff; + + continue; + } + for(int j2 = i3 + byte0; j2 < j3; j2 += byte0) + { + ai[j * l2 + j2] = ai[j * l2 + j2] & 0xff000000 | 0xff; + if(flag) + ai[j * l2 + j2 + 1] = ai[j * l2 + j2 + 1] & 0xff000000 | 0xff; + } + + } + + } + + m_imgProcess = createImage(new MemoryImageSource(j, i, ai, 0, j)); + ai = null; + pixelgrabber = null; + return m_imgProcess != null; + } + + public boolean CreateNewImage() + { + int i = m_imgCamera.getHeight(null); + int j = m_imgCamera.getWidth(null); + int ai[] = new int[j * i]; + int k = j / block_num; + int l = i / block_num; + PixelGrabber pixelgrabber = new PixelGrabber(m_imgCamera, 0, 0, j, i, ai, 0, j); + try + { + pixelgrabber.grabPixels(); + } + catch(InterruptedException interruptedexception) + { + m_imgProcess = null; + return false; + } + m_imgProcess = createImage(new MemoryImageSource(j, i, ai, 0, j)); + ai = null; + pixelgrabber = null; + return m_imgProcess != null; + } + + public void run() + { + int i = 100; + Thread thread = Thread.currentThread(); + thread.setPriority(10); + String s = System.getProperty("os.name"); + if(s.indexOf("Windows") >= 0) + { + os_windows = true; + } else + { + os_windows = false; + i = 100; + } +label0: + do + try + { +label1: + { + if(!m_bImageThreadRun) + break label0; + if(!BufferReady) + break label1; + m_imgCamera = null; + m_imgProcess = null; + long l = System.currentTimeMillis(); + m_imgCamera = Toolkit.getDefaultToolkit().createImage(imgbuf, 0, iLength); + m_lNumFrames = m_lNumFrames + 1L; + if(m_imgCamera != null) + { + while(!Toolkit.getDefaultToolkit().prepareImage(m_imgCamera, m_imgCamera.getWidth(null), m_imgCamera.getHeight(null), null)) + { + Thread _tmp = thread; + Thread.sleep(1L); + if(System.currentTimeMillis() - l > (long)i) + { + BufferReady = false; + break label1; + } + } + if(m_imgCamera != null) + { + if(drawLine) + { + if(!CreateBlockImage()) + { + BufferReady = false; + break label1; + } + } else + if(!os_windows && !CreateNewImage()) + { + BufferReady = false; + break label1; + } + Thread _tmp1 = thread; + Thread.sleep(3L); + repaint(); + } + } + BufferReady = false; + } + Thread _tmp2 = thread; + Thread.sleep(2L); + continue; + } + catch(Exception exception) + { + break; + } + while(true); + } + + final aplug this$0; + + SI() + { + this$0 = aplug.this; + super(); + } + } + + + public aplug() + { + MAX_BUFFER_SIZE = 0x400000; + sub_idx = new int[8]; + sub_length = new int[8]; + algorithm = 0; + nc = 1; + m_TwoWay = 0; + m_imgCamera = null; + m_imgProcess = null; + BufferReady = false; + imgbuf = new byte[0x100000]; + tmpbuf = new byte[MAX_BUFFER_SIZE + 0x20000]; + rcvbuf = new byte[1024]; + m_sTimeString = new String("2004-01-01 00:00:00 am"); + HorizontalPosition = 0; + VerticalPosition = 0; + PositionName = new String("test"); + m_PanSingleMoveDegree = 0; + m_TiltSingleMoveDegree = 0; + CV_OK = -1; + CV_ERROR = 0; + ratio = 1; + scale_method = 0; + imgWidth = 0; + imgHeight = 0; + drawLine = false; + block_num = 5; + block_on = 0; + SoundOn = 1; + test_cnt = 0; + os_windows = true; + mute_start_time = 0L; + muteControl = null; + turn_sound_on = false; + turn_sound_off = false; + m_MotionFlag = 0; + acsControl = new ACS_Control(); + acsAudio = new ACS_Audio(); + AudioOutStatus = 0; + m_AudioOut = false; + } + + public void init() + { + try + { + if(getParameter("RemoteHost") != null) + { + m_sRemoteHost = getParameter("RemoteHost"); + } else + { + m_urlRemoteHost = getCodeBase(); + m_sRemoteHost = m_urlRemoteHost.getHost(); + } + imgHeight = getHeight(); + imgWidth = getWidth(); + if(getParameter("Algorithm") != null) + algorithm = Integer.parseInt(getParameter("Algorithm")); + m_iRemotePort = Integer.valueOf(getParameter("RemotePort")); + m_iTimeout = Integer.valueOf(getParameter("Timeout")); + m_lPreviewFrameRate = Long.valueOf(getParameter("PreviewFrameRate")); + m_dRotateAngle = Double.valueOf(getParameter("RotateAngle")); + m_sPassword = getParameter("DeviceSerialNo"); + m_baPassword = m_sPassword.getBytes("8859_1"); + if(getParameter("SetMotionDetection") != null && Integer.parseInt(getParameter("SetMotionDetection")) > 0) + { + drawLine = true; + String s = getParameter("MotionDetectionBlockSet"); + block_on = 0; + if(s != null) + { + int i = s.length(); + if(i > 25) + i = 25; + for(int j = 0; j < i; j++) + if(s.charAt(j) == '1') + block_on = block_on | 1 << j; + + } + } + if(getParameter("TwoWay") != null) + m_TwoWay = Integer.parseInt(getParameter("TwoWay")); + String s1; + if(algorithm == 0 || algorithm == 2) + s1 = new String("GET /mjpeg.cgi HTTP/1.0\r\nUser-Agent: user\r\nAuthorization: Basic "); + else + s1 = new String("GET /dgvideo.cgi HTTP/1.0\r\nUser-Agent: user\r\nAuthorization: Basic "); + s1 = s1.concat(m_sPassword); + s1 = s1.concat("\r\n\r\n"); + m_GetImageString = s1.getBytes("8859_1"); + s1 = new String("GET /IOCONTROL.CGI HTTP/1.0\r\nUser-Agent: user\r\nAuthorization: Basic "); + s1 = s1.concat(m_sPassword); + s1 = s1.concat("\r\n\r\n"); + m_baCliCmdGetRealTimeData = s1.getBytes("8859_1"); + sub_idx[0] = 0; + s1 = new String("Content-type: image/jpeg\r\n\r\n"); + sub_length[0] = s1.length(); + sub_idx[1] = s1.length(); + s1 = s1.concat("\r\n\r\n--video boundary--\r\n"); + sub_length[1] = s1.length() - sub_idx[1]; + sub_idx[2] = s1.length(); + s1 = s1.concat("Content-length: "); + sub_length[2] = s1.length() - sub_idx[2]; + sub_idx[3] = s1.length(); + s1 = s1.concat("Trigger1="); + sub_length[3] = s1.length() - sub_idx[3]; + sub_idx[4] = s1.length(); + s1 = s1.concat("Trigger2="); + sub_length[4] = s1.length() - sub_idx[4]; + sub_idx[5] = s1.length(); + s1 = s1.concat("ImageUpload="); + sub_length[5] = s1.length() - sub_idx[5]; + sub_idx[6] = s1.length(); + s1 = s1.concat("Date: "); + sub_length[6] = s1.length() - sub_idx[6]; + sub_idx[7] = s1.length(); + s1 = s1.concat("ImageEmail="); + sub_length[7] = s1.length() - sub_idx[7]; + substring = s1.getBytes(); + m_lNumFrames = 0L; + m_lTimerPrev = System.currentTimeMillis(); + m_lTimerNow = System.currentTimeMillis(); + m_fFrameRate = 0.0F; + m_bImageThreadRun = false; + m_bRealTimeDataThreadRun = false; + m_bIsRealTimeDataConnect = false; + m_bIsPostDataConnect = false; + m_PostingData = false; + m_PostingPanTiltData = false; + addMouseListener(this); + } + catch(Exception exception) + { + System.err.println(exception); + } + } + + public void mouseClicked(MouseEvent mouseevent) + { + } + + public void mousePressed(MouseEvent mouseevent) + { + int i = mouseevent.getX(); + int j = mouseevent.getY(); + if(!drawLine || i >= imgWidth || j >= imgHeight) + { + return; + } else + { + int k = i / (imgWidth / block_num); + int l = j / (imgHeight / block_num); + block_on = block_on ^ 1 << l * block_num + k; + SetMotionDetect(); + return; + } + } + + public void mouseReleased(MouseEvent mouseevent) + { + } + + public void mouseEntered(MouseEvent mouseevent) + { + } + + public void mouseExited(MouseEvent mouseevent) + { + } + + public void destroy() + { + m_bImageThreadRun = false; + try + { + m_Input.close(); + m_Output.close(); + m_sktClient.close(); + } + catch(Exception exception) + { + System.err.println(exception); + } + } + + public void start() + { + Play(); + } + + public void stop() + { + Stop(); + } + + public void paint(Graphics g) + { + if(m_imgCamera != null) + { + int i = m_imgCamera.getHeight(null); + int j = m_imgCamera.getWidth(null); + imgHeight = getHeight(); + imgWidth = getWidth(); + if(!drawLine) + { + if(os_windows) + g.drawImage(m_imgCamera, 0, 0, imgWidth, imgHeight, (j * (ratio - 1)) / ratio / 2, (i * (ratio - 1)) / ratio / 2, (j * (ratio - 1)) / ratio / 2 + j / ratio, (i * (ratio - 1)) / ratio / 2 + i / ratio, this); + else + if(m_imgProcess != null) + g.drawImage(m_imgProcess, 0, 0, imgWidth, imgHeight, (j * (ratio - 1)) / ratio / 2, (i * (ratio - 1)) / ratio / 2, (j * (ratio - 1)) / ratio / 2 + j / ratio, (i * (ratio - 1)) / ratio / 2 + i / ratio, this); + } else + if(m_imgProcess != null) + g.drawImage(m_imgProcess, 0, 0, imgWidth, imgHeight, this); + } + } + + public void update(Graphics g) + { + paint(g); + } + + public String CvtHex(byte abyte0[]) + { + byte abyte1[] = new byte[abyte0.length * 2]; + for(int i = 0; i < abyte0.length; i++) + { + byte byte0 = (byte)(abyte0[i] >> 4 & 0xf); + if(byte0 <= 9) + abyte1[i * 2] = (byte)(byte0 + 48); + else + abyte1[i * 2] = (byte)((byte0 + 97) - 10); + byte0 = (byte)(abyte0[i] & 0xf); + if(byte0 <= 9) + abyte1[i * 2 + 1] = (byte)(byte0 + 48); + else + abyte1[i * 2 + 1] = (byte)((byte0 + 97) - 10); + } + + return new String(abyte1); + } + + public String decode_base64(byte abyte0[], int i) + { + byte abyte1[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".getBytes(); + byte abyte2[] = new byte[4]; + int j = i % 4; + if(j != 0) + return null; + int k1 = 0; + j = 0; + int k = i / 4; + byte abyte3[] = new byte[k * 3]; + for(int l = 0; l < k; l++) + { + for(int i1 = 0; i1 < 4; i1++) + { + if(abyte0[k1] == 61) + { + abyte2[i1] = 0; + j++; + } else + { + int j1 = 0; + do + { + if(j1 >= 64) + break; + if(abyte0[k1] == abyte1[j1]) + { + abyte2[i1] = (byte)j1; + break; + } + j1++; + } while(true); + } + k1++; + } + + abyte3[l * 3] = (byte)((byte)(abyte2[0] << 2 & 0xfc) | (byte)(abyte2[1] >> 4 & 3)); + abyte3[l * 3 + 1] = (byte)((byte)(abyte2[1] << 4 & 0xf0) | (byte)(abyte2[2] >> 2 & 0xf)); + abyte3[l * 3 + 2] = (byte)((byte)(abyte2[2] << 6 & 0xc0) | abyte2[3]); + } + + return new String(abyte3); + } + + public String GetDigestAuthentication(String s, String s1, String s2, String s3, String s4) + { + String s5 = null; + String s6 = null; + String s7 = null; + String s8 = null; + String s9 = null; + String s10 = decode_base64(m_sPassword.getBytes(), m_sPassword.length()); + s6 = s10.substring(0, s10.indexOf(':')); + if(s10.indexOf('\0') >= 0) + s7 = s10.substring(s10.indexOf(':') + 1, s10.indexOf('\0')); + else + s7 = s10.substring(s10.indexOf(':') + 1); + Random random = new Random(); + byte abyte0[] = new byte[16]; + random.nextBytes(abyte0); + s8 = CvtHex(abyte0); + s9 = String.format("%1$08X", new Object[] { + Integer.valueOf(nc) + }); + nc++; + try + { + MessageDigest messagedigest = MessageDigest.getInstance("MD5"); + messagedigest.update(s6.getBytes()); + messagedigest.update((byte)58); + messagedigest.update(s2.getBytes()); + messagedigest.update((byte)58); + messagedigest.update(s7.getBytes()); + String s12 = CvtHex(messagedigest.digest()); + messagedigest.reset(); + messagedigest.update(s.getBytes()); + messagedigest.update((byte)58); + messagedigest.update(s1.getBytes()); + String s13 = CvtHex(messagedigest.digest()); + messagedigest.reset(); + messagedigest.update(s12.getBytes()); + messagedigest.update((byte)58); + messagedigest.update(s4.getBytes()); + messagedigest.update((byte)58); + if(s3.length() > 0) + { + messagedigest.update(s9.getBytes()); + messagedigest.update((byte)58); + messagedigest.update(s8.getBytes()); + messagedigest.update((byte)58); + messagedigest.update(s3.getBytes()); + messagedigest.update((byte)58); + } + messagedigest.update(s13.getBytes()); + s5 = CvtHex(messagedigest.digest()); + } + catch(Exception exception) + { + exception.printStackTrace(); + } + String s11 = String.format("Digest username=\"%1$s\", realm=\"%2$s\", uri=\"%3$s\", algorithm=MD5, nonce=\"%4$s\", cnonce=\"%5$s\", qop=%6$s, nc=%7$s, response=\"%8$s\"", new Object[] { + s6, s2, s1, s4, s8, s3, s9, s5 + }); + return s11; + } + + public void run() + { + boolean flag; + int i3; + String s; + String s1; + String s2; + boolean flag14; + long l6; + Thread thread; + i3 = 0; + boolean flag6 = false; + long l4 = System.currentTimeMillis(); + boolean flag12 = false; + s = null; + s1 = null; + s2 = null; + flag14 = false; + l6 = System.currentTimeMillis(); + flag = true; + m_bIsConnect = false; + thread = Thread.currentThread(); + if(thread != m_trdCameraImage) goto _L2; else goto _L1 +_L1: + int j1; + int i2; + int k3; + long l5; + boolean flag13; + if(!flag || !m_bImageThreadRun) + break; /* Loop/switch isn't completed */ + System.gc(); + try + { + do + { + thread; + Thread.sleep(100L); + if(m_iRemotePort.intValue() == 8481 || m_iRemotePort.intValue() == 80) + m_sktClient = new Socket(m_sRemoteHost, 80); + else + m_sktClient = new Socket(m_sRemoteHost, m_iRemotePort.intValue()); + m_sktClient.setSoTimeout(m_iTimeout.intValue()); + m_Input = new DataInputStream(m_sktClient.getInputStream()); + m_Output = new DataOutputStream(m_sktClient.getOutputStream()); + m_Output.write(m_GetImageString); + m_Input.read(tmpbuf, 0, 64); + String s3 = new String(tmpbuf, 0, 64); + if(s3 != null && s3.indexOf("HTTP/") >= 0) + { + if(s3.indexOf("200") >= 0) + break; + if(s3.indexOf("501") >= 0) + { + System.out.println("too many users, wait 10 sec."); + flag14 = true; + } + } + BufferedReader bufferedreader = new BufferedReader(new InputStreamReader(m_sktClient.getInputStream())); + do + { + String s4; + if((s4 = bufferedreader.readLine()) == null) + break; + if(s4.indexOf("WWW-Authenticate: ") < 0) + continue; + int i4 = s4.indexOf("realm=") + 7; + int j4 = s4.indexOf('"', i4); + s = s4.substring(i4, j4); + i4 = s4.indexOf("qop=") + 5; + j4 = s4.indexOf('"', i4); + s1 = s4.substring(i4, j4); + i4 = s4.indexOf("nonce=") + 7; + j4 = s4.indexOf('"', i4); + s2 = s4.substring(i4, j4); + break; + } while(true); + String s7; + if(algorithm == 0) + { + s7 = new String("GET /mjpeg.cgi HTTP/1.0\r\nUser-Agent: user\r\nAuthorization: Basic "); + s7 = s7.concat(m_sPassword); + } else + if(algorithm == 1) + { + String s5 = GetDigestAuthentication("GET", "/dgvideo.cgi", s, s1, s2); + s7 = new String("GET /dgvideo.cgi HTTP/1.0\r\nUser-Agent: user\r\nAuthorization: "); + s7 = s7.concat(s5); + } else + { + String s6 = GetDigestAuthentication("GET", "/mjpeg.cgi", s, s1, s2); + s7 = new String("GET /mjpeg.cgi HTTP/1.0\r\nUser-Agent: user\r\nAuthorization: "); + s7 = s7.concat(s6); + } + s7 = s7.concat("\r\n\r\n"); + m_GetImageString = s7.getBytes("8859_1"); + m_Input.close(); + m_Output.close(); + bufferedreader.close(); + m_sktClient.close(); + m_Input = null; + m_Output = null; + bufferedreader = null; + m_sktClient = null; + if(flag14) + { + thread; + Thread.sleep(10000L); + } + flag14 = false; + } while(true); + m_bIsConnect = true; + } + catch(Exception exception) + { + exception.printStackTrace(); + m_bIsConnect = false; + continue; /* Loop/switch isn't completed */ + } + boolean flag1 = false; + boolean flag2 = false; + j1 = 0; + i2 = -1; + boolean flag7 = false; + k3 = 0; + flag13 = false; + l5 = System.currentTimeMillis(); + BufferReady = false; +_L12: + if(!m_bImageThreadRun) + break MISSING_BLOCK_LABEL_1648; + while(BufferReady) + { + int k1 = m_Input.available(); + if(j1 + k1 > MAX_BUFFER_SIZE) + { + j1 = 0; + i2 = -1; + boolean flag8 = false; + k3 = 0; + } + if(k1 > 0) + { + k1 = m_Input.read(tmpbuf, j1, k1); + boolean flag3 = false; + l5 = System.currentTimeMillis(); + j1 += k1; + } else + if(System.currentTimeMillis() - l5 > 15000L) + { + flag13 = true; + m_bIsConnect = false; + BufferReady = false; + break; + } + thread; + Thread.sleep(2L); + } + boolean flag4 = false; +_L10: + if(!m_bIsConnect) + break MISSING_BLOCK_LABEL_1596; + int l1; + if(k3 < 0 || j1 > MAX_BUFFER_SIZE) + { + j1 = 0; + i2 = -1; + boolean flag9 = false; + k3 = 0; + } + l1 = m_Input.available(); + if(l1 <= 0) goto _L4; else goto _L3 +_L3: + if(i2 == -1) + l1 = m_Input.read(tmpbuf, j1, l1); + else + l1 = m_Input.read(imgbuf, j1, k3); + j1 += l1; + boolean flag5 = false; + l5 = System.currentTimeMillis(); + goto _L5 +_L4: + if(System.currentTimeMillis() - l5 > 15000L) + { + flag13 = true; + break MISSING_BLOCK_LABEL_1596; + } +_L5: + if(j1 <= 0) + break MISSING_BLOCK_LABEL_1566; + if(i2 != -1) goto _L7; else goto _L6 +_L6: + int j3; + j3 = SearchString(0, j1, 2); + if(j3 >= 0) + { + i2 = SearchString(j3, j1, 0); + if(i2 > 0) + i3 = SearchString(j3, i2, 6); + } + if(i2 >= 0) goto _L9; else goto _L8 +_L8: + thread; + Thread.sleep(2L); + goto _L10 +_L9: +label0: + { + if(i3 > 0) + { + int j2 = i3; + m_sTimeString = new String(tmpbuf, j2 + 6, 22); + if(!m_PostingData) + { + m_iIOOut1 = tmpbuf[j2 + 39] - 48; + m_iIOOut2 = tmpbuf[j2 + 38] - 48; + m_imageUpload = tmpbuf[j2 + 37] - 48; + m_imageEmail = tmpbuf[j2 + 36] - 48; + if(tmpbuf[j2 + 35] == 49) + { + l6 = System.currentTimeMillis(); + m_MotionFlag = 1; + } else + if(m_MotionFlag == 1 && System.currentTimeMillis() - l6 > 3000L) + m_MotionFlag = 0; + } + int l3 = 0; + for(int i = 0; i < 3; i++) + l3 = l3 * 10 + (tmpbuf[j2 + 44 + i] - 48); + + HorizontalPosition = l3; + l3 = 0; + for(int j = 0; j < 3; j++) + l3 = l3 * 10 + (tmpbuf[j2 + 48 + j] - 48); + + VerticalPosition = l3; + } + if(j3 < 0) + break MISSING_BLOCK_LABEL_1566; + int k2 = j3; + k2 += sub_length[2]; + k3 = 0; + for(; tmpbuf[k2] >= 48 && tmpbuf[k2] <= 57; k2++) + k3 = k3 * 10 + (tmpbuf[k2] - 48); + + iLength = k3; + boolean flag10 = false; + i2 += sub_length[0]; + j1 -= i2; + if(k3 <= j1) + break label0; + for(int k = 0; k < j1; k++) + imgbuf[k] = tmpbuf[k + i2]; + + k3 -= j1; + thread; + Thread.sleep(2L); + } + goto _L10 + try + { + for(int l = 0; l < k3; l++) + imgbuf[l] = tmpbuf[l + i2]; + + int l2; + if(j1 > k3 * 4) + { + l2 = SearchString(i2 + k3 * 2, j1 - k3 * 2, 2); + if(l2 >= 0) + { + j1 = (j1 + i2) - l2; + } else + { + j1 -= k3; + l2 = i2 + k3; + } + } else + { + j1 -= k3; + l2 = i2 + k3; + } + for(int i1 = 0; i1 < j1; i1++) + tmpbuf[i1] = tmpbuf[i1 + l2]; + + BufferReady = true; + i2 = -1; + continue; /* Loop/switch isn't completed */ + } + catch(Exception exception1) + { + char c = '\u4E20'; + BufferReady = false; + flag13 = true; + } + break MISSING_BLOCK_LABEL_1596; +_L7: + k3 -= l1; + if(k3 <= 0) + { + BufferReady = true; + i2 = -1; + j1 = 0; + continue; /* Loop/switch isn't completed */ + } + thread; + Thread.sleep(2L); + goto _L10 + if(flag13) + break; /* Loop/switch isn't completed */ + thread; + Thread.sleep(3L); + i2 = -1; + boolean flag11 = false; + if(true) goto _L12; else goto _L11 +_L11: + m_bIsConnect = false; + break MISSING_BLOCK_LABEL_1648; + Exception exception2; + exception2; + System.err.println(": Getting image connection broken."); + m_bIsConnect = false; + m_fFrameRate = 0.0F; + try + { + m_Input.close(); + m_Output.close(); + m_sktClient.close(); + m_Input = null; + m_Output = null; + m_sktClient = null; + m_bIsConnect = false; + } + catch(Exception exception3) + { + System.err.println(exception3); + } + if(!m_bImageThreadRun) + flag = false; + if(true) goto _L1; else goto _L2 +_L2: + } + + public int SearchString(int i, int j, int k) + { + if(i < 0) + i = 0; + int l = 0; + l = sub_length[k]; + int k1 = sub_idx[k]; + for(int i1 = i; i1 < (j - l) + 1; i1++) + { + int j1; + for(j1 = 0; j1 < l && tmpbuf[i1 + j1] == substring[j1 + k1]; j1++); + if(j1 == l) + return i1; + } + + return -1; + } + + public int GetRealTimeData() + { + return CV_OK; + } + + public String GetFrameRate() + { + CalculateFrameRate(); + return Float.toString(m_fFrameRate); + } + + public int GetMotionDetectFlag() + { + return block_on; + } + + public void CalculateFrameRate() + { + long l; + m_lTimerNow = System.currentTimeMillis(); + l = m_lTimerNow - m_lTimerPrev; + if(l <= 0L) + { + m_fFrameRate = 0.0F; + m_lNumFrames = 0L; + return; + } + try + { + long l1 = Math.round(((float)m_lNumFrames * 100000F) / (float)l); + m_fFrameRate = (float)l1 / 100F; + m_lNumFrames = 0L; + m_lTimerPrev = m_lTimerNow; + } + catch(Exception exception) + { + System.err.println(exception); + } + return; + } + + public int Play() + { + if(!m_bImageThreadRun) + { + m_bImageThreadRun = true; + m_trdCameraImageShow = new SI(); + m_trdCameraImageShow.start(); + m_trdTriggerState = new TS(); + m_trdTriggerState.start(); + m_trdCameraSound = new AU(); + m_trdCameraSound.start(); + m_trdTalkie = new Talkie(); + m_trdTalkie.start(); + m_trdCameraImage = new Thread(this); + m_trdCameraImage.start(); + } + return CV_OK; + } + + public void Stop() + { + m_bImageThreadRun = false; + } + + public String GetRemoteHost() + { + return m_sRemoteHost; + } + + public int GetRemotePort() + { + return m_iRemotePort.intValue(); + } + + public int SetRemotePort(int i) + { + m_iRemotePort = new Integer(i); + return CV_OK; + } + + public int GetTimeout() + { + return m_iTimeout.intValue(); + } + + public int SetTimeout(int i) + { + m_iTimeout = new Integer(i); + return CV_OK; + } + + public long GetPreviewFrameRate() + { + return m_lPreviewFrameRate.longValue(); + } + + public int SetPreviewFrameRate(long l) + { + m_lPreviewFrameRate = new Long(l); + return CV_OK; + } + + public double GetRotateAngle() + { + return m_dRotateAngle.doubleValue(); + } + + public int SetRotateAngle(double d) + { + m_dRotateAngle = new Double(d); + return CV_OK; + } + + private boolean CompareByteArray(byte abyte0[], byte abyte1[], int i) + { + for(int j = 0; j < i; j++) + if(abyte0[j] != abyte1[j]) + return false; + + return true; + } + + public int GetIOIn1() + { + return m_iIOIn1; + } + + public int GetIOIn2() + { + return m_iIOIn2; + } + + public int GetImageUpload() + { + return m_imageUpload; + } + + public int GetImageEmail() + { + return m_imageEmail; + } + + public int GetIOOut1() + { + return m_iIOOut1; + } + + public int GetIOOut2() + { + return m_iIOOut2; + } + + public int SetTriggerState(int i, int j, int k, int l) + { + int i1 = 0; + if(!m_bIsConnect) + return CV_ERROR; + while(m_PostingData || m_PostingPanTiltData) + { + if(++i1 > 15) + return CV_ERROR; + try + { + Thread.currentThread(); + Thread.sleep(20L); + } + catch(Exception exception) { } + } + m_PostingData = true; + m_bIsRealTimeDataConnect = false; + post_function = 1; + m_postdata = new String(""); + if(i == 0) + m_postdata = m_postdata.concat("Trigger1=0&"); + else + m_postdata = m_postdata.concat("Trigger1=1&"); + if(j == 0) + m_postdata = m_postdata.concat("Trigger2=0&"); + else + m_postdata = m_postdata.concat("Trigger2=1&"); + if(k == 0) + m_postdata = m_postdata.concat("ImageUpload=0&"); + else + m_postdata = m_postdata.concat("ImageUpload=1&"); + if(l == 0) + m_postdata = m_postdata.concat("ImageEmail=0\r\n\r\n"); + else + m_postdata = m_postdata.concat("ImageEmail=1\r\n\r\n"); + m_iIOOut1 = i; + m_iIOOut2 = j; + m_imageUpload = k; + m_imageEmail = l; + m_bIsPostDataConnect = true; + return CV_OK; + } + + public int SetIOOut1(int i) + { + return SetTriggerState(i, m_iIOOut2, m_imageUpload, m_imageEmail); + } + + public int SetIOOut2(int i) + { + return SetTriggerState(m_iIOOut1, i, m_imageUpload, m_imageEmail); + } + + public int SetImageUpload(int i) + { + return SetTriggerState(m_iIOOut1, m_iIOOut2, i, m_imageEmail); + } + + public int SetImageEmail(int i) + { + return SetTriggerState(m_iIOOut1, m_iIOOut2, m_imageUpload, i); + } + + public int GetYear() + { + return m_iYear; + } + + public int GetMonth() + { + return m_iMonth; + } + + public int GetDay() + { + return m_iDay; + } + + public int GetDate() + { + return m_iDate; + } + + public int GetHour() + { + return m_iHour; + } + + public int GetMinute() + { + return m_iMinute; + } + + public int GetSecond() + { + return m_iSecond; + } + + public String GetTimeString() + { + return m_sTimeString; + } + + public String GetVersion() + { + String s = "20030123"; + return s; + } + + public boolean GetIsConnect() + { + return m_bIsConnect; + } + + public int GetHorizontalPosition() + { + return HorizontalPosition; + } + + public int GetVerticalPosition() + { + return VerticalPosition; + } + + public int SetPanTilt(int i, int j) + { + int k = 0; + if(!m_bIsConnect) + return CV_ERROR; + while(m_PostingData || m_PostingPanTiltData) + { + if(++k > 15) + return CV_ERROR; + try + { + Thread.currentThread(); + Thread.sleep(20L); + } + catch(Exception exception) { } + } + m_PostingData = true; + m_bIsRealTimeDataConnect = false; + String s6 = new String(""); + switch(i) + { + case 1: // '\001' + s6 = s6.concat("PanSingleMoveDegree="); + String s = Integer.toString(m_PanSingleMoveDegree, 10); + s6 = s6.concat(s); + s6 = s6.concat("&TiltSingleMoveDegree="); + s = Integer.toString(m_TiltSingleMoveDegree, 10); + s6 = s6.concat(s); + s6 = s6.concat("&PanTiltSingleMove="); + s = Integer.toString(j, 10); + s6 = s6.concat(s); + break; + + case 2: // '\002' + s6 = s6.concat("PanTiltPresetPositionMove="); + String s1 = Integer.toString(j, 10); + s6 = s6.concat(s1); + break; + + case 3: // '\003' + s6 = s6.concat("PanTiltHorizontal="); + String s2 = Integer.toString(HorizontalPosition, 10); + s6 = s6.concat(s2); + s6 = s6.concat("&PanTiltVertical="); + s2 = Integer.toString(VerticalPosition, 10); + s6 = s6.concat(s2); + s6 = s6.concat("&SetName="); + s6 = s6.concat(PositionName); + s6 = s6.concat("&SetPosition="); + s2 = Integer.toString(j, 10); + s6 = s6.concat(s2); + break; + + case 4: // '\004' + s6 = s6.concat("ClearPosition="); + String s3 = Integer.toString(j, 10); + s6 = s6.concat(s3); + break; + + case 5: // '\005' + s6 = s6.concat("PanTiltSwingMode="); + String s4 = Integer.toString(j, 10); + s6 = s6.concat(s4); + break; + } + s6 = s6.concat("\r\n\r\n"); + String s5 = Integer.toString(s6.length(), 10); + post_function = 2; + m_postdata = new String(""); + m_postdata = m_postdata.concat(s6); + m_bIsPostDataConnect = true; + return CV_OK; + } + + public int MovePanTiltDegree(int i) + { + return SetPanTilt(1, i); + } + + public int MovePanTiltPosition(int i) + { + return SetPanTilt(2, i); + } + + public int SetPosition(int i) + { + return SetPanTilt(3, i); + } + + public int ClearPosition(int i) + { + return SetPanTilt(4, i); + } + + public int SwingMode(int i) + { + return SetPanTilt(5, i); + } + + public int PanSingleMoveDegree(int i) + { + m_PanSingleMoveDegree = i; + return 0; + } + + public int TiltSingleMoveDegree(int i) + { + m_TiltSingleMoveDegree = i; + return 0; + } + + public int SetName(String s) + { + PositionName = new String("654321"); + return 0; + } + + public int Zoom(int i) + { + ratio = i; + return 0; + } + + public int SetSound(int i) + { + if(m_AudioOut && m_TwoWay == 0) + return 0; + int j = 0; + Object obj = null; + String s = new String(""); + if(SoundOn != i) + if(i == 1) + mute_start_time = System.currentTimeMillis(); + else + turn_sound_off = true; + SoundOn = i; + if(!m_bIsConnect) + return CV_ERROR; + while(m_PostingData) + { + if(++j > 15) + return CV_ERROR; + try + { + Thread.currentThread(); + Thread.sleep(20L); + } + catch(Exception exception) { } + } + m_PostingData = true; + s = s.concat("AudioMute="); + s = s.concat(SoundOn != 0 ? "0" : "1"); + s = s.concat("\r\n\r\n"); + post_function = 3; + m_postdata = new String(""); + m_postdata = m_postdata.concat(s); + obj = null; + s = null; + m_bIsPostDataConnect = true; + return 0; + } + + public int SetMotionDetect() + { + int i = 0; + String s = new String(""); + if(!m_bIsConnect) + return CV_ERROR; + while(m_PostingData) + { + if(++i > 15) + return CV_ERROR; + try + { + Thread.currentThread(); + Thread.sleep(20L); + } + catch(Exception exception) { } + } + m_PostingData = true; + s = s.concat("ConfigTemp=Java&MotionDetectionBlockSet="); + for(int j = 0; j < 25; j++) + s = s.concat((block_on & 1 << j) == 0 ? "0" : "1"); + + s = s.concat("\r\n\r\n"); + post_function = 4; + m_postdata = new String(""); + m_postdata = m_postdata.concat(s); + m_bIsPostDataConnect = true; + return CV_OK; + } + + public int GetMotionFlag() + { + return m_MotionFlag; + } + + public void StartAudioOut() + { + m_AudioOut = true; + if(m_TwoWay == 0) + turn_sound_off = true; + } + + public void StopAudioOut() + { + m_AudioOut = false; + AudioOutStatus = 0; + if(m_TwoWay == 0) + mute_start_time = System.currentTimeMillis(); + } + + public int CheckAudioOutStatus() + { + int i = AudioOutStatus; + if(AudioOutStatus < 0) + AudioOutStatus = 0; + return i; + } + + public void ComputePasswordEncryption20(byte abyte0[], byte abyte1[], byte abyte2[]) + { + for(int i = 0; i < 20; i++) + abyte0[i] = abyte1[i]; + + for(int j = 0; j < 2; j++) + { + for(int k = 0; k < 20; k++) + { + abyte0[k] ^= abyte2[k + j * 20]; + byte byte1 = (byte)(abyte0[k] & 0xf); + byte byte0 = (byte)(abyte0[k] & 0xfffffff0); + if((abyte0[k] & 1) != 0) + { + byte1 ^= abyte2[k + j * 20 + 40]; + byte1 &= 0xf; + } + if((abyte0[k] & 0x10) != 0) + { + byte0 ^= abyte2[k + j * 20 + 40]; + byte0 &= 0xf0; + } + abyte0[k] = (byte)(byte0 | byte1); + } + + } + + } + + private int MAX_BUFFER_SIZE; + private String m_sRemoteHost; + private URL m_urlRemoteHost; + private Integer m_iRemotePort; + private Integer m_iTimeout; + private Long m_lPreviewFrameRate; + private Long m_lCameraInfoRefreshRate; + private Double m_dRotateAngle; + private String m_sPassword; + private byte m_baPassword[]; + private String m_postdata; + private String m_postpantiltdata; + private int sub_idx[]; + private int sub_length[]; + private byte substring[]; + private int algorithm; + private int nc; + private int m_TwoWay; + private Thread m_trdCameraImage; + private SI m_trdCameraImageShow; + private TS m_trdTriggerState; + private AU m_trdCameraSound; + private Image m_imgCamera; + private Image m_imgProcess; + private int iLength; + private boolean BufferReady; + private byte imgbuf[]; + private byte tmpbuf[]; + private byte rcvbuf[]; + private Socket m_sktClient; + private DataInputStream m_Input; + private DataOutputStream m_Output; + private Socket m_sktPostData; + private DataInputStream m_PostDataInput; + private DataOutputStream m_PostDataOutput; + private boolean m_bImageThreadRun; + private boolean m_bRealTimeDataThreadRun; + private boolean m_bIsRealTimeDataConnect; + private boolean m_bIsConnect; + private boolean m_bIsPostDataConnect; + private boolean m_PostingData; + private boolean m_PostingPanTiltData; + private long m_lNumFrames; + private long m_lTimerPrev; + private long m_lTimerNow; + private float m_fFrameRate; + private int m_imageUpload; + private int m_imageEmail; + private int m_iIOIn1; + private int m_iIOIn2; + private int m_iIOOut1; + private int m_iIOOut2; + private int m_iSecond; + private int m_iMinute; + private int m_iHour; + private int m_iDate; + private int m_iMonth; + private int m_iDay; + private int m_iYear; + private String m_sTimeString; + private byte m_GetImageString[]; + private byte m_baCliCmdGetRealTimeData[]; + private int HorizontalPosition; + private int VerticalPosition; + private String PositionName; + private int m_PanSingleMoveDegree; + private int m_TiltSingleMoveDegree; + private int CV_OK; + private int CV_ERROR; + private int ratio; + private int scale_method; + private int imgWidth; + private int imgHeight; + private boolean drawLine; + private int block_num; + private int block_on; + private int SoundOn; + private int test_cnt; + private boolean os_windows; + private long mute_start_time; + private BooleanControl muteControl; + private boolean turn_sound_on; + private boolean turn_sound_off; + private int post_function; + private int m_MotionFlag; + private Talkie m_trdTalkie; + private ACS_Control acsControl; + private ACS_Audio acsAudio; + private int AudioOutStatus; + private boolean m_AudioOut; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +} diff --git a/verb/fs.etc_ro.web/api/aplug/aplug.jar b/verb/fs.etc_ro.web/api/aplug/aplug.jar new file mode 100644 index 0000000..b549b47 Binary files /dev/null and b/verb/fs.etc_ro.web/api/aplug/aplug.jar differ diff --git a/verb/fs.etc_ro.web/api/aplugLiteDL.cab b/verb/fs.etc_ro.web/api/aplugLiteDL.cab new file mode 100644 index 0000000..362e387 Binary files /dev/null and b/verb/fs.etc_ro.web/api/aplugLiteDL.cab differ diff --git a/verb/fs.etc_ro.web/api/aplugLiteDl/aplugLiteDL.cab b/verb/fs.etc_ro.web/api/aplugLiteDl/aplugLiteDL.cab new file mode 100644 index 0000000..362e387 Binary files /dev/null and b/verb/fs.etc_ro.web/api/aplugLiteDl/aplugLiteDL.cab differ diff --git a/verb/fs.etc_ro.web/api/aplugLiteDl/aplugLiteDL.inf b/verb/fs.etc_ro.web/api/aplugLiteDl/aplugLiteDL.inf new file mode 100644 index 0000000..ff7cae1 --- /dev/null +++ b/verb/fs.etc_ro.web/api/aplugLiteDl/aplugLiteDL.inf @@ -0,0 +1,25 @@ +[version] + signature="$CHICAGO$" + AdvancedINF=2.0 +[Add.Code] + msvcrt.dll=msvcrt.dll + mfc42.dll=mfc42.dll + olepro32.dll=olepro32.dll + aplugLiteDL.ocx=aplugLiteDL.ocx +[aplugLiteDL.ocx] + file-win32-x86=thiscab + clsid={7191F0AC-D686-46A8-BFCC-EA61778C74DD} + FileVersion=2,3,2,41 + RegisterServer=yes +[msvcrt.dll] + FileVersion=4,20,0,6164 + hook=mfc42installer +[mfc42.dll] + FileVersion=4,2,0,6256 + hook=mfc42installer +[olepro32.dll] + FileVersion=4,2,0,6068 + hook=mfc42installer +[mfc42installer] + file-win32-x86=http://activex.microsoft.com/controls/vc/mfc42.cab + run=%EXTRACT_DIR%\mfc42.exe diff --git a/verb/fs.etc_ro.web/api/aplugLiteDl/aplugLiteDL.ocx b/verb/fs.etc_ro.web/api/aplugLiteDl/aplugLiteDL.ocx new file mode 100644 index 0000000..76da528 Binary files /dev/null and b/verb/fs.etc_ro.web/api/aplugLiteDl/aplugLiteDL.ocx differ diff --git a/verb/fs.etc_ro.web/api/sounddb.jar b/verb/fs.etc_ro.web/api/sounddb.jar new file mode 100644 index 0000000..423150a Binary files /dev/null and b/verb/fs.etc_ro.web/api/sounddb.jar differ diff --git a/verb/fs.etc_ro.web/api/sounddb/META-INF/MANIFEST.MF b/verb/fs.etc_ro.web/api/sounddb/META-INF/MANIFEST.MF new file mode 100644 index 0000000..8632656 --- /dev/null +++ b/verb/fs.etc_ro.web/api/sounddb/META-INF/MANIFEST.MF @@ -0,0 +1,14 @@ +Manifest-Version: 1.0 +Application-Name: sounddb +Permissions: all-permissions +Created-By: 1.7.0_04 (Oracle Corporation) +Caller-Allowable-Codebase: * +Main-Class: sounddb +Codebase: * + +Name: sounddb.class +SHA1-Digest: 5R8mF2pBzyk5sHynPfeR1i251Lc= + +Name: sounddb$AU.class +SHA1-Digest: acxsN9J44TUSmYa1ylUKWfjJDsE= + diff --git a/verb/fs.etc_ro.web/api/sounddb/META-INF/WWW_DLIN.RSA b/verb/fs.etc_ro.web/api/sounddb/META-INF/WWW_DLIN.RSA new file mode 100644 index 0000000..5a5ffdb Binary files /dev/null and b/verb/fs.etc_ro.web/api/sounddb/META-INF/WWW_DLIN.RSA differ diff --git a/verb/fs.etc_ro.web/api/sounddb/META-INF/WWW_DLIN.SF b/verb/fs.etc_ro.web/api/sounddb/META-INF/WWW_DLIN.SF new file mode 100644 index 0000000..da1eaf3 --- /dev/null +++ b/verb/fs.etc_ro.web/api/sounddb/META-INF/WWW_DLIN.SF @@ -0,0 +1,11 @@ +Signature-Version: 1.0 +SHA1-Digest-Manifest-Main-Attributes: X2n8mlKX04cpcm8vj/5IQrf0lS8= +Created-By: 1.6.0_45 (Sun Microsystems Inc.) +SHA1-Digest-Manifest: g9+nyeyOuSAUhC6IQNp3xKUGmYU= + +Name: sounddb.class +SHA1-Digest: DXHVlhyw2rWuueIRRQ6F1jBUOdI= + +Name: sounddb$AU.class +SHA1-Digest: MsGGwNhpi46N81Zp9g5+BpdOMfA= + diff --git a/verb/fs.etc_ro.web/api/sounddb/sounddb$AU.class b/verb/fs.etc_ro.web/api/sounddb/sounddb$AU.class new file mode 100644 index 0000000..063012d Binary files /dev/null and b/verb/fs.etc_ro.web/api/sounddb/sounddb$AU.class differ diff --git a/verb/fs.etc_ro.web/api/sounddb/sounddb.class b/verb/fs.etc_ro.web/api/sounddb/sounddb.class new file mode 100644 index 0000000..92e9e6b Binary files /dev/null and b/verb/fs.etc_ro.web/api/sounddb/sounddb.class differ diff --git a/verb/fs.etc_ro.web/api/sounddb/sounddb.jad b/verb/fs.etc_ro.web/api/sounddb/sounddb.jad new file mode 100644 index 0000000..be32af1 --- /dev/null +++ b/verb/fs.etc_ro.web/api/sounddb/sounddb.jad @@ -0,0 +1,545 @@ +// Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. +// Jad home page: http://www.geocities.com/kpdus/jad.html +// Decompiler options: packimports(3) +// Source File Name: sounddb.java + +import java.applet.Applet; +import java.awt.*; +import java.io.*; +import java.net.Socket; +import java.net.URL; +import java.security.MessageDigest; +import java.util.Random; +import javax.sound.sampled.*; + +public class sounddb extends Applet + implements Runnable +{ + class AU extends Thread + { + + public void run() + { + do + { + if(!ThreadRun) + break; + try + { + if(algorithm == 0 || algorithm == 2) + sTmp = new String("GET /audio.cgi HTTP/1.0\r\nUser-Agent: user\r\nAuthorization: Basic "); + else + sTmp = new String("GET /dgaudio.cgi HTTP/1.0\r\nUser-Agent: user\r\nAuthorization: Basic "); + sTmp = sTmp.concat(m_sPassword); + sTmp = sTmp.concat("\r\n\r\n"); + m_GetSoundString = sTmp.getBytes("8859_1"); + do + { + Thread.currentThread(); + Thread.sleep(100L); + if(m_iRemotePort.intValue() == 8481 || m_iRemotePort.intValue() == 80) + m_sktSound = new Socket(m_sRemoteHost, 80); + else + m_sktSound = new Socket(m_sRemoteHost, m_iRemotePort.intValue()); + m_sktSound.setSoTimeout(30000); + m_sktSound.setKeepAlive(true); + m_soundInput = new DataInputStream(m_sktSound.getInputStream()); + m_soundOutput = new DataOutputStream(m_sktSound.getOutputStream()); + m_soundOutput.write(m_GetSoundString); + m_soundInput.read(rData, 0, 64); + String s = new String(rData, 0, 64); + if(s != null && s.indexOf("HTTP/") >= 0 && s.indexOf("200") >= 0) + break; + BufferedReader bufferedreader = new BufferedReader(new InputStreamReader(m_sktSound.getInputStream())); + do + { + String s1; + if((s1 = bufferedreader.readLine()) == null) + break; + if(s1.indexOf("WWW-Authenticate: ") < 0) + continue; + int i = s1.indexOf("realm=") + 7; + int j = s1.indexOf('"', i); + realm = s1.substring(i, j); + i = s1.indexOf("qop=") + 5; + j = s1.indexOf('"', i); + qop = s1.substring(i, j); + i = s1.indexOf("nonce=") + 7; + j = s1.indexOf('"', i); + nonce = s1.substring(i, j); + break; + } while(true); + if(algorithm == 0) + { + sTmp = new String("GET /audio.cgi HTTP/1.0\r\nUser-Agent: user\r\nAuthorization: Basic "); + sTmp = sTmp.concat(m_sPassword); + } else + if(algorithm == 1) + { + String s2 = GetDigestAuthentication("/dgaudio.cgi", realm, qop, nonce); + sTmp = new String("GET /dgaudio.cgi HTTP/1.0\r\nUser-Agent: user\r\nAuthorization: "); + sTmp = sTmp.concat(s2); + } else + { + String s3 = GetDigestAuthentication("/audio.cgi", realm, qop, nonce); + sTmp = new String("GET /audio.cgi HTTP/1.0\r\nUser-Agent: user\r\nAuthorization: "); + sTmp = sTmp.concat(s3); + } + sTmp = sTmp.concat("\r\n\r\n"); + m_GetSoundString = sTmp.getBytes("8859_1"); + m_soundInput.close(); + m_soundOutput.close(); + bufferedreader.close(); + m_sktSound.close(); + m_soundInput = null; + m_soundOutput = null; + bufferedreader = null; + m_sktSound = null; + } while(true); + nRead = 0; + boolean flag = false; + int j1; + do + { + nRead = nRead + m_soundInput.read(rData, nRead, rData.length - nRead); + j1 = 0; + do + { + if(j1 >= nRead - 7) + break; + if(rData[j1] == 13 && rData[j1 + 1] == 10 && rData[j1 + 2] == 13 && rData[j1 + 3] == 10 && rData[j1 + 4] == 82 && rData[j1 + 5] == 73 && rData[j1 + 6] == 70 && rData[j1 + 7] == 70) + { + flag = true; + j1 += 4; + break; + } + j1++; + } while(true); + Thread.currentThread(); + Thread.sleep(3L); + } while(nRead != -1 && !flag); + long l = (long)rData[j1 + 24] + ((long)rData[j1 + 25] << 8) + ((long)rData[j1 + 26] << 16) + ((long)rData[j1 + 27] << 24); + int k = rData[j1 + 22] + (rData[j1 + 23] << 8); + int i1 = rData[j1 + 34] + (rData[j1 + 35] << 8); + j1 += 44; + soundFormat = new AudioFormat(l, i1, k, true, false); + info = new javax.sound.sampled.DataLine.Info(javax/sound/sampled/SourceDataLine, soundFormat, InternalBufferSize); + line = (SourceDataLine)AudioSystem.getLine(info); + line.open(soundFormat, InternalBufferSize); + int k1 = line.getBufferSize(); + mute_start_time = System.currentTimeMillis(); + int l1 = rData[j1 + 63] << 8 + rData[j1 + 62]; + nRead = 0; + int i2 = k * 256; + retry = 0; + do + { + if(nRead == -1 || !ThreadRun) + break; + if(mute_start_time != 0L) + { + if(System.currentTimeMillis() - mute_start_time > 1000L) + { + line.start(); + mute_start_time = 0L; + } else + { + m_soundInput.read(rData, 0, rData.length); + } + Thread.currentThread(); + Thread.sleep(50L); + } else + { + Thread.currentThread(); + Thread.sleep(8L); + nRead = m_soundInput.read(rData, 0, rData.length); + if(nRead > 0 && (k1 - line.available()) / i2 < 50) + if(line.available() >= nRead) + line.write(rData, 0, nRead); + else + line.flush(); + } + } while(true); + } + catch(Exception exception) + { + System.err.println(exception); + } + try + { + line.flush(); + line.stop(); + line.close(); + line = null; + soundFormat = null; + info = null; + m_soundInput.close(); + m_soundOutput.close(); + m_sktSound.close(); + m_soundInput = null; + m_soundOutput = null; + m_sktSound = null; + } + catch(Exception exception1) + { + System.err.println(exception1); + } + } while(true); + } + + int ExternalBufferSize; + int InternalBufferSize; + SourceDataLine line; + String sTmp; + Socket m_sktSound; + DataInputStream m_soundInput; + DataOutputStream m_soundOutput; + AudioFormat soundFormat; + javax.sound.sampled.DataLine.Info info; + int nRead; + int retry; + byte rData[]; + byte m_GetSoundString[]; + String realm; + String qop; + String nonce; + final sounddb this$0; + + AU() + { + this$0 = sounddb.this; + super(); + ExternalBufferSize = 64000; + InternalBufferSize = 64000; + line = null; + sTmp = null; + m_sktSound = null; + m_soundInput = null; + m_soundOutput = null; + soundFormat = null; + info = null; + nRead = 0; + retry = 0; + rData = new byte[ExternalBufferSize]; + realm = null; + qop = null; + nonce = null; + } + } + + + public sounddb() + { + serverAddress = null; + db_val = new int[17]; + detection_level = 85; + ThreadRun = false; + algorithm = 0; + nc = 1; + mute_start_time = 0L; + } + + public void init() + { + try + { + if(getParameter("RemoteHost") != null) + { + m_sRemoteHost = getParameter("RemoteHost"); + } else + { + m_urlRemoteHost = getCodeBase(); + m_sRemoteHost = m_urlRemoteHost.getHost(); + } + m_iRemotePort = Integer.valueOf(getParameter("RemotePort")); + m_sPassword = getParameter("DeviceSerialNo"); + if(getParameter("DetectionLevel") != null) + detection_level = Integer.parseInt(getParameter("DetectionLevel")); + if(getParameter("Algorithm") != null) + algorithm = Integer.parseInt(getParameter("Algorithm")); + } + catch(Exception exception) + { + System.err.println(exception); + } + } + + public void run() + { + Thread thread = Thread.currentThread(); + for(int i = 0; i < 17; i++) + db_val[i] = 0; + + boolean flag = false; + byte abyte0[] = new byte[512]; + byte abyte1[] = new byte[512]; + Object obj = null; + Object obj1 = null; + Object obj2 = null; + Object obj3 = null; + while(ThreadRun) + try + { + String s = new String("GET /sounddb.cgi HTTP/1.0\r\nUser-Agent: user\r\nAuthorization: Basic "); + s = s.concat(m_sPassword); + s = s.concat("\r\n\r\n"); + byte abyte2[] = s.getBytes("8859_1"); + Socket socket; + if(m_iRemotePort.intValue() == 8481 || m_iRemotePort.intValue() == 80) + socket = new Socket(m_sRemoteHost, 80); + else + socket = new Socket(m_sRemoteHost, m_iRemotePort.intValue()); + socket.setSoTimeout(10000); + socket.setKeepAlive(true); + DataInputStream datainputstream = new DataInputStream(socket.getInputStream()); + DataOutputStream dataoutputstream = new DataOutputStream(socket.getOutputStream()); + dataoutputstream.write(abyte2); + int k; + while((k = datainputstream.read(abyte0, 0, 256)) >= 0) + { + if(k == 1) + { + for(int j = 16; j > 0; j--) + db_val[j] = db_val[j - 1]; + + db_val[0] = abyte0[0]; + if(db_val[0] > 100) + db_val[0] = 100; + if(db_val[0] < 0) + db_val[0] = 0; + repaint(); + } + if(db_val[0] >= detection_level) + Toolkit.getDefaultToolkit().beep(); + thread; + Thread.sleep(500L); + } + datainputstream.close(); + dataoutputstream.close(); + socket.close(); + datainputstream = null; + dataoutputstream = null; + socket = null; + } + catch(Exception exception) + { + exception.printStackTrace(); + } + finally + { + throw exception1; + } + } + + public void start() + { + ThreadRun = true; + m_trdCameraSound = new AU(); + m_trdCameraSound.start(); + m_sounddb = new Thread(this); + m_sounddb.start(); + } + + public void Stop() + { + ThreadRun = false; + } + + public void destroy() + { + ThreadRun = false; + } + + public void paint(Graphics g) + { + g.setColor(Color.black); + g.fillRect(0, 0, 576, 240); + g.setColor(Color.gray); + for(int i = 0; i < 6; i++) + g.drawLine(30, i * 40, 575, i * 40); + + g.setColor(Color.lightGray); + g.fillRect(30, 0, 2, 240); + g.fillRect(30, 238, 546, 2); + g.drawString("100", 2, 10); + g.drawString("90", 8, 45); + g.drawString("80", 8, 85); + g.drawString("70", 8, 125); + g.drawString("60", 8, 165); + g.drawString("50", 8, 205); + g.drawString("40", 8, 235); + for(int j = 0; j < 17; j++) + { + if(db_val[j] <= 40) + continue; + if(db_val[j] >= detection_level) + g.setColor(Color.magenta); + else + g.setColor(Color.blue); + g.fillRect(32 + j * 32, 240 - (db_val[j] - 40) * 4, 30, (db_val[j] - 40) * 4 - 2); + } + + g.setColor(Color.red); + if(detection_level >= 100) + g.drawLine(32, 0, 576, 0); + else + if(detection_level <= 40) + g.drawLine(32, 238, 576, 238); + else + g.drawLine(32, 240 - (detection_level - 40) * 4, 576, 240 - (detection_level - 40) * 4); + } + + public void update(Graphics g) + { + paint(g); + } + + public String CvtHex(byte abyte0[]) + { + byte abyte1[] = new byte[abyte0.length * 2]; + for(int i = 0; i < abyte0.length; i++) + { + byte byte0 = (byte)(abyte0[i] >> 4 & 0xf); + if(byte0 <= 9) + abyte1[i * 2] = (byte)(byte0 + 48); + else + abyte1[i * 2] = (byte)((byte0 + 97) - 10); + byte0 = (byte)(abyte0[i] & 0xf); + if(byte0 <= 9) + abyte1[i * 2 + 1] = (byte)(byte0 + 48); + else + abyte1[i * 2 + 1] = (byte)((byte0 + 97) - 10); + } + + return new String(abyte1); + } + + public String decode_base64(byte abyte0[], int i) + { + byte abyte1[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".getBytes(); + byte abyte2[] = new byte[4]; + int j = i % 4; + if(j != 0) + return null; + int k1 = 0; + j = 0; + int k = i / 4; + byte abyte3[] = new byte[k * 3]; + for(int l = 0; l < k; l++) + { + for(int i1 = 0; i1 < 4; i1++) + { + if(abyte0[k1] == 61) + { + abyte2[i1] = 0; + j++; + } else + { + int j1 = 0; + do + { + if(j1 >= 64) + break; + if(abyte0[k1] == abyte1[j1]) + { + abyte2[i1] = (byte)j1; + break; + } + j1++; + } while(true); + } + k1++; + } + + abyte3[l * 3] = (byte)((byte)(abyte2[0] << 2 & 0xfc) | (byte)(abyte2[1] >> 4 & 3)); + abyte3[l * 3 + 1] = (byte)((byte)(abyte2[1] << 4 & 0xf0) | (byte)(abyte2[2] >> 2 & 0xf)); + abyte3[l * 3 + 2] = (byte)((byte)(abyte2[2] << 6 & 0xc0) | abyte2[3]); + } + + return new String(abyte3); + } + + public String GetDigestAuthentication(String s, String s1, String s2, String s3) + { + String s4 = null; + String s5 = null; + String s6 = null; + String s7 = null; + String s8 = null; + String s9 = new String("GET"); + String s10 = decode_base64(m_sPassword.getBytes(), m_sPassword.length()); + s5 = s10.substring(0, s10.indexOf(':')); + if(s10.indexOf('\0') >= 0) + s6 = s10.substring(s10.indexOf(':') + 1, s10.indexOf('\0')); + else + s6 = s10.substring(s10.indexOf(':') + 1); + Random random = new Random(); + byte abyte0[] = new byte[16]; + random.nextBytes(abyte0); + s7 = CvtHex(abyte0); + s8 = String.format("%1$08X", new Object[] { + Integer.valueOf(nc) + }); + nc++; + try + { + MessageDigest messagedigest = MessageDigest.getInstance("MD5"); + messagedigest.update(s5.getBytes()); + messagedigest.update((byte)58); + messagedigest.update(s1.getBytes()); + messagedigest.update((byte)58); + messagedigest.update(s6.getBytes()); + String s12 = CvtHex(messagedigest.digest()); + messagedigest.reset(); + messagedigest.update(s9.getBytes()); + messagedigest.update((byte)58); + messagedigest.update(s.getBytes()); + String s13 = CvtHex(messagedigest.digest()); + messagedigest.reset(); + messagedigest.update(s12.getBytes()); + messagedigest.update((byte)58); + messagedigest.update(s3.getBytes()); + messagedigest.update((byte)58); + if(s2.length() > 0) + { + messagedigest.update(s8.getBytes()); + messagedigest.update((byte)58); + messagedigest.update(s7.getBytes()); + messagedigest.update((byte)58); + messagedigest.update(s2.getBytes()); + messagedigest.update((byte)58); + } + messagedigest.update(s13.getBytes()); + s4 = CvtHex(messagedigest.digest()); + } + catch(Exception exception) + { + exception.printStackTrace(); + } + String s11 = String.format("Digest username=\"%1$s\", realm=\"%2$s\", uri=\"%3$s\", algorithm=MD5, nonce=\"%4$s\", cnonce=\"%5$s\", qop=%6$s, nc=%7$s, response=\"%8$s\"", new Object[] { + s5, s1, s, s3, s7, s2, s8, s4 + }); + return s11; + } + + private Thread m_sounddb; + private String m_sRemoteHost; + private URL m_urlRemoteHost; + private Integer m_iRemotePort; + private String m_sPassword; + private URL serverAddress; + private int db_val[]; + private int detection_level; + private boolean ThreadRun; + private int algorithm; + private int nc; + private AU m_trdCameraSound; + private long mute_start_time; + + + + + + + +} diff --git a/verb/fs.etc_ro.web/api/sounddb/sounddb.jar b/verb/fs.etc_ro.web/api/sounddb/sounddb.jar new file mode 100644 index 0000000..423150a Binary files /dev/null and b/verb/fs.etc_ro.web/api/sounddb/sounddb.jar differ diff --git a/verb/fs.etc_ro.web/cgi/audiocfg.cgi b/verb/fs.etc_ro.web/cgi/audiocfg.cgi new file mode 100644 index 0000000..8ccfa57 --- /dev/null +++ b/verb/fs.etc_ro.web/cgi/audiocfg.cgi @@ -0,0 +1,2 @@ +AudioEnable=%%AudioEnable();%% +AudioVolume=%%AudioVolume();%% diff --git a/verb/fs.etc_ro.web/cgi/cgiversion.cgi b/verb/fs.etc_ro.web/cgi/cgiversion.cgi new file mode 100644 index 0000000..ef50b3d --- /dev/null +++ b/verb/fs.etc_ro.web/cgi/cgiversion.cgi @@ -0,0 +1 @@ +CGIVersion=%%CGIVersion();%% diff --git a/verb/fs.etc_ro.web/cgi/common.cgi b/verb/fs.etc_ro.web/cgi/common.cgi new file mode 100644 index 0000000..2870cce --- /dev/null +++ b/verb/fs.etc_ro.web/cgi/common.cgi @@ -0,0 +1,17 @@ +model=%%ModelName();%% +brand=%%Company();%% +version=%%FirmwareVersion();%% +build=%%FirmwareVersion(2);%% +hw_version=%%HardwareVersion(2);%% +name=%%CameraName();%% +location=%%Location();%% +macaddr=%%MACAddress(2);%% +ipaddr=%%CurrentIPAddress();%% +netmask=%%CurrentSubnetMask();%% +gateway=%%CurrentDefaultGateway();%% +wireless=%%WirelessSupport();%% +ptz=%%PTZSupport();%% +inputs=0 +outputs=0 +speaker=no +videoout=no diff --git a/verb/fs.etc_ro.web/cgi/datetime.cgi b/verb/fs.etc_ro.web/cgi/datetime.cgi new file mode 100644 index 0000000..eb42455 --- /dev/null +++ b/verb/fs.etc_ro.web/cgi/datetime.cgi @@ -0,0 +1,17 @@ +DateTimeMode=%%DateTimeMode();%% +TimeServerIPAddress=%%TimeServerIPAddress();%% +TimeServerProtocol=%%TimeServerProtocol();%% +TimeZone=%%TimeZone();%% +TimeZoneIndex=%%TimeZoneIndex();%% +Date=%%Date();%% +Time=%%Time();%% +DSTEnable=%%DSTEnable();%% +DSTOffset=%%DSTOffset();%% +DSTStartMonth=%%DSTStartMonth();%% +DSTStartWeek=%%DSTStartWeek();%% +DSTStartDay=%%DSTStartDay();%% +DSTStartTime=%%DSTStartTime();%% +DSTEndMonth=%%DSTEndMonth();%% +DSTEndWeek=%%DSTEndWeek();%% +DSTEndDay=%%DSTEndDay();%% +DSTEndTime=%%DSTEndTime();%% diff --git a/verb/fs.etc_ro.web/cgi/daynight.cgi b/verb/fs.etc_ro.web/cgi/daynight.cgi new file mode 100644 index 0000000..944b4f7 --- /dev/null +++ b/verb/fs.etc_ro.web/cgi/daynight.cgi @@ -0,0 +1,16 @@ +DayNightMode=%%DayNightMode();%% +LightSensorControl=%%LightSensorControl();%% +IRLedScheduleSunStart=%%IRLedScheduleSunStart();%% +IRLedScheduleSunEnd=%%IRLedScheduleSunEnd();%% +IRLedScheduleMonStart=%%IRLedScheduleMonStart();%% +IRLedScheduleMonEnd=%%IRLedScheduleMonEnd();%% +IRLedScheduleTueStart=%%IRLedScheduleTueStart();%% +IRLedScheduleTueEnd=%%IRLedScheduleTueEnd();%% +IRLedScheduleWedStart=%%IRLedScheduleWedStart();%% +IRLedScheduleWedEnd=%%IRLedScheduleWedEnd();%% +IRLedScheduleThuStart=%%IRLedScheduleThuStart();%% +IRLedScheduleThuEnd=%%IRLedScheduleThuEnd();%% +IRLedScheduleFriStart=%%IRLedScheduleFriStart();%% +IRLedScheduleFriEnd=%%IRLedScheduleFriEnd();%% +IRLedScheduleSatStart=%%IRLedScheduleSatStart();%% +IRLedScheduleSatEnd=%%IRLedScheduleSatEnd();%% diff --git a/verb/fs.etc_ro.web/cgi/dbglevel.cgi b/verb/fs.etc_ro.web/cgi/dbglevel.cgi new file mode 100644 index 0000000..141faed --- /dev/null +++ b/verb/fs.etc_ro.web/cgi/dbglevel.cgi @@ -0,0 +1 @@ +WebDebugLevel=%%WebDebugLevel();%% diff --git a/verb/fs.etc_ro.web/cgi/email.cgi b/verb/fs.etc_ro.web/cgi/email.cgi new file mode 100644 index 0000000..27e68ac --- /dev/null +++ b/verb/fs.etc_ro.web/cgi/email.cgi @@ -0,0 +1,15 @@ +EmailSMTPServerAddress=%%EmailSMTPServerAddress();%% +EmailSMTPPortNumber=%%EmailSMTPPortNumber();%% +EmailSenderAddress=%%EmailSenderAddress();%% +EmailReceiverAddress=%%EmailReceiverAddress();%% +EmailUserName=%%EmailUserName();%% +EmailPassword=%%EmailPassword();%% +EmailTLSAuthentication=%%EmailTLSAuthentication();%% +EmailScheduleEnable=%%EmailScheduleEnable();%% +EmailScheduleMode=%%EmailScheduleMode();%% +EmailScheduleDay=%%EmailScheduleDay();%% +EmailScheduleTimeStart=%%EmailScheduleTimeStart();%% +EmailScheduleTimeStop=%%EmailScheduleTimeStop();%% +EmailScheduleInterval=%%EmailScheduleInterval();%% +EmailMotionMode=%%EmailMotionMode();%% +EmailMotionFrameInterval=%%EmailMotionFrameInterval();%% diff --git a/verb/fs.etc_ro.web/cgi/iactiveuser.cgi b/verb/fs.etc_ro.web/cgi/iactiveuser.cgi new file mode 100644 index 0000000..b64798b --- /dev/null +++ b/verb/fs.etc_ro.web/cgi/iactiveuser.cgi @@ -0,0 +1 @@ +%%ActiveUserTable(1);%% diff --git a/verb/fs.etc_ro.web/cgi/iaudio.cgi b/verb/fs.etc_ro.web/cgi/iaudio.cgi new file mode 100644 index 0000000..e8f153f --- /dev/null +++ b/verb/fs.etc_ro.web/cgi/iaudio.cgi @@ -0,0 +1,4 @@ +Audio=%%AudioEnable();%% +Volume=%%AudioVolume();%% +Codec=%%AudioCodec();%% +SampleRate=%%AudioSampleRate();%% diff --git a/verb/fs.etc_ro.web/cgi/iimage.cgi b/verb/fs.etc_ro.web/cgi/iimage.cgi new file mode 100644 index 0000000..d96940c --- /dev/null +++ b/verb/fs.etc_ro.web/cgi/iimage.cgi @@ -0,0 +1,6 @@ +VideoResolution=%%StringOfVideoResolution();%% +CompressionRate=%%StringOfCompressionRate();%% +FrameRate=%%StringOfFrameRate();%% +ViewMode=%%ViewMode();%% +FrameSize=%%FrameSize();%% Bytes +LightFrequency=%%StringOfLightFrequency();%% diff --git a/verb/fs.etc_ro.web/cgi/image.cgi b/verb/fs.etc_ro.web/cgi/image.cgi new file mode 100644 index 0000000..c1c6db7 --- /dev/null +++ b/verb/fs.etc_ro.web/cgi/image.cgi @@ -0,0 +1,10 @@ +VideoResolution=%%VideoResolution();%% +CompressionRate=%%CompressionRate();%% +FrameRate=%%FrameRate();%% +ViewMode=%%ViewMode();%% +BrightnessControl=%%BrightnessControl();%% +ContrastControl=%%ContrastControl();%% +SaturationControl=%%SaturationControl();%% +LightFrequency=%%LightFrequency();%% +Mirror=%%Mirror();%% +AntiFlickerEnable=%%AntiFlickerEnable();%% diff --git a/verb/fs.etc_ro.web/cgi/inetwork.cgi b/verb/fs.etc_ro.web/cgi/inetwork.cgi new file mode 100644 index 0000000..25687af --- /dev/null +++ b/verb/fs.etc_ro.web/cgi/inetwork.cgi @@ -0,0 +1,11 @@ +IPAddress=%%CurrentIPAddress();%% +SubnetMask=%%CurrentSubnetMask();%% +DefaultGateway=%%CurrentDefaultGateway();%% +PrimaryDNSAddress=%%DNSIPAddress1();%% +SecondaryDNSAddress=%%DNSIPAddress2();%% +DynamicDNS=%%StatusOfDynamicDNS();%% +SecondaryHTTPPort=%%StringOfSecondHTTPPortEnable();%% (Port : %%SecondHTTPPort();%%) +UPnP=%%StringOfUPnPEnable();%% (IP : %%GotIPFromUpnp();%%) +UPnPPortForwarding=%%StatusOfUPnPPortForwarding();%% +BonjourEnable=%%StringOfBonjourEnable();%% +BonjourName=%%BonjourName();%% \ No newline at end of file diff --git a/verb/fs.etc_ro.web/cgi/isysdevice.cgi b/verb/fs.etc_ro.web/cgi/isysdevice.cgi new file mode 100644 index 0000000..d59e3eb --- /dev/null +++ b/verb/fs.etc_ro.web/cgi/isysdevice.cgi @@ -0,0 +1,13 @@ +Model=%%ModelName();%% +ModelDesc=%%ModelDescription();%% +FirmwareVersion=%%FirmwareVersion();%% (%%ReleaseDate();%%) +HarwareVersion=%%HardwareVersion();%% +ROMVersion=%%ROMVersion();%% +Company=%%Company();%% +CompanyURL=%%CompanyURL();%% + +MACAddress=%%MACAddress();%% +IPAddress=%%CurrentIPAddress();%% +EthernetLink=%%EthernetLink();%% +EthernetSpeed=%%EthernetSpeed();%% bps +EthernetDuplex=%%EthernetDuplex();%% diff --git a/verb/fs.etc_ro.web/cgi/isystem.cgi b/verb/fs.etc_ro.web/cgi/isystem.cgi new file mode 100644 index 0000000..9e78cd8 --- /dev/null +++ b/verb/fs.etc_ro.web/cgi/isystem.cgi @@ -0,0 +1,10 @@ +CameraName=%%CameraName();%% +Location=%%Location();%% +Model=%%ModelName();%% +FirmwareVersion=%%FirmwareVersion();%% (%%ReleaseDate();%%) +HardwareVersion=%%HardwareVersion(2);%% +MACAddress=%%MACAddress();%% +IPAddress=%%CurrentIPAddress();%% +EthernetLink=%%EthernetLink();%% +EthernetSpeed=%%EthernetSpeed();%% bps +EthernetDuplex=%%EthernetDuplex();%% diff --git a/verb/fs.etc_ro.web/cgi/iwireless.cgi b/verb/fs.etc_ro.web/cgi/iwireless.cgi new file mode 100644 index 0000000..d71cc8e --- /dev/null +++ b/verb/fs.etc_ro.web/cgi/iwireless.cgi @@ -0,0 +1,6 @@ +ConnectionMode=%%StringOfConnectionMode();%% +WirelessLink=%%WirelessLink();%% +SSID=%%WirelessCurrentSSID();%% (MAC : %%WirelessCurrentAPMACAddress();%%) +WirelessChannel=%%WirelessCurrentChannel();%% +TransmissionRate=%%WirelessCurrentTransmissionRate();%% +WEPEncryption=%%WirelessCurrentEncryption();%% diff --git a/verb/fs.etc_ro.web/cgi/motion.cgi b/verb/fs.etc_ro.web/cgi/motion.cgi new file mode 100644 index 0000000..3d822f4 --- /dev/null +++ b/verb/fs.etc_ro.web/cgi/motion.cgi @@ -0,0 +1,7 @@ +MotionDetectionEnable=%%MotionDetectionEnable();%% +MotionDetectionBlockSet=%%MotionDetectionBlockSet();%% +MotionDetectionSensitivity=%%MotionDetectionSensitivity();%% +MotionDetectionScheduleMode=%%MotionDetectionScheduleMode();%% +MotionDetectionScheduleDay=%%MotionDetectionScheduleDay();%% +MotionDetectionScheduleTimeStart=%%MotionDetectionScheduleTimeStart();%% +MotionDetectionScheduleTimeStop=%%MotionDetectionScheduleTimeStop();%% diff --git a/verb/fs.etc_ro.web/cgi/network.cgi b/verb/fs.etc_ro.web/cgi/network.cgi new file mode 100644 index 0000000..9fa8a5e --- /dev/null +++ b/verb/fs.etc_ro.web/cgi/network.cgi @@ -0,0 +1,19 @@ +IPAddressMode=%%IPAddressMode();%% +IPAddress=%%IPAddress();%% +SubnetMask=%%SubnetMask();%% +DefaultGateway=%%DefaultGateway();%% +PPPoEUserID=%%PPPoEUserID();%% +PPPoEPassword=%%PPPoEPassword();%% +DNSIPAddress1=%%DNSIPAddress1();%% +DNSIPAddress2=%%DNSIPAddress2();%% +DDNSEnable=%%DDNSEnable();%% +DDNSProvider=%%DDNSProvider();%% +DDNSHostName=%%DDNSHostName();%% +DDNSUserName=%%DDNSUserName();%% +DDNSPassword=%%DDNSPassword();%% +SecondHTTPPortEnable=%%SecondHTTPPortEnable();%% +SecondHTTPPort=%%SecondHTTPPort();%% +UPnPEnable=%%UPnPEnable();%% +UPnPPortForwarding=%%UPnPPortForwarding();%% +BonjourEnable=%%BonjourEnable();%% +BonjourName=%%BonjourName();%% \ No newline at end of file diff --git a/verb/fs.etc_ro.web/cgi/sdbdetection.cgi b/verb/fs.etc_ro.web/cgi/sdbdetection.cgi new file mode 100644 index 0000000..fc98d47 --- /dev/null +++ b/verb/fs.etc_ro.web/cgi/sdbdetection.cgi @@ -0,0 +1,6 @@ +SoundDetectionEnable=%%SoundDetectionEnable();%% +SoundDetectionDB=%%SoundDetectionDB();%% +SoundDetectionScheduleMode=%%SoundDetectionScheduleMode();%% +SoundDetectionScheduleDay=%%SoundDetectionScheduleDay();%% +SoundDetectionScheduleTimeStart=%%SoundDetectionScheduleTimeStart();%% +SoundDetectionScheduleTimeStop=%%SoundDetectionScheduleTimeStop();%% \ No newline at end of file diff --git a/verb/fs.etc_ro.web/cgi/sitesurvey.cgi b/verb/fs.etc_ro.web/cgi/sitesurvey.cgi new file mode 100644 index 0000000..2fc4d88 --- /dev/null +++ b/verb/fs.etc_ro.web/cgi/sitesurvey.cgi @@ -0,0 +1 @@ +%%SiteSurveyList();%% \ No newline at end of file diff --git a/verb/fs.etc_ro.web/cgi/strminfo.cgi b/verb/fs.etc_ro.web/cgi/strminfo.cgi new file mode 100644 index 0000000..fd75931 --- /dev/null +++ b/verb/fs.etc_ro.web/cgi/strminfo.cgi @@ -0,0 +1,11 @@ +videos=MJPEG +resolutions=640x480,320x240,160x120 +vprofilenum=1 +vprofile1=MJPEG +vprofileurl1=/video.cgi +vprofileres1=%%StringOfVideoResolution();%% +vDprofileurl1=/dgvideo.cgi +aprofilenum=1 +aprofile1=PCM +aprofileurl1=/audio.cgi +aDprofileurl1=/dgaudio.cgi diff --git a/verb/fs.etc_ro.web/cgi/system.cgi b/verb/fs.etc_ro.web/cgi/system.cgi new file mode 100644 index 0000000..4d23264 --- /dev/null +++ b/verb/fs.etc_ro.web/cgi/system.cgi @@ -0,0 +1,6 @@ +CameraName=%%CameraName();%% +Location=%%Location();%% +AdminID=%%AdminID();%% +AdminPassword=%%AdminPassword();%% +LEDControl=%%LEDControl();%% +SnapshotURLAuthentication=%%SnapshotURLAuthentication();%% \ No newline at end of file diff --git a/verb/fs.etc_ro.web/cgi/upgradestatus.cgi b/verb/fs.etc_ro.web/cgi/upgradestatus.cgi new file mode 100644 index 0000000..df08eb9 --- /dev/null +++ b/verb/fs.etc_ro.web/cgi/upgradestatus.cgi @@ -0,0 +1 @@ +upgrade=%%LastDownloadStatus();%% diff --git a/verb/fs.etc_ro.web/cgi/upload.cgi b/verb/fs.etc_ro.web/cgi/upload.cgi new file mode 100644 index 0000000..15843d3 --- /dev/null +++ b/verb/fs.etc_ro.web/cgi/upload.cgi @@ -0,0 +1,18 @@ +FTPHostAddress=%%FTPHostAddress();%% +FTPPortNumber=%%FTPPortNumber();%% +FTPUserName=%%FTPUserName();%% +FTPPassword=%%FTPPassword();%% +FTPDirectoryPath=%%FTPDirectoryPath();%% +FTPPassiveMode=%%FTPPassiveMode();%% +FTPScheduleEnable=%%FTPScheduleEnable();%% +FTPScheduleMode=%%FTPScheduleMode();%% +FTPScheduleDay=%%FTPScheduleDay();%% +FTPScheduleTimeStart=%%FTPScheduleTimeStart();%% +FTPScheduleTimeStop=%%FTPScheduleTimeStop();%% +FTPScheduleVideoFrequencyMode=%%FTPScheduleVideoFrequencyMode();%% +FTPScheduleFramePerSecond=%%FTPScheduleFramePerSecond();%% +FTPScheduleSecondPerFrame=%%FTPScheduleSecondPerFrame();%% +FTPScheduleBaseFileName=%%FTPScheduleBaseFileName();%% +FTPScheduleFileMode=%%FTPScheduleFileMode();%% +FTPScheduleMaxFileSequenceNumber=%%FTPScheduleMaxFileSequenceNumber();%% +FTPCreateFolderInterval=%%FTPCreateFolderInterval();%% diff --git a/verb/fs.etc_ro.web/cgi/user.cgi b/verb/fs.etc_ro.web/cgi/user.cgi new file mode 100644 index 0000000..fc02c5c --- /dev/null +++ b/verb/fs.etc_ro.web/cgi/user.cgi @@ -0,0 +1 @@ +AccessControlEnable=%%AccessControlEnable();%% diff --git a/verb/fs.etc_ro.web/cgi/userlist.cgi b/verb/fs.etc_ro.web/cgi/userlist.cgi new file mode 100644 index 0000000..1220d10 --- /dev/null +++ b/verb/fs.etc_ro.web/cgi/userlist.cgi @@ -0,0 +1 @@ +%%UserTable(1);%% diff --git a/verb/fs.etc_ro.web/cgi/usermod.cgi b/verb/fs.etc_ro.web/cgi/usermod.cgi new file mode 100644 index 0000000..96517e0 --- /dev/null +++ b/verb/fs.etc_ro.web/cgi/usermod.cgi @@ -0,0 +1,3 @@ +name=%%ModName();%% +password=%%ModPassword();%% +group=%%ModGroup();%% diff --git a/verb/fs.etc_ro.web/cgi/wireless.cgi b/verb/fs.etc_ro.web/cgi/wireless.cgi new file mode 100644 index 0000000..4ac7112 --- /dev/null +++ b/verb/fs.etc_ro.web/cgi/wireless.cgi @@ -0,0 +1,16 @@ +WirelessDisable=%%WirelessDisable();%% +ConnectionMode=%%ConnectionMode();%% +SSID=%%SSID();%% +WirelessChannel=%%WirelessChannel();%% +TransmissionRate=%%StringOfTransmissionRate();%% +WEPEncryption=%%WEPEncryption();%% +WEPKeyFormat=%%WEPKeyFormat();%% +Key1=%%Key1();%% +Key2=%%Key2();%% +Key3=%%Key3();%% +Key4=%%Key4();%% +TxKey=%%TxKey();%% +BeaconInterval=%%BeaconInterval();%% +Preamble=%%Preamble();%% +AuthenticationType=%%AuthenticationType();%% +PreSharedKey=%%PreSharedKey();%% diff --git a/verb/fs.etc_ro.web/dcs932lb2.jpg b/verb/fs.etc_ro.web/dcs932lb2.jpg new file mode 100644 index 0000000..ee00df0 Binary files /dev/null and b/verb/fs.etc_ro.web/dcs932lb2.jpg differ diff --git a/verb/fs.etc_ro.web/devmodel.jpg b/verb/fs.etc_ro.web/devmodel.jpg new file mode 100644 index 0000000..736d83c Binary files /dev/null and b/verb/fs.etc_ro.web/devmodel.jpg differ diff --git a/verb/fs.etc_ro.web/dloadbar.gif b/verb/fs.etc_ro.web/dloadbar.gif new file mode 100644 index 0000000..35117d5 Binary files /dev/null and b/verb/fs.etc_ro.web/dloadbar.gif differ diff --git a/verb/fs.etc_ro.web/edit.jpg b/verb/fs.etc_ro.web/edit.jpg new file mode 100644 index 0000000..24a3ef7 Binary files /dev/null and b/verb/fs.etc_ro.web/edit.jpg differ diff --git a/verb/fs.etc_ro.web/favicon.ico b/verb/fs.etc_ro.web/favicon.ico new file mode 100644 index 0000000..d577080 Binary files /dev/null and b/verb/fs.etc_ro.web/favicon.ico differ diff --git a/verb/binary/attemp2/fs/cpio/etc_ro/web/pack/cht.lzma b/verb/fs.etc_ro.web/pack/cht.lzma similarity index 100% rename from verb/binary/attemp2/fs/cpio/etc_ro/web/pack/cht.lzma rename to verb/fs.etc_ro.web/pack/cht.lzma diff --git a/verb/binary/attemp2/fs/cpio/etc_ro/web/pack/dbgulf.lzma b/verb/fs.etc_ro.web/pack/dbgulf.lzma similarity index 100% rename from verb/binary/attemp2/fs/cpio/etc_ro/web/pack/dbgulf.lzma rename to verb/fs.etc_ro.web/pack/dbgulf.lzma diff --git a/verb/binary/attemp2/fs/cpio/etc_ro/web/pack/eng.lzma b/verb/fs.etc_ro.web/pack/eng.lzma similarity index 100% rename from verb/binary/attemp2/fs/cpio/etc_ro/web/pack/eng.lzma rename to verb/fs.etc_ro.web/pack/eng.lzma diff --git a/verb/binary/attemp2/fs/cpio/etc_ro/web/pack/frh.lzma b/verb/fs.etc_ro.web/pack/frh.lzma similarity index 100% rename from verb/binary/attemp2/fs/cpio/etc_ro/web/pack/frh.lzma rename to verb/fs.etc_ro.web/pack/frh.lzma diff --git a/verb/binary/attemp2/fs/cpio/etc_ro/web/pack/grm.lzma b/verb/fs.etc_ro.web/pack/grm.lzma similarity index 100% rename from verb/binary/attemp2/fs/cpio/etc_ro/web/pack/grm.lzma rename to verb/fs.etc_ro.web/pack/grm.lzma diff --git a/verb/binary/attemp2/fs/cpio/etc_ro/web/pack/itn.lzma b/verb/fs.etc_ro.web/pack/itn.lzma similarity index 100% rename from verb/binary/attemp2/fs/cpio/etc_ro/web/pack/itn.lzma rename to verb/fs.etc_ro.web/pack/itn.lzma diff --git a/verb/binary/attemp2/fs/cpio/etc_ro/web/pack/kor.lzma b/verb/fs.etc_ro.web/pack/kor.lzma similarity index 100% rename from verb/binary/attemp2/fs/cpio/etc_ro/web/pack/kor.lzma rename to verb/fs.etc_ro.web/pack/kor.lzma diff --git a/verb/binary/attemp2/fs/cpio/etc_ro/web/pack/sph.lzma b/verb/fs.etc_ro.web/pack/sph.lzma similarity index 100% rename from verb/binary/attemp2/fs/cpio/etc_ro/web/pack/sph.lzma rename to verb/fs.etc_ro.web/pack/sph.lzma diff --git a/verb/binary/attemp2/fs/cpio/etc_ro/web/pack/twn.lzma b/verb/fs.etc_ro.web/pack/twn.lzma similarity index 100% rename from verb/binary/attemp2/fs/cpio/etc_ro/web/pack/twn.lzma rename to verb/fs.etc_ro.web/pack/twn.lzma diff --git a/verb/fs.etc_ro.web/radiooff.gif b/verb/fs.etc_ro.web/radiooff.gif new file mode 100644 index 0000000..b246acb Binary files /dev/null and b/verb/fs.etc_ro.web/radiooff.gif differ diff --git a/verb/fs.etc_ro.web/radioon.gif b/verb/fs.etc_ro.web/radioon.gif new file mode 100644 index 0000000..8ebd283 Binary files /dev/null and b/verb/fs.etc_ro.web/radioon.gif differ diff --git a/verb/fs.etc_ro.web/security.gif b/verb/fs.etc_ro.web/security.gif new file mode 100644 index 0000000..6234cf8 Binary files /dev/null and b/verb/fs.etc_ro.web/security.gif differ diff --git a/verb/fs.etc_ro.web/title.gif b/verb/fs.etc_ro.web/title.gif new file mode 100644 index 0000000..a371fad Binary files /dev/null and b/verb/fs.etc_ro.web/title.gif differ diff --git a/verb/fs.etc_ro.web/trash.jpg b/verb/fs.etc_ro.web/trash.jpg new file mode 100644 index 0000000..97c2a48 Binary files /dev/null and b/verb/fs.etc_ro.web/trash.jpg differ diff --git a/verb/fs.etc_ro.web/web/api/aplug.jar b/verb/fs.etc_ro.web/web/api/aplug.jar new file mode 100644 index 0000000..b549b47 Binary files /dev/null and b/verb/fs.etc_ro.web/web/api/aplug.jar differ diff --git a/verb/fs.etc_ro.web/web/api/aplug/META-INF/MANIFEST.MF b/verb/fs.etc_ro.web/web/api/aplug/META-INF/MANIFEST.MF new file mode 100644 index 0000000..b8b1b90 --- /dev/null +++ b/verb/fs.etc_ro.web/web/api/aplug/META-INF/MANIFEST.MF @@ -0,0 +1,29 @@ +Manifest-Version: 1.0 +Application-Name: aplug +Permissions: all-permissions +Created-By: 1.5.0_22 (Sun Microsystems Inc.) +Caller-Allowable-Codebase: * +Main-Class: aplug +Codebase: * + +Name: aplug$Talkie.class +SHA1-Digest: 2aVNEt1UmXZxsGDqKuMWyMSdJNo= + +Name: aplug$TS.class +SHA1-Digest: bcCulMO2JAF/cEyPAaq+MlpJFNY= + +Name: aplug.class +SHA1-Digest: Xq72uaqog4K4CxU+aaRTHI6lnbI= + +Name: aplug$ACS_Control.class +SHA1-Digest: dlTPvwzdBrmN8uHUeUeyV2wKXG0= + +Name: aplug$SI.class +SHA1-Digest: Cf2RT0iFdv2VDDI+DznPMBWi63w= + +Name: aplug$ACS_Audio.class +SHA1-Digest: 0MVKIbdmw41F2CP3X8wlN1o3H0g= + +Name: aplug$AU.class +SHA1-Digest: 6BD9xeWhsDRn6sJ4roR85fvIW3c= + diff --git a/verb/fs.etc_ro.web/web/api/aplug/META-INF/WWW_DLIN.RSA b/verb/fs.etc_ro.web/web/api/aplug/META-INF/WWW_DLIN.RSA new file mode 100644 index 0000000..12e9e75 Binary files /dev/null and b/verb/fs.etc_ro.web/web/api/aplug/META-INF/WWW_DLIN.RSA differ diff --git a/verb/fs.etc_ro.web/web/api/aplug/META-INF/WWW_DLIN.SF b/verb/fs.etc_ro.web/web/api/aplug/META-INF/WWW_DLIN.SF new file mode 100644 index 0000000..ba463e6 --- /dev/null +++ b/verb/fs.etc_ro.web/web/api/aplug/META-INF/WWW_DLIN.SF @@ -0,0 +1,26 @@ +Signature-Version: 1.0 +SHA1-Digest-Manifest-Main-Attributes: UBp7e9hhiW9jTs0aB5k+hWchTpw= +Created-By: 1.6.0_45 (Sun Microsystems Inc.) +SHA1-Digest-Manifest: 1oXVrSmx4HV21apD+8+2AR+RNNI= + +Name: aplug$Talkie.class +SHA1-Digest: EP5wpvCzDUkUzp+/p3+ukV+t+/M= + +Name: aplug$TS.class +SHA1-Digest: KOmQFfuWyt6wZAkJN2gZuXsjQYA= + +Name: aplug.class +SHA1-Digest: 6zuZlxCL+jRUigu/O+yhygmQEMM= + +Name: aplug$ACS_Control.class +SHA1-Digest: G3Cxz5qKFceS3FaAhkrlV+AV3dc= + +Name: aplug$SI.class +SHA1-Digest: 6UqL3yyydR4/ynbgZGVoq2I01fk= + +Name: aplug$ACS_Audio.class +SHA1-Digest: i1cFnbJWe0uE5vHT4vrjCPvYLJ0= + +Name: aplug$AU.class +SHA1-Digest: wYFYPf9xYN37zWkEJ/+DHdoILRo= + diff --git a/verb/fs.etc_ro.web/web/api/aplug/aplug$ACS_Audio.class b/verb/fs.etc_ro.web/web/api/aplug/aplug$ACS_Audio.class new file mode 100644 index 0000000..0807447 Binary files /dev/null and b/verb/fs.etc_ro.web/web/api/aplug/aplug$ACS_Audio.class differ diff --git a/verb/fs.etc_ro.web/web/api/aplug/aplug$ACS_Control.class b/verb/fs.etc_ro.web/web/api/aplug/aplug$ACS_Control.class new file mode 100644 index 0000000..6df2312 Binary files /dev/null and b/verb/fs.etc_ro.web/web/api/aplug/aplug$ACS_Control.class differ diff --git a/verb/fs.etc_ro.web/web/api/aplug/aplug$AU.class b/verb/fs.etc_ro.web/web/api/aplug/aplug$AU.class new file mode 100644 index 0000000..7abb6f8 Binary files /dev/null and b/verb/fs.etc_ro.web/web/api/aplug/aplug$AU.class differ diff --git a/verb/fs.etc_ro.web/web/api/aplug/aplug$SI.class b/verb/fs.etc_ro.web/web/api/aplug/aplug$SI.class new file mode 100644 index 0000000..a13d0d6 Binary files /dev/null and b/verb/fs.etc_ro.web/web/api/aplug/aplug$SI.class differ diff --git a/verb/fs.etc_ro.web/web/api/aplug/aplug$TS.class b/verb/fs.etc_ro.web/web/api/aplug/aplug$TS.class new file mode 100644 index 0000000..9856259 Binary files /dev/null and b/verb/fs.etc_ro.web/web/api/aplug/aplug$TS.class differ diff --git a/verb/fs.etc_ro.web/web/api/aplug/aplug$Talkie.class b/verb/fs.etc_ro.web/web/api/aplug/aplug$Talkie.class new file mode 100644 index 0000000..9004ff2 Binary files /dev/null and b/verb/fs.etc_ro.web/web/api/aplug/aplug$Talkie.class differ diff --git a/verb/fs.etc_ro.web/web/api/aplug/aplug.class b/verb/fs.etc_ro.web/web/api/aplug/aplug.class new file mode 100644 index 0000000..ad79477 Binary files /dev/null and b/verb/fs.etc_ro.web/web/api/aplug/aplug.class differ diff --git a/verb/fs.etc_ro.web/web/api/aplug/aplug.jad b/verb/fs.etc_ro.web/web/api/aplug/aplug.jad new file mode 100644 index 0000000..75c18d2 --- /dev/null +++ b/verb/fs.etc_ro.web/web/api/aplug/aplug.jad @@ -0,0 +1,2409 @@ +// Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. +// Jad home page: http://www.geocities.com/kpdus/jad.html +// Decompiler options: packimports(3) +// Source File Name: aplug.java + +import java.applet.Applet; +import java.awt.*; +import java.awt.event.MouseEvent; +import java.awt.event.MouseListener; +import java.awt.image.MemoryImageSource; +import java.awt.image.PixelGrabber; +import java.io.*; +import java.net.Socket; +import java.net.URL; +import java.nio.ByteBuffer; +import java.nio.ByteOrder; +import java.security.MessageDigest; +import java.util.Date; +import java.util.Random; +import javax.sound.sampled.*; + +public class aplug extends Applet + implements Runnable, MouseListener +{ + class ACS_Audio + { + + void prepare_audio_header(int i) + { + Date date = new Date(); + long l = date.getTime(); + SequenceNumber++; + DataLength = i; + TimeSec = (int)(l / 1000L); + TimeUSec = (int)((l % 1000L) * 1000L); + rec.putInt(0, HdrID); + rec.putInt(4, HdrLength); + rec.putInt(8, DataLength); + rec.putInt(12, SequenceNumber); + rec.putInt(16, TimeSec); + rec.putInt(20, TimeUSec); + rec.putInt(24, DataCheckSum); + rec.putShort(28, Format); + rec.putShort(30, Channels); + rec.putShort(32, SampleRate); + rec.putShort(34, SampleBits); + rec.putInt(36, Reserved); + } + + int HdrID; + int HdrLength; + int DataLength; + int SequenceNumber; + int TimeSec; + int TimeUSec; + int DataCheckSum; + short Format; + short Channels; + short SampleRate; + short SampleBits; + int Reserved; + byte buf[]; + ByteBuffer rec; + final aplug this$0; + + ACS_Audio() + { + this$0 = aplug.this; + super(); + HdrID = 0xf6010000; + HdrLength = 40; + DataLength = 1024; + SequenceNumber = 0; + TimeSec = 0; + TimeUSec = 0; + DataCheckSum = 0; + Format = 16; + Channels = 1; + SampleRate = -21436; + SampleBits = 16; + Reserved = 0; + buf = new byte[1064]; + rec = ByteBuffer.wrap(buf).order(ByteOrder.LITTLE_ENDIAN); + } + } + + class ACS_Control + { + + void prepare_control_header(int i) + { + Date date = new Date(); + long l = date.getTime(); + SequenceNumber++; + ControlCode = DataCheckSum = i; + TimeSec = (int)(l / 1000L); + TimeUSec = (int)((l % 1000L) * 1000L); + rec.putInt(0, HdrID); + rec.putInt(4, HdrLength); + rec.putInt(8, DataLength); + rec.putInt(12, SequenceNumber); + rec.putInt(16, TimeSec); + rec.putInt(20, TimeUSec); + rec.putInt(24, DataCheckSum); + rec.putInt(28, ControlCode); + } + + int HdrID; + int HdrLength; + int DataLength; + int SequenceNumber; + int TimeSec; + int TimeUSec; + int DataCheckSum; + int ControlCode; + byte buf[]; + ByteBuffer rec; + final aplug this$0; + + ACS_Control() + { + this$0 = aplug.this; + super(); + HdrID = 0xf7010000; + HdrLength = 32; + DataLength = 4; + SequenceNumber = 0; + TimeSec = 0; + TimeUSec = 0; + DataCheckSum = 0; + ControlCode = 0; + buf = new byte[32]; + rec = ByteBuffer.wrap(buf).order(ByteOrder.LITTLE_ENDIAN); + } + } + + class Talkie extends Thread + { + + public TargetDataLine GetTDLFromAF(AudioFormat audioformat) + throws OutOfMemoryError + { + Object obj = null; + javax.sound.sampled.DataLine.Info info; + info = new javax.sound.sampled.DataLine.Info(javax/sound/sampled/TargetDataLine, audioformat); + if(AudioSystem.isLineSupported(info)) + break MISSING_BLOCK_LABEL_60; + System.out.println((new StringBuilder()).append("GetTDLFromAF: AudioSystem.isLineSupported(").append(info).append(") = ").append(AudioSystem.isLineSupported(info)).toString()); + return null; + TargetDataLine targetdataline; + try + { + targetdataline = (TargetDataLine)AudioSystem.getLine(info); + if(targetdataline != null) + targetdataline.open(audioformat); + else + System.out.println("GetTDLFromAF: Can not get target data line!"); + } + catch(LineUnavailableException lineunavailableexception) + { + System.out.println((new StringBuilder()).append("GetTDLFromAF: ").append(lineunavailableexception).toString()); + lineunavailableexception.printStackTrace(); + return null; + } + return targetdataline; + } + + public AudioInputStream GetSourceAIS(TargetDataLine targetdataline) + throws OutOfMemoryError + { + Object obj = null; + if(targetdataline == null) + { + return null; + } else + { + AudioInputStream audioinputstream = new AudioInputStream(targetdataline); + return audioinputstream; + } + } + + public int GetAuthentication() + { + Object obj = null; + Object obj1 = null; + Object obj2 = null; + Object obj3 = null; + boolean flag = false; + byte abyte0[] = new byte[1500]; + boolean flag1 = false; + Object obj4 = null; + int i = 0; + try + { + String s = new String("POST /dev2/dgtalkie.cgi HTTP/1.0\r\nContent-length: 0\r\nUser-Agent: user\r\nAuthorization: Basic "); + s = s.concat(m_sPassword); + s = s.concat("\r\n\r\n"); + byte abyte1[] = s.getBytes("8859_1"); + Socket socket; + if(m_iRemotePort.intValue() == 8481 || m_iRemotePort.intValue() == 80) + socket = new Socket(m_sRemoteHost, 80); + else + socket = new Socket(m_sRemoteHost, m_iRemotePort.intValue()); + socket.setSoTimeout(30000); + socket.setKeepAlive(true); + DataInputStream datainputstream = new DataInputStream(socket.getInputStream()); + DataOutputStream dataoutputstream = new DataOutputStream(socket.getOutputStream()); + dataoutputstream.write(abyte1); + BufferedReader bufferedreader = new BufferedReader(new InputStreamReader(socket.getInputStream())); + String s1 = bufferedreader.readLine(); + if(s1 != null && s1.indexOf("HTTP/") >= 0) + if(s1.indexOf("200") >= 0) + i = 0; + else + i = 1; + do + { + String s2; + if((s2 = bufferedreader.readLine()) == null) + break; + if(s2.indexOf("WWW-Authenticate: ") < 0) + continue; + int j = s2.indexOf("realm=") + 7; + int k = s2.indexOf('"', j); + realm = s2.substring(j, k); + j = s2.indexOf("qop=") + 5; + k = s2.indexOf('"', j); + qop = s2.substring(j, k); + j = s2.indexOf("nonce=") + 7; + k = s2.indexOf('"', j); + nonce = s2.substring(j, k); + break; + } while(true); + datainputstream.close(); + dataoutputstream.close(); + bufferedreader.close(); + socket.close(); + datainputstream = null; + dataoutputstream = null; + bufferedreader = null; + socket = null; + } + catch(Exception exception) + { + System.err.println(exception); + i = -1; + } + return i; + } + + public void run() + { + Socket socket; + DataInputStream datainputstream; + DataOutputStream dataoutputstream; + byte abyte0[]; + TargetDataLine targetdataline; + AudioInputStream audioinputstream; + Object obj = null; + socket = null; + datainputstream = null; + dataoutputstream = null; + boolean flag = false; + abyte0 = new byte[1500]; + boolean flag1 = false; + Object obj1 = null; + Object obj3 = null; + Object obj5 = null; + targetdataline = null; + audioinputstream = null; + Object obj6 = null; + if(drawLine) + return; +_L2: + if(!m_bImageThreadRun) + break; /* Loop/switch isn't completed */ + if(!m_AudioOut) + { + Thread.currentThread(); + Thread.sleep(200L); + continue; /* Loop/switch isn't completed */ + } + int j = GetAuthentication(); + if(j < 0) + { + StopAudioOut(); + continue; /* Loop/switch isn't completed */ + } + try + { + String s = new String("POST /dev2/dgtalkie.cgi HTTP/1.0\r\nContent-type: audio/x-wave\r\nContent-length: "); + s = s.concat(Integer.toString(0x77359400, 10)); + s = s.concat("\r\nUser-Agent: user\r\nAuthorization: "); + if(j == 1) + { + String s1 = GetDigestAuthentication("POST", "/dev2/dgtalkie.cgi", realm, qop, nonce); + s = s.concat(s1); + } else + { + s = s.concat("Basic "); + s = s.concat(m_sPassword); + } + s = s.concat("\r\n\r\n"); + byte abyte1[] = s.getBytes("8859_1"); + if(m_iRemotePort.intValue() == 8481 || m_iRemotePort.intValue() == 80) + socket = new Socket(m_sRemoteHost, 80); + else + socket = new Socket(m_sRemoteHost, m_iRemotePort.intValue()); + socket.setSoTimeout(30000); + socket.setKeepAlive(true); + datainputstream = new DataInputStream(socket.getInputStream()); + dataoutputstream = new DataOutputStream(socket.getOutputStream()); + dataoutputstream.write(abyte1); + AudioOutStatus = 1; + acsControl.prepare_control_header(1); + dataoutputstream.write(acsControl.buf, 0, acsControl.buf.length); + dataoutputstream.flush(); + acsControl.prepare_control_header(2); + dataoutputstream.write(acsControl.buf, 0, acsControl.buf.length); + dataoutputstream.flush(); + acsControl.prepare_control_header(4); + dataoutputstream.write(acsControl.buf, 0, acsControl.buf.length); + dataoutputstream.flush(); + AudioFormat audioformat = new AudioFormat(16000F, 16, 1, true, false); + if((targetdataline = GetTDLFromAF(audioformat)) == null) + System.out.println("ReadMicrophoneToIPCam: Can't get Target DataLine."); + else + if((audioinputstream = GetSourceAIS(targetdataline)) == null) + System.out.println("ReadMicrophoneToIPCam: Can't get Source Input Stream."); + if(targetdataline == null || audioinputstream == null) + { + if(targetdataline != null) + targetdataline.close(); + if(audioinputstream != null) + audioinputstream.close(); + m_AudioOut = false; + AudioOutStatus = -3; + throw new Exception("Can't get microphone device."); + } + targetdataline.start(); + int i = 0; + do + { + if(i == -1 || !m_AudioOut) + break; + Thread.currentThread(); + Thread.sleep(10L); + if(audioinputstream.available() >= 1024) + { + acsAudio.prepare_audio_header(1024); + i = audioinputstream.read(acsAudio.buf, acsAudio.HdrLength, 1024); + if(i == 1024) + dataoutputstream.write(acsAudio.buf, 0, acsAudio.buf.length); + } + } while(true); + if(m_AudioOut) + StopAudioOut(); + AudioOutStatus = 0; + acsControl.prepare_control_header(5); + dataoutputstream.write(acsControl.buf, 0, acsControl.buf.length); + acsControl.prepare_control_header(3); + dataoutputstream.write(acsControl.buf, 0, acsControl.buf.length); + acsControl.prepare_control_header(6); + dataoutputstream.write(acsControl.buf, 0, acsControl.buf.length); + datainputstream.read(abyte0, 0, 64); + } + catch(Exception exception) + { + exception.printStackTrace(); + m_AudioOut = false; + mute_start_time = System.currentTimeMillis(); + if(AudioOutStatus >= 0) + AudioOutStatus = -4; + } + try + { + audioinputstream.close(); + targetdataline.close(); + Object obj2 = null; + Object obj4 = null; + datainputstream.close(); + dataoutputstream.close(); + socket.close(); + datainputstream = null; + dataoutputstream = null; + socket = null; + } + catch(Exception exception1) + { + exception1.printStackTrace(); + m_AudioOut = false; + } + if(true) goto _L2; else goto _L1 +_L1: + } + + String realm; + String qop; + String nonce; + final aplug this$0; + + Talkie() + { + this$0 = aplug.this; + super(); + realm = null; + qop = null; + nonce = null; + } + } + + class AU extends Thread + { + + public void run() + { + if(drawLine) + return; + do + { + if(!m_bImageThreadRun) + break; + try + { + if(algorithm == 0 || algorithm == 2) + sTmp = new String("GET /audio.cgi HTTP/1.0\r\nUser-Agent: user\r\nAuthorization: Basic "); + else + sTmp = new String("GET /dgaudio.cgi HTTP/1.0\r\nUser-Agent: user\r\nAuthorization: Basic "); + sTmp = sTmp.concat(m_sPassword); + sTmp = sTmp.concat("\r\n\r\n"); + m_GetSoundString = sTmp.getBytes("8859_1"); + do + { + Thread.currentThread(); + Thread.sleep(100L); + if(m_iRemotePort.intValue() == 8481 || m_iRemotePort.intValue() == 80) + m_sktSound = new Socket(m_sRemoteHost, 80); + else + m_sktSound = new Socket(m_sRemoteHost, m_iRemotePort.intValue()); + m_sktSound.setSoTimeout(30000); + m_sktSound.setKeepAlive(true); + m_soundInput = new DataInputStream(m_sktSound.getInputStream()); + m_soundOutput = new DataOutputStream(m_sktSound.getOutputStream()); + m_soundOutput.write(m_GetSoundString); + m_soundInput.read(rData, 0, 64); + String s = new String(rData, 0, 64); + if(s != null && s.indexOf("HTTP/") >= 0) + { + if(s.indexOf("200") >= 0) + break; + if(s.indexOf("501") >= 0) + delay_try = true; + } + BufferedReader bufferedreader = new BufferedReader(new InputStreamReader(m_sktSound.getInputStream())); + do + { + String s1; + if((s1 = bufferedreader.readLine()) == null) + break; + if(s1.indexOf("WWW-Authenticate: ") < 0) + continue; + int i = s1.indexOf("realm=") + 7; + int j = s1.indexOf('"', i); + realm = s1.substring(i, j); + i = s1.indexOf("qop=") + 5; + j = s1.indexOf('"', i); + qop = s1.substring(i, j); + i = s1.indexOf("nonce=") + 7; + j = s1.indexOf('"', i); + nonce = s1.substring(i, j); + break; + } while(true); + if(algorithm == 0) + { + sTmp = new String("GET /audio.cgi HTTP/1.0\r\nUser-Agent: user\r\nAuthorization: Basic "); + sTmp = sTmp.concat(m_sPassword); + } else + if(algorithm == 1) + { + String s2 = GetDigestAuthentication("GET", "/dgaudio.cgi", realm, qop, nonce); + sTmp = new String("GET /dgaudio.cgi HTTP/1.0\r\nUser-Agent: user\r\nAuthorization: "); + sTmp = sTmp.concat(s2); + } else + { + String s3 = GetDigestAuthentication("GET", "/audio.cgi", realm, qop, nonce); + sTmp = new String("GET /audio.cgi HTTP/1.0\r\nUser-Agent: user\r\nAuthorization: "); + sTmp = sTmp.concat(s3); + } + sTmp = sTmp.concat("\r\n\r\n"); + m_GetSoundString = sTmp.getBytes("8859_1"); + m_soundInput.close(); + m_soundOutput.close(); + bufferedreader.close(); + m_sktSound.close(); + m_soundInput = null; + m_soundOutput = null; + bufferedreader = null; + m_sktSound = null; + if(delay_try) + { + Thread.currentThread(); + Thread.sleep(10000L); + } + delay_try = false; + } while(true); + nRead = 0; + boolean flag = false; + int j1; + do + { + nRead = nRead + m_soundInput.read(rData, nRead, rData.length - nRead); + j1 = 0; + do + { + if(j1 >= nRead - 7) + break; + if(rData[j1] == 13 && rData[j1 + 1] == 10 && rData[j1 + 2] == 13 && rData[j1 + 3] == 10 && rData[j1 + 4] == 82 && rData[j1 + 5] == 73 && rData[j1 + 6] == 70 && rData[j1 + 7] == 70) + { + flag = true; + j1 += 4; + break; + } + j1++; + } while(true); + Thread.currentThread(); + Thread.sleep(3L); + } while(nRead != -1 && !flag); + long l = (long)rData[j1 + 27] << 24 & 0xffffffffff000000L | (long)rData[j1 + 26] << 16 & 0xff0000L | (long)rData[j1 + 25] << 8 & 65280L | (long)rData[j1 + 24] & 255L; + int k = rData[j1 + 22] + (rData[j1 + 23] << 8); + int i1 = rData[j1 + 34] + (rData[j1 + 35] << 8); + j1 += 44; + soundFormat = new AudioFormat(l, i1, k, true, false); + info = new javax.sound.sampled.DataLine.Info(javax/sound/sampled/SourceDataLine, soundFormat, InternalBufferSize); + line = (SourceDataLine)AudioSystem.getLine(info); + line.open(soundFormat, InternalBufferSize); + int k1 = line.getBufferSize(); + muteControl = (BooleanControl)line.getControl(javax.sound.sampled.BooleanControl.Type.MUTE); + mute_start_time = System.currentTimeMillis(); + int l1 = rData[j1 + 63] << 8 + rData[j1 + 62]; + nRead = 0; + int k2 = k * 256; + retry = 0; + do + { + if(nRead == -1 || !m_bImageThreadRun) + break; + if(mute_start_time != 0L) + if(System.currentTimeMillis() - mute_start_time >= 1000L) + { + line.start(); + mute_start_time = 0L; + turn_sound_on = true; + } else + { + m_soundInput.read(rData, 0, rData.length); + } + if(SoundOn == 0 || m_AudioOut && m_TwoWay == 0) + { + if(turn_sound_off) + { + turn_sound_off = false; + line.stop(); + } + Thread.currentThread(); + Thread.sleep(30L); + m_soundInput.read(rData, 0, rData.length); + } else + { + Thread.currentThread(); + Thread.sleep(8L); + nRead = m_soundInput.read(rData, 0, rData.length); + if(turn_sound_on && nRead >= 64) + { + turn_sound_on = false; + line.flush(); + for(int j2 = 0; j2 < 32; j2++) + { + int i2 = (l1 / 32) * j2; + rData[j2 * 2] = (byte)(i2 & 0xff); + rData[j2 * 2 + 1] = (byte)(i2 >> 8 & 0xff); + } + + } + if(nRead > 0 && (k1 - line.available()) / k2 < 50) + if(line.available() >= nRead) + line.write(rData, 0, nRead); + else + line.flush(); + } + } while(true); + } + catch(Exception exception) + { + exception.printStackTrace(); + } + try + { + line.flush(); + line.stop(); + line.close(); + line = null; + soundFormat = null; + info = null; + m_soundInput.close(); + m_soundOutput.close(); + m_sktSound.close(); + m_soundInput = null; + m_soundOutput = null; + m_sktSound = null; + } + catch(Exception exception1) + { + System.err.println(exception1); + } + } while(true); + } + + int ExternalBufferSize; + int InternalBufferSize; + SourceDataLine line; + String sTmp; + Socket m_sktSound; + DataInputStream m_soundInput; + DataOutputStream m_soundOutput; + AudioFormat soundFormat; + javax.sound.sampled.DataLine.Info info; + int nRead; + int retry; + byte rData[]; + byte m_GetSoundString[]; + String realm; + String qop; + String nonce; + boolean delay_try; + final aplug this$0; + + AU() + { + this$0 = aplug.this; + super(); + ExternalBufferSize = 64000; + InternalBufferSize = 64000; + line = null; + sTmp = null; + m_sktSound = null; + m_soundInput = null; + m_soundOutput = null; + soundFormat = null; + info = null; + nRead = 0; + retry = 0; + rData = new byte[ExternalBufferSize]; + realm = null; + qop = null; + nonce = null; + delay_try = false; + } + } + + class TS extends Thread + { + + public void run() + { + while(m_bImageThreadRun) + { + if(m_bIsPostDataConnect) + PostData(); + try + { + Thread.currentThread(); + Thread.sleep(30L); + } + catch(Exception exception) { } + } + } + + public void PostData() + { + byte abyte1[] = new byte[512]; + String s = new String(""); + String s2 = new String(""); + String s4 = new String(""); + String s5 = new String(""); + boolean flag = false; + boolean flag1 = false; + String s6 = null; + String s7 = null; + String s8 = null; + BufferedReader bufferedreader = null; + try + { + switch(post_function) + { + case 1: // '\001' + s4 = s4.concat("POST /iocontrol.cgi HTTP/1.0\r\n"); + s2 = new String("/iocontrol.cgi"); + break; + + case 2: // '\002' + s4 = s4.concat("POST /pantiltcontrol.cgi HTTP/1.0\r\n"); + s2 = new String("/pantiltcontrol.cgi"); + break; + + case 3: // '\003' + s4 = s4.concat("POST /audiocontrol.cgi HTTP/1.0\r\n"); + s2 = new String("/audiocontrol.cgi"); + break; + + case 4: // '\004' + s4 = s4.concat("POST /motion.cgi HTTP/1.0\r\n"); + s2 = new String("/motion.cgi"); + break; + } + s4 = s4.concat("Content-length: "); + String s3 = Integer.toString(m_postdata.length(), 10); + s4 = s4.concat(s3); + s4 = s4.concat("\r\n"); + do + { + if(m_iRemotePort.intValue() == 8481 || m_iRemotePort.intValue() == 80) + m_sktPostData = new Socket(m_sRemoteHost, 80); + else + m_sktPostData = new Socket(m_sRemoteHost, m_iRemotePort.intValue()); + m_sktPostData.setSoTimeout(m_iTimeout.intValue()); + m_PostDataInput = new DataInputStream(m_sktPostData.getInputStream()); + m_PostDataOutput = new DataOutputStream(m_sktPostData.getOutputStream()); + String s1 = s4; + if(flag) + { + s1 = s1.concat("User-Agent: user\r\nAuthorization: "); + s1 = s1.concat(s5); + } else + { + s1 = s1.concat("User-Agent: user\r\nAuthorization: Basic "); + s1 = s1.concat(m_sPassword); + } + s1 = s1.concat("\r\n\r\n"); + s1 = s1.concat(m_postdata); + byte abyte0[] = s1.getBytes("8859_1"); + m_PostDataOutput.write(abyte0); + Thread.currentThread(); + Thread.sleep(30L); + bufferedreader = new BufferedReader(new InputStreamReader(m_sktPostData.getInputStream())); + String s9 = bufferedreader.readLine(); + if(s9 != null && s9.indexOf("HTTP/") >= 0 && s9.indexOf("401") == -1 || flag1) + break; + do + { + String s10; + if((s10 = bufferedreader.readLine()) == null) + break; + if(s10.indexOf("WWW-Authenticate: ") < 0) + continue; + int i = s10.indexOf("realm=") + 7; + int j = s10.indexOf('"', i); + s6 = s10.substring(i, j); + i = s10.indexOf("qop=") + 5; + j = s10.indexOf('"', i); + s7 = s10.substring(i, j); + i = s10.indexOf("nonce=") + 7; + j = s10.indexOf('"', i); + s8 = s10.substring(i, j); + break; + } while(true); + flag1 = true; + if(algorithm > 0) + { + s5 = GetDigestAuthentication("POST", s2, s6, s7, s8); + flag = true; + } + m_PostDataInput.close(); + m_PostDataOutput.close(); + bufferedreader.close(); + m_sktPostData.close(); + m_PostDataInput = null; + m_PostDataOutput = null; + bufferedreader = null; + m_sktPostData = null; + } while(true); + } + catch(Exception exception) + { + System.err.println(exception); + m_bIsPostDataConnect = false; + m_PostingData = false; + m_PostingPanTiltData = false; + return; + } + m_PostingData = false; + try + { + m_PostDataInput.close(); + m_PostDataOutput.close(); + bufferedreader.close(); + m_sktPostData.close(); + Object obj = null; + m_PostDataInput = null; + m_PostDataOutput = null; + bufferedreader = null; + m_sktPostData = null; + } + catch(Exception exception1) + { + System.err.println(exception1); + } + if(!m_PostingData && !m_PostingPanTiltData) + m_bIsPostDataConnect = false; + } + + final aplug this$0; + + TS() + { + this$0 = aplug.this; + super(); + } + } + + class SI extends Thread + { + + public boolean CreateBlockImage() + { + int i = imgHeight; + int j = imgWidth; + int ai[] = new int[j * i]; + int k = j / block_num; + int l = i / block_num; + boolean flag = false; + PixelGrabber pixelgrabber; + if(j != m_imgCamera.getWidth(null)) + { + Image image = m_imgCamera.getScaledInstance(j, i, 1); + pixelgrabber = new PixelGrabber(image, 0, 0, j, i, ai, 0, j); + } else + { + pixelgrabber = new PixelGrabber(m_imgCamera, 0, 0, j, i, ai, 0, j); + } + try + { + pixelgrabber.grabPixels(); + } + catch(InterruptedException interruptedexception) + { + m_imgProcess = null; + return false; + } +label0: + for(int k2 = 0; k2 < i; k2++) + { + if(k2 > 0 && k2 % l == 0) + { + if(!flag) + { + for(int i1 = 0; i1 < j * 2; i1++) + ai[j * k2 + i1] = ai[j * k2 + i1] & 0xff000000 | 0xff; + + continue; + } + for(int j1 = 0; j1 < j * 4; j1++) + ai[j * (k2 - 2) + j1] = ai[j * (k2 - 2) + j1] & 0xff000000 | 0xff; + + continue; + } + int k1 = 1; + do + { + if(k1 >= block_num) + continue label0; + if(flag) + { + ai[(j * k2 + k * k1) - 2] = ai[(j * k2 + k * k1) - 2] & 0xff000000 | 0xff; + ai[(j * k2 + k * k1) - 1] = ai[(j * k2 + k * k1) - 1] & 0xff000000 | 0xff; + } + ai[j * k2 + k * k1] = ai[j * k2 + k * k1] & 0xff000000 | 0xff; + ai[j * k2 + k * k1 + 1] = ai[j * k2 + k * k1 + 1] & 0xff000000 | 0xff; + k1++; + } while(true); + } + + for(int i4 = 0; i4 < block_num * block_num; i4++) + { + if((block_on >> i4 & 1) == 0) + continue; + byte byte0 = 8; + int i3 = (i4 % block_num) * k; + int j3 = i3 + k; + int k3 = (i4 / block_num) * l; + int l3 = k3 + l; + if(flag) + byte0 = 16; + for(int l2 = k3; l2 < l3; l2++) + { + if(l2 > k3 && l2 % byte0 == 0) + { + for(int l1 = i3; l1 < j3; l1++) + ai[j * l2 + l1] = ai[j * l2 + l1] & 0xff000000 | 0xff; + + if(!flag) + continue; + for(int i2 = i3; i2 < j3; i2++) + ai[j * (l2 + 1) + i2] = ai[j * (l2 + 1) + i2] & 0xff000000 | 0xff; + + continue; + } + for(int j2 = i3 + byte0; j2 < j3; j2 += byte0) + { + ai[j * l2 + j2] = ai[j * l2 + j2] & 0xff000000 | 0xff; + if(flag) + ai[j * l2 + j2 + 1] = ai[j * l2 + j2 + 1] & 0xff000000 | 0xff; + } + + } + + } + + m_imgProcess = createImage(new MemoryImageSource(j, i, ai, 0, j)); + ai = null; + pixelgrabber = null; + return m_imgProcess != null; + } + + public boolean CreateNewImage() + { + int i = m_imgCamera.getHeight(null); + int j = m_imgCamera.getWidth(null); + int ai[] = new int[j * i]; + int k = j / block_num; + int l = i / block_num; + PixelGrabber pixelgrabber = new PixelGrabber(m_imgCamera, 0, 0, j, i, ai, 0, j); + try + { + pixelgrabber.grabPixels(); + } + catch(InterruptedException interruptedexception) + { + m_imgProcess = null; + return false; + } + m_imgProcess = createImage(new MemoryImageSource(j, i, ai, 0, j)); + ai = null; + pixelgrabber = null; + return m_imgProcess != null; + } + + public void run() + { + int i = 100; + Thread thread = Thread.currentThread(); + thread.setPriority(10); + String s = System.getProperty("os.name"); + if(s.indexOf("Windows") >= 0) + { + os_windows = true; + } else + { + os_windows = false; + i = 100; + } +label0: + do + try + { +label1: + { + if(!m_bImageThreadRun) + break label0; + if(!BufferReady) + break label1; + m_imgCamera = null; + m_imgProcess = null; + long l = System.currentTimeMillis(); + m_imgCamera = Toolkit.getDefaultToolkit().createImage(imgbuf, 0, iLength); + m_lNumFrames = m_lNumFrames + 1L; + if(m_imgCamera != null) + { + while(!Toolkit.getDefaultToolkit().prepareImage(m_imgCamera, m_imgCamera.getWidth(null), m_imgCamera.getHeight(null), null)) + { + Thread _tmp = thread; + Thread.sleep(1L); + if(System.currentTimeMillis() - l > (long)i) + { + BufferReady = false; + break label1; + } + } + if(m_imgCamera != null) + { + if(drawLine) + { + if(!CreateBlockImage()) + { + BufferReady = false; + break label1; + } + } else + if(!os_windows && !CreateNewImage()) + { + BufferReady = false; + break label1; + } + Thread _tmp1 = thread; + Thread.sleep(3L); + repaint(); + } + } + BufferReady = false; + } + Thread _tmp2 = thread; + Thread.sleep(2L); + continue; + } + catch(Exception exception) + { + break; + } + while(true); + } + + final aplug this$0; + + SI() + { + this$0 = aplug.this; + super(); + } + } + + + public aplug() + { + MAX_BUFFER_SIZE = 0x400000; + sub_idx = new int[8]; + sub_length = new int[8]; + algorithm = 0; + nc = 1; + m_TwoWay = 0; + m_imgCamera = null; + m_imgProcess = null; + BufferReady = false; + imgbuf = new byte[0x100000]; + tmpbuf = new byte[MAX_BUFFER_SIZE + 0x20000]; + rcvbuf = new byte[1024]; + m_sTimeString = new String("2004-01-01 00:00:00 am"); + HorizontalPosition = 0; + VerticalPosition = 0; + PositionName = new String("test"); + m_PanSingleMoveDegree = 0; + m_TiltSingleMoveDegree = 0; + CV_OK = -1; + CV_ERROR = 0; + ratio = 1; + scale_method = 0; + imgWidth = 0; + imgHeight = 0; + drawLine = false; + block_num = 5; + block_on = 0; + SoundOn = 1; + test_cnt = 0; + os_windows = true; + mute_start_time = 0L; + muteControl = null; + turn_sound_on = false; + turn_sound_off = false; + m_MotionFlag = 0; + acsControl = new ACS_Control(); + acsAudio = new ACS_Audio(); + AudioOutStatus = 0; + m_AudioOut = false; + } + + public void init() + { + try + { + if(getParameter("RemoteHost") != null) + { + m_sRemoteHost = getParameter("RemoteHost"); + } else + { + m_urlRemoteHost = getCodeBase(); + m_sRemoteHost = m_urlRemoteHost.getHost(); + } + imgHeight = getHeight(); + imgWidth = getWidth(); + if(getParameter("Algorithm") != null) + algorithm = Integer.parseInt(getParameter("Algorithm")); + m_iRemotePort = Integer.valueOf(getParameter("RemotePort")); + m_iTimeout = Integer.valueOf(getParameter("Timeout")); + m_lPreviewFrameRate = Long.valueOf(getParameter("PreviewFrameRate")); + m_dRotateAngle = Double.valueOf(getParameter("RotateAngle")); + m_sPassword = getParameter("DeviceSerialNo"); + m_baPassword = m_sPassword.getBytes("8859_1"); + if(getParameter("SetMotionDetection") != null && Integer.parseInt(getParameter("SetMotionDetection")) > 0) + { + drawLine = true; + String s = getParameter("MotionDetectionBlockSet"); + block_on = 0; + if(s != null) + { + int i = s.length(); + if(i > 25) + i = 25; + for(int j = 0; j < i; j++) + if(s.charAt(j) == '1') + block_on = block_on | 1 << j; + + } + } + if(getParameter("TwoWay") != null) + m_TwoWay = Integer.parseInt(getParameter("TwoWay")); + String s1; + if(algorithm == 0 || algorithm == 2) + s1 = new String("GET /mjpeg.cgi HTTP/1.0\r\nUser-Agent: user\r\nAuthorization: Basic "); + else + s1 = new String("GET /dgvideo.cgi HTTP/1.0\r\nUser-Agent: user\r\nAuthorization: Basic "); + s1 = s1.concat(m_sPassword); + s1 = s1.concat("\r\n\r\n"); + m_GetImageString = s1.getBytes("8859_1"); + s1 = new String("GET /IOCONTROL.CGI HTTP/1.0\r\nUser-Agent: user\r\nAuthorization: Basic "); + s1 = s1.concat(m_sPassword); + s1 = s1.concat("\r\n\r\n"); + m_baCliCmdGetRealTimeData = s1.getBytes("8859_1"); + sub_idx[0] = 0; + s1 = new String("Content-type: image/jpeg\r\n\r\n"); + sub_length[0] = s1.length(); + sub_idx[1] = s1.length(); + s1 = s1.concat("\r\n\r\n--video boundary--\r\n"); + sub_length[1] = s1.length() - sub_idx[1]; + sub_idx[2] = s1.length(); + s1 = s1.concat("Content-length: "); + sub_length[2] = s1.length() - sub_idx[2]; + sub_idx[3] = s1.length(); + s1 = s1.concat("Trigger1="); + sub_length[3] = s1.length() - sub_idx[3]; + sub_idx[4] = s1.length(); + s1 = s1.concat("Trigger2="); + sub_length[4] = s1.length() - sub_idx[4]; + sub_idx[5] = s1.length(); + s1 = s1.concat("ImageUpload="); + sub_length[5] = s1.length() - sub_idx[5]; + sub_idx[6] = s1.length(); + s1 = s1.concat("Date: "); + sub_length[6] = s1.length() - sub_idx[6]; + sub_idx[7] = s1.length(); + s1 = s1.concat("ImageEmail="); + sub_length[7] = s1.length() - sub_idx[7]; + substring = s1.getBytes(); + m_lNumFrames = 0L; + m_lTimerPrev = System.currentTimeMillis(); + m_lTimerNow = System.currentTimeMillis(); + m_fFrameRate = 0.0F; + m_bImageThreadRun = false; + m_bRealTimeDataThreadRun = false; + m_bIsRealTimeDataConnect = false; + m_bIsPostDataConnect = false; + m_PostingData = false; + m_PostingPanTiltData = false; + addMouseListener(this); + } + catch(Exception exception) + { + System.err.println(exception); + } + } + + public void mouseClicked(MouseEvent mouseevent) + { + } + + public void mousePressed(MouseEvent mouseevent) + { + int i = mouseevent.getX(); + int j = mouseevent.getY(); + if(!drawLine || i >= imgWidth || j >= imgHeight) + { + return; + } else + { + int k = i / (imgWidth / block_num); + int l = j / (imgHeight / block_num); + block_on = block_on ^ 1 << l * block_num + k; + SetMotionDetect(); + return; + } + } + + public void mouseReleased(MouseEvent mouseevent) + { + } + + public void mouseEntered(MouseEvent mouseevent) + { + } + + public void mouseExited(MouseEvent mouseevent) + { + } + + public void destroy() + { + m_bImageThreadRun = false; + try + { + m_Input.close(); + m_Output.close(); + m_sktClient.close(); + } + catch(Exception exception) + { + System.err.println(exception); + } + } + + public void start() + { + Play(); + } + + public void stop() + { + Stop(); + } + + public void paint(Graphics g) + { + if(m_imgCamera != null) + { + int i = m_imgCamera.getHeight(null); + int j = m_imgCamera.getWidth(null); + imgHeight = getHeight(); + imgWidth = getWidth(); + if(!drawLine) + { + if(os_windows) + g.drawImage(m_imgCamera, 0, 0, imgWidth, imgHeight, (j * (ratio - 1)) / ratio / 2, (i * (ratio - 1)) / ratio / 2, (j * (ratio - 1)) / ratio / 2 + j / ratio, (i * (ratio - 1)) / ratio / 2 + i / ratio, this); + else + if(m_imgProcess != null) + g.drawImage(m_imgProcess, 0, 0, imgWidth, imgHeight, (j * (ratio - 1)) / ratio / 2, (i * (ratio - 1)) / ratio / 2, (j * (ratio - 1)) / ratio / 2 + j / ratio, (i * (ratio - 1)) / ratio / 2 + i / ratio, this); + } else + if(m_imgProcess != null) + g.drawImage(m_imgProcess, 0, 0, imgWidth, imgHeight, this); + } + } + + public void update(Graphics g) + { + paint(g); + } + + public String CvtHex(byte abyte0[]) + { + byte abyte1[] = new byte[abyte0.length * 2]; + for(int i = 0; i < abyte0.length; i++) + { + byte byte0 = (byte)(abyte0[i] >> 4 & 0xf); + if(byte0 <= 9) + abyte1[i * 2] = (byte)(byte0 + 48); + else + abyte1[i * 2] = (byte)((byte0 + 97) - 10); + byte0 = (byte)(abyte0[i] & 0xf); + if(byte0 <= 9) + abyte1[i * 2 + 1] = (byte)(byte0 + 48); + else + abyte1[i * 2 + 1] = (byte)((byte0 + 97) - 10); + } + + return new String(abyte1); + } + + public String decode_base64(byte abyte0[], int i) + { + byte abyte1[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".getBytes(); + byte abyte2[] = new byte[4]; + int j = i % 4; + if(j != 0) + return null; + int k1 = 0; + j = 0; + int k = i / 4; + byte abyte3[] = new byte[k * 3]; + for(int l = 0; l < k; l++) + { + for(int i1 = 0; i1 < 4; i1++) + { + if(abyte0[k1] == 61) + { + abyte2[i1] = 0; + j++; + } else + { + int j1 = 0; + do + { + if(j1 >= 64) + break; + if(abyte0[k1] == abyte1[j1]) + { + abyte2[i1] = (byte)j1; + break; + } + j1++; + } while(true); + } + k1++; + } + + abyte3[l * 3] = (byte)((byte)(abyte2[0] << 2 & 0xfc) | (byte)(abyte2[1] >> 4 & 3)); + abyte3[l * 3 + 1] = (byte)((byte)(abyte2[1] << 4 & 0xf0) | (byte)(abyte2[2] >> 2 & 0xf)); + abyte3[l * 3 + 2] = (byte)((byte)(abyte2[2] << 6 & 0xc0) | abyte2[3]); + } + + return new String(abyte3); + } + + public String GetDigestAuthentication(String s, String s1, String s2, String s3, String s4) + { + String s5 = null; + String s6 = null; + String s7 = null; + String s8 = null; + String s9 = null; + String s10 = decode_base64(m_sPassword.getBytes(), m_sPassword.length()); + s6 = s10.substring(0, s10.indexOf(':')); + if(s10.indexOf('\0') >= 0) + s7 = s10.substring(s10.indexOf(':') + 1, s10.indexOf('\0')); + else + s7 = s10.substring(s10.indexOf(':') + 1); + Random random = new Random(); + byte abyte0[] = new byte[16]; + random.nextBytes(abyte0); + s8 = CvtHex(abyte0); + s9 = String.format("%1$08X", new Object[] { + Integer.valueOf(nc) + }); + nc++; + try + { + MessageDigest messagedigest = MessageDigest.getInstance("MD5"); + messagedigest.update(s6.getBytes()); + messagedigest.update((byte)58); + messagedigest.update(s2.getBytes()); + messagedigest.update((byte)58); + messagedigest.update(s7.getBytes()); + String s12 = CvtHex(messagedigest.digest()); + messagedigest.reset(); + messagedigest.update(s.getBytes()); + messagedigest.update((byte)58); + messagedigest.update(s1.getBytes()); + String s13 = CvtHex(messagedigest.digest()); + messagedigest.reset(); + messagedigest.update(s12.getBytes()); + messagedigest.update((byte)58); + messagedigest.update(s4.getBytes()); + messagedigest.update((byte)58); + if(s3.length() > 0) + { + messagedigest.update(s9.getBytes()); + messagedigest.update((byte)58); + messagedigest.update(s8.getBytes()); + messagedigest.update((byte)58); + messagedigest.update(s3.getBytes()); + messagedigest.update((byte)58); + } + messagedigest.update(s13.getBytes()); + s5 = CvtHex(messagedigest.digest()); + } + catch(Exception exception) + { + exception.printStackTrace(); + } + String s11 = String.format("Digest username=\"%1$s\", realm=\"%2$s\", uri=\"%3$s\", algorithm=MD5, nonce=\"%4$s\", cnonce=\"%5$s\", qop=%6$s, nc=%7$s, response=\"%8$s\"", new Object[] { + s6, s2, s1, s4, s8, s3, s9, s5 + }); + return s11; + } + + public void run() + { + boolean flag; + int i3; + String s; + String s1; + String s2; + boolean flag14; + long l6; + Thread thread; + i3 = 0; + boolean flag6 = false; + long l4 = System.currentTimeMillis(); + boolean flag12 = false; + s = null; + s1 = null; + s2 = null; + flag14 = false; + l6 = System.currentTimeMillis(); + flag = true; + m_bIsConnect = false; + thread = Thread.currentThread(); + if(thread != m_trdCameraImage) goto _L2; else goto _L1 +_L1: + int j1; + int i2; + int k3; + long l5; + boolean flag13; + if(!flag || !m_bImageThreadRun) + break; /* Loop/switch isn't completed */ + System.gc(); + try + { + do + { + thread; + Thread.sleep(100L); + if(m_iRemotePort.intValue() == 8481 || m_iRemotePort.intValue() == 80) + m_sktClient = new Socket(m_sRemoteHost, 80); + else + m_sktClient = new Socket(m_sRemoteHost, m_iRemotePort.intValue()); + m_sktClient.setSoTimeout(m_iTimeout.intValue()); + m_Input = new DataInputStream(m_sktClient.getInputStream()); + m_Output = new DataOutputStream(m_sktClient.getOutputStream()); + m_Output.write(m_GetImageString); + m_Input.read(tmpbuf, 0, 64); + String s3 = new String(tmpbuf, 0, 64); + if(s3 != null && s3.indexOf("HTTP/") >= 0) + { + if(s3.indexOf("200") >= 0) + break; + if(s3.indexOf("501") >= 0) + { + System.out.println("too many users, wait 10 sec."); + flag14 = true; + } + } + BufferedReader bufferedreader = new BufferedReader(new InputStreamReader(m_sktClient.getInputStream())); + do + { + String s4; + if((s4 = bufferedreader.readLine()) == null) + break; + if(s4.indexOf("WWW-Authenticate: ") < 0) + continue; + int i4 = s4.indexOf("realm=") + 7; + int j4 = s4.indexOf('"', i4); + s = s4.substring(i4, j4); + i4 = s4.indexOf("qop=") + 5; + j4 = s4.indexOf('"', i4); + s1 = s4.substring(i4, j4); + i4 = s4.indexOf("nonce=") + 7; + j4 = s4.indexOf('"', i4); + s2 = s4.substring(i4, j4); + break; + } while(true); + String s7; + if(algorithm == 0) + { + s7 = new String("GET /mjpeg.cgi HTTP/1.0\r\nUser-Agent: user\r\nAuthorization: Basic "); + s7 = s7.concat(m_sPassword); + } else + if(algorithm == 1) + { + String s5 = GetDigestAuthentication("GET", "/dgvideo.cgi", s, s1, s2); + s7 = new String("GET /dgvideo.cgi HTTP/1.0\r\nUser-Agent: user\r\nAuthorization: "); + s7 = s7.concat(s5); + } else + { + String s6 = GetDigestAuthentication("GET", "/mjpeg.cgi", s, s1, s2); + s7 = new String("GET /mjpeg.cgi HTTP/1.0\r\nUser-Agent: user\r\nAuthorization: "); + s7 = s7.concat(s6); + } + s7 = s7.concat("\r\n\r\n"); + m_GetImageString = s7.getBytes("8859_1"); + m_Input.close(); + m_Output.close(); + bufferedreader.close(); + m_sktClient.close(); + m_Input = null; + m_Output = null; + bufferedreader = null; + m_sktClient = null; + if(flag14) + { + thread; + Thread.sleep(10000L); + } + flag14 = false; + } while(true); + m_bIsConnect = true; + } + catch(Exception exception) + { + exception.printStackTrace(); + m_bIsConnect = false; + continue; /* Loop/switch isn't completed */ + } + boolean flag1 = false; + boolean flag2 = false; + j1 = 0; + i2 = -1; + boolean flag7 = false; + k3 = 0; + flag13 = false; + l5 = System.currentTimeMillis(); + BufferReady = false; +_L12: + if(!m_bImageThreadRun) + break MISSING_BLOCK_LABEL_1648; + while(BufferReady) + { + int k1 = m_Input.available(); + if(j1 + k1 > MAX_BUFFER_SIZE) + { + j1 = 0; + i2 = -1; + boolean flag8 = false; + k3 = 0; + } + if(k1 > 0) + { + k1 = m_Input.read(tmpbuf, j1, k1); + boolean flag3 = false; + l5 = System.currentTimeMillis(); + j1 += k1; + } else + if(System.currentTimeMillis() - l5 > 15000L) + { + flag13 = true; + m_bIsConnect = false; + BufferReady = false; + break; + } + thread; + Thread.sleep(2L); + } + boolean flag4 = false; +_L10: + if(!m_bIsConnect) + break MISSING_BLOCK_LABEL_1596; + int l1; + if(k3 < 0 || j1 > MAX_BUFFER_SIZE) + { + j1 = 0; + i2 = -1; + boolean flag9 = false; + k3 = 0; + } + l1 = m_Input.available(); + if(l1 <= 0) goto _L4; else goto _L3 +_L3: + if(i2 == -1) + l1 = m_Input.read(tmpbuf, j1, l1); + else + l1 = m_Input.read(imgbuf, j1, k3); + j1 += l1; + boolean flag5 = false; + l5 = System.currentTimeMillis(); + goto _L5 +_L4: + if(System.currentTimeMillis() - l5 > 15000L) + { + flag13 = true; + break MISSING_BLOCK_LABEL_1596; + } +_L5: + if(j1 <= 0) + break MISSING_BLOCK_LABEL_1566; + if(i2 != -1) goto _L7; else goto _L6 +_L6: + int j3; + j3 = SearchString(0, j1, 2); + if(j3 >= 0) + { + i2 = SearchString(j3, j1, 0); + if(i2 > 0) + i3 = SearchString(j3, i2, 6); + } + if(i2 >= 0) goto _L9; else goto _L8 +_L8: + thread; + Thread.sleep(2L); + goto _L10 +_L9: +label0: + { + if(i3 > 0) + { + int j2 = i3; + m_sTimeString = new String(tmpbuf, j2 + 6, 22); + if(!m_PostingData) + { + m_iIOOut1 = tmpbuf[j2 + 39] - 48; + m_iIOOut2 = tmpbuf[j2 + 38] - 48; + m_imageUpload = tmpbuf[j2 + 37] - 48; + m_imageEmail = tmpbuf[j2 + 36] - 48; + if(tmpbuf[j2 + 35] == 49) + { + l6 = System.currentTimeMillis(); + m_MotionFlag = 1; + } else + if(m_MotionFlag == 1 && System.currentTimeMillis() - l6 > 3000L) + m_MotionFlag = 0; + } + int l3 = 0; + for(int i = 0; i < 3; i++) + l3 = l3 * 10 + (tmpbuf[j2 + 44 + i] - 48); + + HorizontalPosition = l3; + l3 = 0; + for(int j = 0; j < 3; j++) + l3 = l3 * 10 + (tmpbuf[j2 + 48 + j] - 48); + + VerticalPosition = l3; + } + if(j3 < 0) + break MISSING_BLOCK_LABEL_1566; + int k2 = j3; + k2 += sub_length[2]; + k3 = 0; + for(; tmpbuf[k2] >= 48 && tmpbuf[k2] <= 57; k2++) + k3 = k3 * 10 + (tmpbuf[k2] - 48); + + iLength = k3; + boolean flag10 = false; + i2 += sub_length[0]; + j1 -= i2; + if(k3 <= j1) + break label0; + for(int k = 0; k < j1; k++) + imgbuf[k] = tmpbuf[k + i2]; + + k3 -= j1; + thread; + Thread.sleep(2L); + } + goto _L10 + try + { + for(int l = 0; l < k3; l++) + imgbuf[l] = tmpbuf[l + i2]; + + int l2; + if(j1 > k3 * 4) + { + l2 = SearchString(i2 + k3 * 2, j1 - k3 * 2, 2); + if(l2 >= 0) + { + j1 = (j1 + i2) - l2; + } else + { + j1 -= k3; + l2 = i2 + k3; + } + } else + { + j1 -= k3; + l2 = i2 + k3; + } + for(int i1 = 0; i1 < j1; i1++) + tmpbuf[i1] = tmpbuf[i1 + l2]; + + BufferReady = true; + i2 = -1; + continue; /* Loop/switch isn't completed */ + } + catch(Exception exception1) + { + char c = '\u4E20'; + BufferReady = false; + flag13 = true; + } + break MISSING_BLOCK_LABEL_1596; +_L7: + k3 -= l1; + if(k3 <= 0) + { + BufferReady = true; + i2 = -1; + j1 = 0; + continue; /* Loop/switch isn't completed */ + } + thread; + Thread.sleep(2L); + goto _L10 + if(flag13) + break; /* Loop/switch isn't completed */ + thread; + Thread.sleep(3L); + i2 = -1; + boolean flag11 = false; + if(true) goto _L12; else goto _L11 +_L11: + m_bIsConnect = false; + break MISSING_BLOCK_LABEL_1648; + Exception exception2; + exception2; + System.err.println(": Getting image connection broken."); + m_bIsConnect = false; + m_fFrameRate = 0.0F; + try + { + m_Input.close(); + m_Output.close(); + m_sktClient.close(); + m_Input = null; + m_Output = null; + m_sktClient = null; + m_bIsConnect = false; + } + catch(Exception exception3) + { + System.err.println(exception3); + } + if(!m_bImageThreadRun) + flag = false; + if(true) goto _L1; else goto _L2 +_L2: + } + + public int SearchString(int i, int j, int k) + { + if(i < 0) + i = 0; + int l = 0; + l = sub_length[k]; + int k1 = sub_idx[k]; + for(int i1 = i; i1 < (j - l) + 1; i1++) + { + int j1; + for(j1 = 0; j1 < l && tmpbuf[i1 + j1] == substring[j1 + k1]; j1++); + if(j1 == l) + return i1; + } + + return -1; + } + + public int GetRealTimeData() + { + return CV_OK; + } + + public String GetFrameRate() + { + CalculateFrameRate(); + return Float.toString(m_fFrameRate); + } + + public int GetMotionDetectFlag() + { + return block_on; + } + + public void CalculateFrameRate() + { + long l; + m_lTimerNow = System.currentTimeMillis(); + l = m_lTimerNow - m_lTimerPrev; + if(l <= 0L) + { + m_fFrameRate = 0.0F; + m_lNumFrames = 0L; + return; + } + try + { + long l1 = Math.round(((float)m_lNumFrames * 100000F) / (float)l); + m_fFrameRate = (float)l1 / 100F; + m_lNumFrames = 0L; + m_lTimerPrev = m_lTimerNow; + } + catch(Exception exception) + { + System.err.println(exception); + } + return; + } + + public int Play() + { + if(!m_bImageThreadRun) + { + m_bImageThreadRun = true; + m_trdCameraImageShow = new SI(); + m_trdCameraImageShow.start(); + m_trdTriggerState = new TS(); + m_trdTriggerState.start(); + m_trdCameraSound = new AU(); + m_trdCameraSound.start(); + m_trdTalkie = new Talkie(); + m_trdTalkie.start(); + m_trdCameraImage = new Thread(this); + m_trdCameraImage.start(); + } + return CV_OK; + } + + public void Stop() + { + m_bImageThreadRun = false; + } + + public String GetRemoteHost() + { + return m_sRemoteHost; + } + + public int GetRemotePort() + { + return m_iRemotePort.intValue(); + } + + public int SetRemotePort(int i) + { + m_iRemotePort = new Integer(i); + return CV_OK; + } + + public int GetTimeout() + { + return m_iTimeout.intValue(); + } + + public int SetTimeout(int i) + { + m_iTimeout = new Integer(i); + return CV_OK; + } + + public long GetPreviewFrameRate() + { + return m_lPreviewFrameRate.longValue(); + } + + public int SetPreviewFrameRate(long l) + { + m_lPreviewFrameRate = new Long(l); + return CV_OK; + } + + public double GetRotateAngle() + { + return m_dRotateAngle.doubleValue(); + } + + public int SetRotateAngle(double d) + { + m_dRotateAngle = new Double(d); + return CV_OK; + } + + private boolean CompareByteArray(byte abyte0[], byte abyte1[], int i) + { + for(int j = 0; j < i; j++) + if(abyte0[j] != abyte1[j]) + return false; + + return true; + } + + public int GetIOIn1() + { + return m_iIOIn1; + } + + public int GetIOIn2() + { + return m_iIOIn2; + } + + public int GetImageUpload() + { + return m_imageUpload; + } + + public int GetImageEmail() + { + return m_imageEmail; + } + + public int GetIOOut1() + { + return m_iIOOut1; + } + + public int GetIOOut2() + { + return m_iIOOut2; + } + + public int SetTriggerState(int i, int j, int k, int l) + { + int i1 = 0; + if(!m_bIsConnect) + return CV_ERROR; + while(m_PostingData || m_PostingPanTiltData) + { + if(++i1 > 15) + return CV_ERROR; + try + { + Thread.currentThread(); + Thread.sleep(20L); + } + catch(Exception exception) { } + } + m_PostingData = true; + m_bIsRealTimeDataConnect = false; + post_function = 1; + m_postdata = new String(""); + if(i == 0) + m_postdata = m_postdata.concat("Trigger1=0&"); + else + m_postdata = m_postdata.concat("Trigger1=1&"); + if(j == 0) + m_postdata = m_postdata.concat("Trigger2=0&"); + else + m_postdata = m_postdata.concat("Trigger2=1&"); + if(k == 0) + m_postdata = m_postdata.concat("ImageUpload=0&"); + else + m_postdata = m_postdata.concat("ImageUpload=1&"); + if(l == 0) + m_postdata = m_postdata.concat("ImageEmail=0\r\n\r\n"); + else + m_postdata = m_postdata.concat("ImageEmail=1\r\n\r\n"); + m_iIOOut1 = i; + m_iIOOut2 = j; + m_imageUpload = k; + m_imageEmail = l; + m_bIsPostDataConnect = true; + return CV_OK; + } + + public int SetIOOut1(int i) + { + return SetTriggerState(i, m_iIOOut2, m_imageUpload, m_imageEmail); + } + + public int SetIOOut2(int i) + { + return SetTriggerState(m_iIOOut1, i, m_imageUpload, m_imageEmail); + } + + public int SetImageUpload(int i) + { + return SetTriggerState(m_iIOOut1, m_iIOOut2, i, m_imageEmail); + } + + public int SetImageEmail(int i) + { + return SetTriggerState(m_iIOOut1, m_iIOOut2, m_imageUpload, i); + } + + public int GetYear() + { + return m_iYear; + } + + public int GetMonth() + { + return m_iMonth; + } + + public int GetDay() + { + return m_iDay; + } + + public int GetDate() + { + return m_iDate; + } + + public int GetHour() + { + return m_iHour; + } + + public int GetMinute() + { + return m_iMinute; + } + + public int GetSecond() + { + return m_iSecond; + } + + public String GetTimeString() + { + return m_sTimeString; + } + + public String GetVersion() + { + String s = "20030123"; + return s; + } + + public boolean GetIsConnect() + { + return m_bIsConnect; + } + + public int GetHorizontalPosition() + { + return HorizontalPosition; + } + + public int GetVerticalPosition() + { + return VerticalPosition; + } + + public int SetPanTilt(int i, int j) + { + int k = 0; + if(!m_bIsConnect) + return CV_ERROR; + while(m_PostingData || m_PostingPanTiltData) + { + if(++k > 15) + return CV_ERROR; + try + { + Thread.currentThread(); + Thread.sleep(20L); + } + catch(Exception exception) { } + } + m_PostingData = true; + m_bIsRealTimeDataConnect = false; + String s6 = new String(""); + switch(i) + { + case 1: // '\001' + s6 = s6.concat("PanSingleMoveDegree="); + String s = Integer.toString(m_PanSingleMoveDegree, 10); + s6 = s6.concat(s); + s6 = s6.concat("&TiltSingleMoveDegree="); + s = Integer.toString(m_TiltSingleMoveDegree, 10); + s6 = s6.concat(s); + s6 = s6.concat("&PanTiltSingleMove="); + s = Integer.toString(j, 10); + s6 = s6.concat(s); + break; + + case 2: // '\002' + s6 = s6.concat("PanTiltPresetPositionMove="); + String s1 = Integer.toString(j, 10); + s6 = s6.concat(s1); + break; + + case 3: // '\003' + s6 = s6.concat("PanTiltHorizontal="); + String s2 = Integer.toString(HorizontalPosition, 10); + s6 = s6.concat(s2); + s6 = s6.concat("&PanTiltVertical="); + s2 = Integer.toString(VerticalPosition, 10); + s6 = s6.concat(s2); + s6 = s6.concat("&SetName="); + s6 = s6.concat(PositionName); + s6 = s6.concat("&SetPosition="); + s2 = Integer.toString(j, 10); + s6 = s6.concat(s2); + break; + + case 4: // '\004' + s6 = s6.concat("ClearPosition="); + String s3 = Integer.toString(j, 10); + s6 = s6.concat(s3); + break; + + case 5: // '\005' + s6 = s6.concat("PanTiltSwingMode="); + String s4 = Integer.toString(j, 10); + s6 = s6.concat(s4); + break; + } + s6 = s6.concat("\r\n\r\n"); + String s5 = Integer.toString(s6.length(), 10); + post_function = 2; + m_postdata = new String(""); + m_postdata = m_postdata.concat(s6); + m_bIsPostDataConnect = true; + return CV_OK; + } + + public int MovePanTiltDegree(int i) + { + return SetPanTilt(1, i); + } + + public int MovePanTiltPosition(int i) + { + return SetPanTilt(2, i); + } + + public int SetPosition(int i) + { + return SetPanTilt(3, i); + } + + public int ClearPosition(int i) + { + return SetPanTilt(4, i); + } + + public int SwingMode(int i) + { + return SetPanTilt(5, i); + } + + public int PanSingleMoveDegree(int i) + { + m_PanSingleMoveDegree = i; + return 0; + } + + public int TiltSingleMoveDegree(int i) + { + m_TiltSingleMoveDegree = i; + return 0; + } + + public int SetName(String s) + { + PositionName = new String("654321"); + return 0; + } + + public int Zoom(int i) + { + ratio = i; + return 0; + } + + public int SetSound(int i) + { + if(m_AudioOut && m_TwoWay == 0) + return 0; + int j = 0; + Object obj = null; + String s = new String(""); + if(SoundOn != i) + if(i == 1) + mute_start_time = System.currentTimeMillis(); + else + turn_sound_off = true; + SoundOn = i; + if(!m_bIsConnect) + return CV_ERROR; + while(m_PostingData) + { + if(++j > 15) + return CV_ERROR; + try + { + Thread.currentThread(); + Thread.sleep(20L); + } + catch(Exception exception) { } + } + m_PostingData = true; + s = s.concat("AudioMute="); + s = s.concat(SoundOn != 0 ? "0" : "1"); + s = s.concat("\r\n\r\n"); + post_function = 3; + m_postdata = new String(""); + m_postdata = m_postdata.concat(s); + obj = null; + s = null; + m_bIsPostDataConnect = true; + return 0; + } + + public int SetMotionDetect() + { + int i = 0; + String s = new String(""); + if(!m_bIsConnect) + return CV_ERROR; + while(m_PostingData) + { + if(++i > 15) + return CV_ERROR; + try + { + Thread.currentThread(); + Thread.sleep(20L); + } + catch(Exception exception) { } + } + m_PostingData = true; + s = s.concat("ConfigTemp=Java&MotionDetectionBlockSet="); + for(int j = 0; j < 25; j++) + s = s.concat((block_on & 1 << j) == 0 ? "0" : "1"); + + s = s.concat("\r\n\r\n"); + post_function = 4; + m_postdata = new String(""); + m_postdata = m_postdata.concat(s); + m_bIsPostDataConnect = true; + return CV_OK; + } + + public int GetMotionFlag() + { + return m_MotionFlag; + } + + public void StartAudioOut() + { + m_AudioOut = true; + if(m_TwoWay == 0) + turn_sound_off = true; + } + + public void StopAudioOut() + { + m_AudioOut = false; + AudioOutStatus = 0; + if(m_TwoWay == 0) + mute_start_time = System.currentTimeMillis(); + } + + public int CheckAudioOutStatus() + { + int i = AudioOutStatus; + if(AudioOutStatus < 0) + AudioOutStatus = 0; + return i; + } + + public void ComputePasswordEncryption20(byte abyte0[], byte abyte1[], byte abyte2[]) + { + for(int i = 0; i < 20; i++) + abyte0[i] = abyte1[i]; + + for(int j = 0; j < 2; j++) + { + for(int k = 0; k < 20; k++) + { + abyte0[k] ^= abyte2[k + j * 20]; + byte byte1 = (byte)(abyte0[k] & 0xf); + byte byte0 = (byte)(abyte0[k] & 0xfffffff0); + if((abyte0[k] & 1) != 0) + { + byte1 ^= abyte2[k + j * 20 + 40]; + byte1 &= 0xf; + } + if((abyte0[k] & 0x10) != 0) + { + byte0 ^= abyte2[k + j * 20 + 40]; + byte0 &= 0xf0; + } + abyte0[k] = (byte)(byte0 | byte1); + } + + } + + } + + private int MAX_BUFFER_SIZE; + private String m_sRemoteHost; + private URL m_urlRemoteHost; + private Integer m_iRemotePort; + private Integer m_iTimeout; + private Long m_lPreviewFrameRate; + private Long m_lCameraInfoRefreshRate; + private Double m_dRotateAngle; + private String m_sPassword; + private byte m_baPassword[]; + private String m_postdata; + private String m_postpantiltdata; + private int sub_idx[]; + private int sub_length[]; + private byte substring[]; + private int algorithm; + private int nc; + private int m_TwoWay; + private Thread m_trdCameraImage; + private SI m_trdCameraImageShow; + private TS m_trdTriggerState; + private AU m_trdCameraSound; + private Image m_imgCamera; + private Image m_imgProcess; + private int iLength; + private boolean BufferReady; + private byte imgbuf[]; + private byte tmpbuf[]; + private byte rcvbuf[]; + private Socket m_sktClient; + private DataInputStream m_Input; + private DataOutputStream m_Output; + private Socket m_sktPostData; + private DataInputStream m_PostDataInput; + private DataOutputStream m_PostDataOutput; + private boolean m_bImageThreadRun; + private boolean m_bRealTimeDataThreadRun; + private boolean m_bIsRealTimeDataConnect; + private boolean m_bIsConnect; + private boolean m_bIsPostDataConnect; + private boolean m_PostingData; + private boolean m_PostingPanTiltData; + private long m_lNumFrames; + private long m_lTimerPrev; + private long m_lTimerNow; + private float m_fFrameRate; + private int m_imageUpload; + private int m_imageEmail; + private int m_iIOIn1; + private int m_iIOIn2; + private int m_iIOOut1; + private int m_iIOOut2; + private int m_iSecond; + private int m_iMinute; + private int m_iHour; + private int m_iDate; + private int m_iMonth; + private int m_iDay; + private int m_iYear; + private String m_sTimeString; + private byte m_GetImageString[]; + private byte m_baCliCmdGetRealTimeData[]; + private int HorizontalPosition; + private int VerticalPosition; + private String PositionName; + private int m_PanSingleMoveDegree; + private int m_TiltSingleMoveDegree; + private int CV_OK; + private int CV_ERROR; + private int ratio; + private int scale_method; + private int imgWidth; + private int imgHeight; + private boolean drawLine; + private int block_num; + private int block_on; + private int SoundOn; + private int test_cnt; + private boolean os_windows; + private long mute_start_time; + private BooleanControl muteControl; + private boolean turn_sound_on; + private boolean turn_sound_off; + private int post_function; + private int m_MotionFlag; + private Talkie m_trdTalkie; + private ACS_Control acsControl; + private ACS_Audio acsAudio; + private int AudioOutStatus; + private boolean m_AudioOut; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +} diff --git a/verb/fs.etc_ro.web/web/api/aplug/aplug.jar b/verb/fs.etc_ro.web/web/api/aplug/aplug.jar new file mode 100644 index 0000000..b549b47 Binary files /dev/null and b/verb/fs.etc_ro.web/web/api/aplug/aplug.jar differ diff --git a/verb/fs.etc_ro.web/web/api/aplugLiteDL.cab b/verb/fs.etc_ro.web/web/api/aplugLiteDL.cab new file mode 100644 index 0000000..362e387 Binary files /dev/null and b/verb/fs.etc_ro.web/web/api/aplugLiteDL.cab differ diff --git a/verb/fs.etc_ro.web/web/api/aplugLiteDl/aplugLiteDL.cab b/verb/fs.etc_ro.web/web/api/aplugLiteDl/aplugLiteDL.cab new file mode 100644 index 0000000..362e387 Binary files /dev/null and b/verb/fs.etc_ro.web/web/api/aplugLiteDl/aplugLiteDL.cab differ diff --git a/verb/fs.etc_ro.web/web/api/aplugLiteDl/aplugLiteDL.inf b/verb/fs.etc_ro.web/web/api/aplugLiteDl/aplugLiteDL.inf new file mode 100644 index 0000000..ff7cae1 --- /dev/null +++ b/verb/fs.etc_ro.web/web/api/aplugLiteDl/aplugLiteDL.inf @@ -0,0 +1,25 @@ +[version] + signature="$CHICAGO$" + AdvancedINF=2.0 +[Add.Code] + msvcrt.dll=msvcrt.dll + mfc42.dll=mfc42.dll + olepro32.dll=olepro32.dll + aplugLiteDL.ocx=aplugLiteDL.ocx +[aplugLiteDL.ocx] + file-win32-x86=thiscab + clsid={7191F0AC-D686-46A8-BFCC-EA61778C74DD} + FileVersion=2,3,2,41 + RegisterServer=yes +[msvcrt.dll] + FileVersion=4,20,0,6164 + hook=mfc42installer +[mfc42.dll] + FileVersion=4,2,0,6256 + hook=mfc42installer +[olepro32.dll] + FileVersion=4,2,0,6068 + hook=mfc42installer +[mfc42installer] + file-win32-x86=http://activex.microsoft.com/controls/vc/mfc42.cab + run=%EXTRACT_DIR%\mfc42.exe diff --git a/verb/fs.etc_ro.web/web/api/aplugLiteDl/aplugLiteDL.ocx b/verb/fs.etc_ro.web/web/api/aplugLiteDl/aplugLiteDL.ocx new file mode 100644 index 0000000..76da528 Binary files /dev/null and b/verb/fs.etc_ro.web/web/api/aplugLiteDl/aplugLiteDL.ocx differ diff --git a/verb/fs.etc_ro.web/web/api/sounddb.jar b/verb/fs.etc_ro.web/web/api/sounddb.jar new file mode 100644 index 0000000..423150a Binary files /dev/null and b/verb/fs.etc_ro.web/web/api/sounddb.jar differ diff --git a/verb/fs.etc_ro.web/web/api/sounddb/META-INF/MANIFEST.MF b/verb/fs.etc_ro.web/web/api/sounddb/META-INF/MANIFEST.MF new file mode 100644 index 0000000..8632656 --- /dev/null +++ b/verb/fs.etc_ro.web/web/api/sounddb/META-INF/MANIFEST.MF @@ -0,0 +1,14 @@ +Manifest-Version: 1.0 +Application-Name: sounddb +Permissions: all-permissions +Created-By: 1.7.0_04 (Oracle Corporation) +Caller-Allowable-Codebase: * +Main-Class: sounddb +Codebase: * + +Name: sounddb.class +SHA1-Digest: 5R8mF2pBzyk5sHynPfeR1i251Lc= + +Name: sounddb$AU.class +SHA1-Digest: acxsN9J44TUSmYa1ylUKWfjJDsE= + diff --git a/verb/fs.etc_ro.web/web/api/sounddb/META-INF/WWW_DLIN.RSA b/verb/fs.etc_ro.web/web/api/sounddb/META-INF/WWW_DLIN.RSA new file mode 100644 index 0000000..5a5ffdb Binary files /dev/null and b/verb/fs.etc_ro.web/web/api/sounddb/META-INF/WWW_DLIN.RSA differ diff --git a/verb/fs.etc_ro.web/web/api/sounddb/META-INF/WWW_DLIN.SF b/verb/fs.etc_ro.web/web/api/sounddb/META-INF/WWW_DLIN.SF new file mode 100644 index 0000000..da1eaf3 --- /dev/null +++ b/verb/fs.etc_ro.web/web/api/sounddb/META-INF/WWW_DLIN.SF @@ -0,0 +1,11 @@ +Signature-Version: 1.0 +SHA1-Digest-Manifest-Main-Attributes: X2n8mlKX04cpcm8vj/5IQrf0lS8= +Created-By: 1.6.0_45 (Sun Microsystems Inc.) +SHA1-Digest-Manifest: g9+nyeyOuSAUhC6IQNp3xKUGmYU= + +Name: sounddb.class +SHA1-Digest: DXHVlhyw2rWuueIRRQ6F1jBUOdI= + +Name: sounddb$AU.class +SHA1-Digest: MsGGwNhpi46N81Zp9g5+BpdOMfA= + diff --git a/verb/fs.etc_ro.web/web/api/sounddb/sounddb$AU.class b/verb/fs.etc_ro.web/web/api/sounddb/sounddb$AU.class new file mode 100644 index 0000000..063012d Binary files /dev/null and b/verb/fs.etc_ro.web/web/api/sounddb/sounddb$AU.class differ diff --git a/verb/fs.etc_ro.web/web/api/sounddb/sounddb.class b/verb/fs.etc_ro.web/web/api/sounddb/sounddb.class new file mode 100644 index 0000000..92e9e6b Binary files /dev/null and b/verb/fs.etc_ro.web/web/api/sounddb/sounddb.class differ diff --git a/verb/fs.etc_ro.web/web/api/sounddb/sounddb.jad b/verb/fs.etc_ro.web/web/api/sounddb/sounddb.jad new file mode 100644 index 0000000..be32af1 --- /dev/null +++ b/verb/fs.etc_ro.web/web/api/sounddb/sounddb.jad @@ -0,0 +1,545 @@ +// Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. +// Jad home page: http://www.geocities.com/kpdus/jad.html +// Decompiler options: packimports(3) +// Source File Name: sounddb.java + +import java.applet.Applet; +import java.awt.*; +import java.io.*; +import java.net.Socket; +import java.net.URL; +import java.security.MessageDigest; +import java.util.Random; +import javax.sound.sampled.*; + +public class sounddb extends Applet + implements Runnable +{ + class AU extends Thread + { + + public void run() + { + do + { + if(!ThreadRun) + break; + try + { + if(algorithm == 0 || algorithm == 2) + sTmp = new String("GET /audio.cgi HTTP/1.0\r\nUser-Agent: user\r\nAuthorization: Basic "); + else + sTmp = new String("GET /dgaudio.cgi HTTP/1.0\r\nUser-Agent: user\r\nAuthorization: Basic "); + sTmp = sTmp.concat(m_sPassword); + sTmp = sTmp.concat("\r\n\r\n"); + m_GetSoundString = sTmp.getBytes("8859_1"); + do + { + Thread.currentThread(); + Thread.sleep(100L); + if(m_iRemotePort.intValue() == 8481 || m_iRemotePort.intValue() == 80) + m_sktSound = new Socket(m_sRemoteHost, 80); + else + m_sktSound = new Socket(m_sRemoteHost, m_iRemotePort.intValue()); + m_sktSound.setSoTimeout(30000); + m_sktSound.setKeepAlive(true); + m_soundInput = new DataInputStream(m_sktSound.getInputStream()); + m_soundOutput = new DataOutputStream(m_sktSound.getOutputStream()); + m_soundOutput.write(m_GetSoundString); + m_soundInput.read(rData, 0, 64); + String s = new String(rData, 0, 64); + if(s != null && s.indexOf("HTTP/") >= 0 && s.indexOf("200") >= 0) + break; + BufferedReader bufferedreader = new BufferedReader(new InputStreamReader(m_sktSound.getInputStream())); + do + { + String s1; + if((s1 = bufferedreader.readLine()) == null) + break; + if(s1.indexOf("WWW-Authenticate: ") < 0) + continue; + int i = s1.indexOf("realm=") + 7; + int j = s1.indexOf('"', i); + realm = s1.substring(i, j); + i = s1.indexOf("qop=") + 5; + j = s1.indexOf('"', i); + qop = s1.substring(i, j); + i = s1.indexOf("nonce=") + 7; + j = s1.indexOf('"', i); + nonce = s1.substring(i, j); + break; + } while(true); + if(algorithm == 0) + { + sTmp = new String("GET /audio.cgi HTTP/1.0\r\nUser-Agent: user\r\nAuthorization: Basic "); + sTmp = sTmp.concat(m_sPassword); + } else + if(algorithm == 1) + { + String s2 = GetDigestAuthentication("/dgaudio.cgi", realm, qop, nonce); + sTmp = new String("GET /dgaudio.cgi HTTP/1.0\r\nUser-Agent: user\r\nAuthorization: "); + sTmp = sTmp.concat(s2); + } else + { + String s3 = GetDigestAuthentication("/audio.cgi", realm, qop, nonce); + sTmp = new String("GET /audio.cgi HTTP/1.0\r\nUser-Agent: user\r\nAuthorization: "); + sTmp = sTmp.concat(s3); + } + sTmp = sTmp.concat("\r\n\r\n"); + m_GetSoundString = sTmp.getBytes("8859_1"); + m_soundInput.close(); + m_soundOutput.close(); + bufferedreader.close(); + m_sktSound.close(); + m_soundInput = null; + m_soundOutput = null; + bufferedreader = null; + m_sktSound = null; + } while(true); + nRead = 0; + boolean flag = false; + int j1; + do + { + nRead = nRead + m_soundInput.read(rData, nRead, rData.length - nRead); + j1 = 0; + do + { + if(j1 >= nRead - 7) + break; + if(rData[j1] == 13 && rData[j1 + 1] == 10 && rData[j1 + 2] == 13 && rData[j1 + 3] == 10 && rData[j1 + 4] == 82 && rData[j1 + 5] == 73 && rData[j1 + 6] == 70 && rData[j1 + 7] == 70) + { + flag = true; + j1 += 4; + break; + } + j1++; + } while(true); + Thread.currentThread(); + Thread.sleep(3L); + } while(nRead != -1 && !flag); + long l = (long)rData[j1 + 24] + ((long)rData[j1 + 25] << 8) + ((long)rData[j1 + 26] << 16) + ((long)rData[j1 + 27] << 24); + int k = rData[j1 + 22] + (rData[j1 + 23] << 8); + int i1 = rData[j1 + 34] + (rData[j1 + 35] << 8); + j1 += 44; + soundFormat = new AudioFormat(l, i1, k, true, false); + info = new javax.sound.sampled.DataLine.Info(javax/sound/sampled/SourceDataLine, soundFormat, InternalBufferSize); + line = (SourceDataLine)AudioSystem.getLine(info); + line.open(soundFormat, InternalBufferSize); + int k1 = line.getBufferSize(); + mute_start_time = System.currentTimeMillis(); + int l1 = rData[j1 + 63] << 8 + rData[j1 + 62]; + nRead = 0; + int i2 = k * 256; + retry = 0; + do + { + if(nRead == -1 || !ThreadRun) + break; + if(mute_start_time != 0L) + { + if(System.currentTimeMillis() - mute_start_time > 1000L) + { + line.start(); + mute_start_time = 0L; + } else + { + m_soundInput.read(rData, 0, rData.length); + } + Thread.currentThread(); + Thread.sleep(50L); + } else + { + Thread.currentThread(); + Thread.sleep(8L); + nRead = m_soundInput.read(rData, 0, rData.length); + if(nRead > 0 && (k1 - line.available()) / i2 < 50) + if(line.available() >= nRead) + line.write(rData, 0, nRead); + else + line.flush(); + } + } while(true); + } + catch(Exception exception) + { + System.err.println(exception); + } + try + { + line.flush(); + line.stop(); + line.close(); + line = null; + soundFormat = null; + info = null; + m_soundInput.close(); + m_soundOutput.close(); + m_sktSound.close(); + m_soundInput = null; + m_soundOutput = null; + m_sktSound = null; + } + catch(Exception exception1) + { + System.err.println(exception1); + } + } while(true); + } + + int ExternalBufferSize; + int InternalBufferSize; + SourceDataLine line; + String sTmp; + Socket m_sktSound; + DataInputStream m_soundInput; + DataOutputStream m_soundOutput; + AudioFormat soundFormat; + javax.sound.sampled.DataLine.Info info; + int nRead; + int retry; + byte rData[]; + byte m_GetSoundString[]; + String realm; + String qop; + String nonce; + final sounddb this$0; + + AU() + { + this$0 = sounddb.this; + super(); + ExternalBufferSize = 64000; + InternalBufferSize = 64000; + line = null; + sTmp = null; + m_sktSound = null; + m_soundInput = null; + m_soundOutput = null; + soundFormat = null; + info = null; + nRead = 0; + retry = 0; + rData = new byte[ExternalBufferSize]; + realm = null; + qop = null; + nonce = null; + } + } + + + public sounddb() + { + serverAddress = null; + db_val = new int[17]; + detection_level = 85; + ThreadRun = false; + algorithm = 0; + nc = 1; + mute_start_time = 0L; + } + + public void init() + { + try + { + if(getParameter("RemoteHost") != null) + { + m_sRemoteHost = getParameter("RemoteHost"); + } else + { + m_urlRemoteHost = getCodeBase(); + m_sRemoteHost = m_urlRemoteHost.getHost(); + } + m_iRemotePort = Integer.valueOf(getParameter("RemotePort")); + m_sPassword = getParameter("DeviceSerialNo"); + if(getParameter("DetectionLevel") != null) + detection_level = Integer.parseInt(getParameter("DetectionLevel")); + if(getParameter("Algorithm") != null) + algorithm = Integer.parseInt(getParameter("Algorithm")); + } + catch(Exception exception) + { + System.err.println(exception); + } + } + + public void run() + { + Thread thread = Thread.currentThread(); + for(int i = 0; i < 17; i++) + db_val[i] = 0; + + boolean flag = false; + byte abyte0[] = new byte[512]; + byte abyte1[] = new byte[512]; + Object obj = null; + Object obj1 = null; + Object obj2 = null; + Object obj3 = null; + while(ThreadRun) + try + { + String s = new String("GET /sounddb.cgi HTTP/1.0\r\nUser-Agent: user\r\nAuthorization: Basic "); + s = s.concat(m_sPassword); + s = s.concat("\r\n\r\n"); + byte abyte2[] = s.getBytes("8859_1"); + Socket socket; + if(m_iRemotePort.intValue() == 8481 || m_iRemotePort.intValue() == 80) + socket = new Socket(m_sRemoteHost, 80); + else + socket = new Socket(m_sRemoteHost, m_iRemotePort.intValue()); + socket.setSoTimeout(10000); + socket.setKeepAlive(true); + DataInputStream datainputstream = new DataInputStream(socket.getInputStream()); + DataOutputStream dataoutputstream = new DataOutputStream(socket.getOutputStream()); + dataoutputstream.write(abyte2); + int k; + while((k = datainputstream.read(abyte0, 0, 256)) >= 0) + { + if(k == 1) + { + for(int j = 16; j > 0; j--) + db_val[j] = db_val[j - 1]; + + db_val[0] = abyte0[0]; + if(db_val[0] > 100) + db_val[0] = 100; + if(db_val[0] < 0) + db_val[0] = 0; + repaint(); + } + if(db_val[0] >= detection_level) + Toolkit.getDefaultToolkit().beep(); + thread; + Thread.sleep(500L); + } + datainputstream.close(); + dataoutputstream.close(); + socket.close(); + datainputstream = null; + dataoutputstream = null; + socket = null; + } + catch(Exception exception) + { + exception.printStackTrace(); + } + finally + { + throw exception1; + } + } + + public void start() + { + ThreadRun = true; + m_trdCameraSound = new AU(); + m_trdCameraSound.start(); + m_sounddb = new Thread(this); + m_sounddb.start(); + } + + public void Stop() + { + ThreadRun = false; + } + + public void destroy() + { + ThreadRun = false; + } + + public void paint(Graphics g) + { + g.setColor(Color.black); + g.fillRect(0, 0, 576, 240); + g.setColor(Color.gray); + for(int i = 0; i < 6; i++) + g.drawLine(30, i * 40, 575, i * 40); + + g.setColor(Color.lightGray); + g.fillRect(30, 0, 2, 240); + g.fillRect(30, 238, 546, 2); + g.drawString("100", 2, 10); + g.drawString("90", 8, 45); + g.drawString("80", 8, 85); + g.drawString("70", 8, 125); + g.drawString("60", 8, 165); + g.drawString("50", 8, 205); + g.drawString("40", 8, 235); + for(int j = 0; j < 17; j++) + { + if(db_val[j] <= 40) + continue; + if(db_val[j] >= detection_level) + g.setColor(Color.magenta); + else + g.setColor(Color.blue); + g.fillRect(32 + j * 32, 240 - (db_val[j] - 40) * 4, 30, (db_val[j] - 40) * 4 - 2); + } + + g.setColor(Color.red); + if(detection_level >= 100) + g.drawLine(32, 0, 576, 0); + else + if(detection_level <= 40) + g.drawLine(32, 238, 576, 238); + else + g.drawLine(32, 240 - (detection_level - 40) * 4, 576, 240 - (detection_level - 40) * 4); + } + + public void update(Graphics g) + { + paint(g); + } + + public String CvtHex(byte abyte0[]) + { + byte abyte1[] = new byte[abyte0.length * 2]; + for(int i = 0; i < abyte0.length; i++) + { + byte byte0 = (byte)(abyte0[i] >> 4 & 0xf); + if(byte0 <= 9) + abyte1[i * 2] = (byte)(byte0 + 48); + else + abyte1[i * 2] = (byte)((byte0 + 97) - 10); + byte0 = (byte)(abyte0[i] & 0xf); + if(byte0 <= 9) + abyte1[i * 2 + 1] = (byte)(byte0 + 48); + else + abyte1[i * 2 + 1] = (byte)((byte0 + 97) - 10); + } + + return new String(abyte1); + } + + public String decode_base64(byte abyte0[], int i) + { + byte abyte1[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".getBytes(); + byte abyte2[] = new byte[4]; + int j = i % 4; + if(j != 0) + return null; + int k1 = 0; + j = 0; + int k = i / 4; + byte abyte3[] = new byte[k * 3]; + for(int l = 0; l < k; l++) + { + for(int i1 = 0; i1 < 4; i1++) + { + if(abyte0[k1] == 61) + { + abyte2[i1] = 0; + j++; + } else + { + int j1 = 0; + do + { + if(j1 >= 64) + break; + if(abyte0[k1] == abyte1[j1]) + { + abyte2[i1] = (byte)j1; + break; + } + j1++; + } while(true); + } + k1++; + } + + abyte3[l * 3] = (byte)((byte)(abyte2[0] << 2 & 0xfc) | (byte)(abyte2[1] >> 4 & 3)); + abyte3[l * 3 + 1] = (byte)((byte)(abyte2[1] << 4 & 0xf0) | (byte)(abyte2[2] >> 2 & 0xf)); + abyte3[l * 3 + 2] = (byte)((byte)(abyte2[2] << 6 & 0xc0) | abyte2[3]); + } + + return new String(abyte3); + } + + public String GetDigestAuthentication(String s, String s1, String s2, String s3) + { + String s4 = null; + String s5 = null; + String s6 = null; + String s7 = null; + String s8 = null; + String s9 = new String("GET"); + String s10 = decode_base64(m_sPassword.getBytes(), m_sPassword.length()); + s5 = s10.substring(0, s10.indexOf(':')); + if(s10.indexOf('\0') >= 0) + s6 = s10.substring(s10.indexOf(':') + 1, s10.indexOf('\0')); + else + s6 = s10.substring(s10.indexOf(':') + 1); + Random random = new Random(); + byte abyte0[] = new byte[16]; + random.nextBytes(abyte0); + s7 = CvtHex(abyte0); + s8 = String.format("%1$08X", new Object[] { + Integer.valueOf(nc) + }); + nc++; + try + { + MessageDigest messagedigest = MessageDigest.getInstance("MD5"); + messagedigest.update(s5.getBytes()); + messagedigest.update((byte)58); + messagedigest.update(s1.getBytes()); + messagedigest.update((byte)58); + messagedigest.update(s6.getBytes()); + String s12 = CvtHex(messagedigest.digest()); + messagedigest.reset(); + messagedigest.update(s9.getBytes()); + messagedigest.update((byte)58); + messagedigest.update(s.getBytes()); + String s13 = CvtHex(messagedigest.digest()); + messagedigest.reset(); + messagedigest.update(s12.getBytes()); + messagedigest.update((byte)58); + messagedigest.update(s3.getBytes()); + messagedigest.update((byte)58); + if(s2.length() > 0) + { + messagedigest.update(s8.getBytes()); + messagedigest.update((byte)58); + messagedigest.update(s7.getBytes()); + messagedigest.update((byte)58); + messagedigest.update(s2.getBytes()); + messagedigest.update((byte)58); + } + messagedigest.update(s13.getBytes()); + s4 = CvtHex(messagedigest.digest()); + } + catch(Exception exception) + { + exception.printStackTrace(); + } + String s11 = String.format("Digest username=\"%1$s\", realm=\"%2$s\", uri=\"%3$s\", algorithm=MD5, nonce=\"%4$s\", cnonce=\"%5$s\", qop=%6$s, nc=%7$s, response=\"%8$s\"", new Object[] { + s5, s1, s, s3, s7, s2, s8, s4 + }); + return s11; + } + + private Thread m_sounddb; + private String m_sRemoteHost; + private URL m_urlRemoteHost; + private Integer m_iRemotePort; + private String m_sPassword; + private URL serverAddress; + private int db_val[]; + private int detection_level; + private boolean ThreadRun; + private int algorithm; + private int nc; + private AU m_trdCameraSound; + private long mute_start_time; + + + + + + + +} diff --git a/verb/fs.etc_ro.web/web/api/sounddb/sounddb.jar b/verb/fs.etc_ro.web/web/api/sounddb/sounddb.jar new file mode 100644 index 0000000..423150a Binary files /dev/null and b/verb/fs.etc_ro.web/web/api/sounddb/sounddb.jar differ diff --git a/verb/fs.etc_ro.web/web/cgi/audiocfg.cgi b/verb/fs.etc_ro.web/web/cgi/audiocfg.cgi new file mode 100644 index 0000000..8ccfa57 --- /dev/null +++ b/verb/fs.etc_ro.web/web/cgi/audiocfg.cgi @@ -0,0 +1,2 @@ +AudioEnable=%%AudioEnable();%% +AudioVolume=%%AudioVolume();%% diff --git a/verb/fs.etc_ro.web/web/cgi/cgiversion.cgi b/verb/fs.etc_ro.web/web/cgi/cgiversion.cgi new file mode 100644 index 0000000..ef50b3d --- /dev/null +++ b/verb/fs.etc_ro.web/web/cgi/cgiversion.cgi @@ -0,0 +1 @@ +CGIVersion=%%CGIVersion();%% diff --git a/verb/fs.etc_ro.web/web/cgi/common.cgi b/verb/fs.etc_ro.web/web/cgi/common.cgi new file mode 100644 index 0000000..2870cce --- /dev/null +++ b/verb/fs.etc_ro.web/web/cgi/common.cgi @@ -0,0 +1,17 @@ +model=%%ModelName();%% +brand=%%Company();%% +version=%%FirmwareVersion();%% +build=%%FirmwareVersion(2);%% +hw_version=%%HardwareVersion(2);%% +name=%%CameraName();%% +location=%%Location();%% +macaddr=%%MACAddress(2);%% +ipaddr=%%CurrentIPAddress();%% +netmask=%%CurrentSubnetMask();%% +gateway=%%CurrentDefaultGateway();%% +wireless=%%WirelessSupport();%% +ptz=%%PTZSupport();%% +inputs=0 +outputs=0 +speaker=no +videoout=no diff --git a/verb/fs.etc_ro.web/web/cgi/datetime.cgi b/verb/fs.etc_ro.web/web/cgi/datetime.cgi new file mode 100644 index 0000000..eb42455 --- /dev/null +++ b/verb/fs.etc_ro.web/web/cgi/datetime.cgi @@ -0,0 +1,17 @@ +DateTimeMode=%%DateTimeMode();%% +TimeServerIPAddress=%%TimeServerIPAddress();%% +TimeServerProtocol=%%TimeServerProtocol();%% +TimeZone=%%TimeZone();%% +TimeZoneIndex=%%TimeZoneIndex();%% +Date=%%Date();%% +Time=%%Time();%% +DSTEnable=%%DSTEnable();%% +DSTOffset=%%DSTOffset();%% +DSTStartMonth=%%DSTStartMonth();%% +DSTStartWeek=%%DSTStartWeek();%% +DSTStartDay=%%DSTStartDay();%% +DSTStartTime=%%DSTStartTime();%% +DSTEndMonth=%%DSTEndMonth();%% +DSTEndWeek=%%DSTEndWeek();%% +DSTEndDay=%%DSTEndDay();%% +DSTEndTime=%%DSTEndTime();%% diff --git a/verb/fs.etc_ro.web/web/cgi/daynight.cgi b/verb/fs.etc_ro.web/web/cgi/daynight.cgi new file mode 100644 index 0000000..944b4f7 --- /dev/null +++ b/verb/fs.etc_ro.web/web/cgi/daynight.cgi @@ -0,0 +1,16 @@ +DayNightMode=%%DayNightMode();%% +LightSensorControl=%%LightSensorControl();%% +IRLedScheduleSunStart=%%IRLedScheduleSunStart();%% +IRLedScheduleSunEnd=%%IRLedScheduleSunEnd();%% +IRLedScheduleMonStart=%%IRLedScheduleMonStart();%% +IRLedScheduleMonEnd=%%IRLedScheduleMonEnd();%% +IRLedScheduleTueStart=%%IRLedScheduleTueStart();%% +IRLedScheduleTueEnd=%%IRLedScheduleTueEnd();%% +IRLedScheduleWedStart=%%IRLedScheduleWedStart();%% +IRLedScheduleWedEnd=%%IRLedScheduleWedEnd();%% +IRLedScheduleThuStart=%%IRLedScheduleThuStart();%% +IRLedScheduleThuEnd=%%IRLedScheduleThuEnd();%% +IRLedScheduleFriStart=%%IRLedScheduleFriStart();%% +IRLedScheduleFriEnd=%%IRLedScheduleFriEnd();%% +IRLedScheduleSatStart=%%IRLedScheduleSatStart();%% +IRLedScheduleSatEnd=%%IRLedScheduleSatEnd();%% diff --git a/verb/fs.etc_ro.web/web/cgi/dbglevel.cgi b/verb/fs.etc_ro.web/web/cgi/dbglevel.cgi new file mode 100644 index 0000000..141faed --- /dev/null +++ b/verb/fs.etc_ro.web/web/cgi/dbglevel.cgi @@ -0,0 +1 @@ +WebDebugLevel=%%WebDebugLevel();%% diff --git a/verb/fs.etc_ro.web/web/cgi/email.cgi b/verb/fs.etc_ro.web/web/cgi/email.cgi new file mode 100644 index 0000000..27e68ac --- /dev/null +++ b/verb/fs.etc_ro.web/web/cgi/email.cgi @@ -0,0 +1,15 @@ +EmailSMTPServerAddress=%%EmailSMTPServerAddress();%% +EmailSMTPPortNumber=%%EmailSMTPPortNumber();%% +EmailSenderAddress=%%EmailSenderAddress();%% +EmailReceiverAddress=%%EmailReceiverAddress();%% +EmailUserName=%%EmailUserName();%% +EmailPassword=%%EmailPassword();%% +EmailTLSAuthentication=%%EmailTLSAuthentication();%% +EmailScheduleEnable=%%EmailScheduleEnable();%% +EmailScheduleMode=%%EmailScheduleMode();%% +EmailScheduleDay=%%EmailScheduleDay();%% +EmailScheduleTimeStart=%%EmailScheduleTimeStart();%% +EmailScheduleTimeStop=%%EmailScheduleTimeStop();%% +EmailScheduleInterval=%%EmailScheduleInterval();%% +EmailMotionMode=%%EmailMotionMode();%% +EmailMotionFrameInterval=%%EmailMotionFrameInterval();%% diff --git a/verb/fs.etc_ro.web/web/cgi/iactiveuser.cgi b/verb/fs.etc_ro.web/web/cgi/iactiveuser.cgi new file mode 100644 index 0000000..b64798b --- /dev/null +++ b/verb/fs.etc_ro.web/web/cgi/iactiveuser.cgi @@ -0,0 +1 @@ +%%ActiveUserTable(1);%% diff --git a/verb/fs.etc_ro.web/web/cgi/iaudio.cgi b/verb/fs.etc_ro.web/web/cgi/iaudio.cgi new file mode 100644 index 0000000..e8f153f --- /dev/null +++ b/verb/fs.etc_ro.web/web/cgi/iaudio.cgi @@ -0,0 +1,4 @@ +Audio=%%AudioEnable();%% +Volume=%%AudioVolume();%% +Codec=%%AudioCodec();%% +SampleRate=%%AudioSampleRate();%% diff --git a/verb/fs.etc_ro.web/web/cgi/iimage.cgi b/verb/fs.etc_ro.web/web/cgi/iimage.cgi new file mode 100644 index 0000000..d96940c --- /dev/null +++ b/verb/fs.etc_ro.web/web/cgi/iimage.cgi @@ -0,0 +1,6 @@ +VideoResolution=%%StringOfVideoResolution();%% +CompressionRate=%%StringOfCompressionRate();%% +FrameRate=%%StringOfFrameRate();%% +ViewMode=%%ViewMode();%% +FrameSize=%%FrameSize();%% Bytes +LightFrequency=%%StringOfLightFrequency();%% diff --git a/verb/fs.etc_ro.web/web/cgi/image.cgi b/verb/fs.etc_ro.web/web/cgi/image.cgi new file mode 100644 index 0000000..c1c6db7 --- /dev/null +++ b/verb/fs.etc_ro.web/web/cgi/image.cgi @@ -0,0 +1,10 @@ +VideoResolution=%%VideoResolution();%% +CompressionRate=%%CompressionRate();%% +FrameRate=%%FrameRate();%% +ViewMode=%%ViewMode();%% +BrightnessControl=%%BrightnessControl();%% +ContrastControl=%%ContrastControl();%% +SaturationControl=%%SaturationControl();%% +LightFrequency=%%LightFrequency();%% +Mirror=%%Mirror();%% +AntiFlickerEnable=%%AntiFlickerEnable();%% diff --git a/verb/fs.etc_ro.web/web/cgi/inetwork.cgi b/verb/fs.etc_ro.web/web/cgi/inetwork.cgi new file mode 100644 index 0000000..25687af --- /dev/null +++ b/verb/fs.etc_ro.web/web/cgi/inetwork.cgi @@ -0,0 +1,11 @@ +IPAddress=%%CurrentIPAddress();%% +SubnetMask=%%CurrentSubnetMask();%% +DefaultGateway=%%CurrentDefaultGateway();%% +PrimaryDNSAddress=%%DNSIPAddress1();%% +SecondaryDNSAddress=%%DNSIPAddress2();%% +DynamicDNS=%%StatusOfDynamicDNS();%% +SecondaryHTTPPort=%%StringOfSecondHTTPPortEnable();%% (Port : %%SecondHTTPPort();%%) +UPnP=%%StringOfUPnPEnable();%% (IP : %%GotIPFromUpnp();%%) +UPnPPortForwarding=%%StatusOfUPnPPortForwarding();%% +BonjourEnable=%%StringOfBonjourEnable();%% +BonjourName=%%BonjourName();%% \ No newline at end of file diff --git a/verb/fs.etc_ro.web/web/cgi/isysdevice.cgi b/verb/fs.etc_ro.web/web/cgi/isysdevice.cgi new file mode 100644 index 0000000..d59e3eb --- /dev/null +++ b/verb/fs.etc_ro.web/web/cgi/isysdevice.cgi @@ -0,0 +1,13 @@ +Model=%%ModelName();%% +ModelDesc=%%ModelDescription();%% +FirmwareVersion=%%FirmwareVersion();%% (%%ReleaseDate();%%) +HarwareVersion=%%HardwareVersion();%% +ROMVersion=%%ROMVersion();%% +Company=%%Company();%% +CompanyURL=%%CompanyURL();%% + +MACAddress=%%MACAddress();%% +IPAddress=%%CurrentIPAddress();%% +EthernetLink=%%EthernetLink();%% +EthernetSpeed=%%EthernetSpeed();%% bps +EthernetDuplex=%%EthernetDuplex();%% diff --git a/verb/fs.etc_ro.web/web/cgi/isystem.cgi b/verb/fs.etc_ro.web/web/cgi/isystem.cgi new file mode 100644 index 0000000..9e78cd8 --- /dev/null +++ b/verb/fs.etc_ro.web/web/cgi/isystem.cgi @@ -0,0 +1,10 @@ +CameraName=%%CameraName();%% +Location=%%Location();%% +Model=%%ModelName();%% +FirmwareVersion=%%FirmwareVersion();%% (%%ReleaseDate();%%) +HardwareVersion=%%HardwareVersion(2);%% +MACAddress=%%MACAddress();%% +IPAddress=%%CurrentIPAddress();%% +EthernetLink=%%EthernetLink();%% +EthernetSpeed=%%EthernetSpeed();%% bps +EthernetDuplex=%%EthernetDuplex();%% diff --git a/verb/fs.etc_ro.web/web/cgi/iwireless.cgi b/verb/fs.etc_ro.web/web/cgi/iwireless.cgi new file mode 100644 index 0000000..d71cc8e --- /dev/null +++ b/verb/fs.etc_ro.web/web/cgi/iwireless.cgi @@ -0,0 +1,6 @@ +ConnectionMode=%%StringOfConnectionMode();%% +WirelessLink=%%WirelessLink();%% +SSID=%%WirelessCurrentSSID();%% (MAC : %%WirelessCurrentAPMACAddress();%%) +WirelessChannel=%%WirelessCurrentChannel();%% +TransmissionRate=%%WirelessCurrentTransmissionRate();%% +WEPEncryption=%%WirelessCurrentEncryption();%% diff --git a/verb/fs.etc_ro.web/web/cgi/motion.cgi b/verb/fs.etc_ro.web/web/cgi/motion.cgi new file mode 100644 index 0000000..3d822f4 --- /dev/null +++ b/verb/fs.etc_ro.web/web/cgi/motion.cgi @@ -0,0 +1,7 @@ +MotionDetectionEnable=%%MotionDetectionEnable();%% +MotionDetectionBlockSet=%%MotionDetectionBlockSet();%% +MotionDetectionSensitivity=%%MotionDetectionSensitivity();%% +MotionDetectionScheduleMode=%%MotionDetectionScheduleMode();%% +MotionDetectionScheduleDay=%%MotionDetectionScheduleDay();%% +MotionDetectionScheduleTimeStart=%%MotionDetectionScheduleTimeStart();%% +MotionDetectionScheduleTimeStop=%%MotionDetectionScheduleTimeStop();%% diff --git a/verb/fs.etc_ro.web/web/cgi/network.cgi b/verb/fs.etc_ro.web/web/cgi/network.cgi new file mode 100644 index 0000000..9fa8a5e --- /dev/null +++ b/verb/fs.etc_ro.web/web/cgi/network.cgi @@ -0,0 +1,19 @@ +IPAddressMode=%%IPAddressMode();%% +IPAddress=%%IPAddress();%% +SubnetMask=%%SubnetMask();%% +DefaultGateway=%%DefaultGateway();%% +PPPoEUserID=%%PPPoEUserID();%% +PPPoEPassword=%%PPPoEPassword();%% +DNSIPAddress1=%%DNSIPAddress1();%% +DNSIPAddress2=%%DNSIPAddress2();%% +DDNSEnable=%%DDNSEnable();%% +DDNSProvider=%%DDNSProvider();%% +DDNSHostName=%%DDNSHostName();%% +DDNSUserName=%%DDNSUserName();%% +DDNSPassword=%%DDNSPassword();%% +SecondHTTPPortEnable=%%SecondHTTPPortEnable();%% +SecondHTTPPort=%%SecondHTTPPort();%% +UPnPEnable=%%UPnPEnable();%% +UPnPPortForwarding=%%UPnPPortForwarding();%% +BonjourEnable=%%BonjourEnable();%% +BonjourName=%%BonjourName();%% \ No newline at end of file diff --git a/verb/fs.etc_ro.web/web/cgi/sdbdetection.cgi b/verb/fs.etc_ro.web/web/cgi/sdbdetection.cgi new file mode 100644 index 0000000..fc98d47 --- /dev/null +++ b/verb/fs.etc_ro.web/web/cgi/sdbdetection.cgi @@ -0,0 +1,6 @@ +SoundDetectionEnable=%%SoundDetectionEnable();%% +SoundDetectionDB=%%SoundDetectionDB();%% +SoundDetectionScheduleMode=%%SoundDetectionScheduleMode();%% +SoundDetectionScheduleDay=%%SoundDetectionScheduleDay();%% +SoundDetectionScheduleTimeStart=%%SoundDetectionScheduleTimeStart();%% +SoundDetectionScheduleTimeStop=%%SoundDetectionScheduleTimeStop();%% \ No newline at end of file diff --git a/verb/fs.etc_ro.web/web/cgi/sitesurvey.cgi b/verb/fs.etc_ro.web/web/cgi/sitesurvey.cgi new file mode 100644 index 0000000..2fc4d88 --- /dev/null +++ b/verb/fs.etc_ro.web/web/cgi/sitesurvey.cgi @@ -0,0 +1 @@ +%%SiteSurveyList();%% \ No newline at end of file diff --git a/verb/fs.etc_ro.web/web/cgi/strminfo.cgi b/verb/fs.etc_ro.web/web/cgi/strminfo.cgi new file mode 100644 index 0000000..fd75931 --- /dev/null +++ b/verb/fs.etc_ro.web/web/cgi/strminfo.cgi @@ -0,0 +1,11 @@ +videos=MJPEG +resolutions=640x480,320x240,160x120 +vprofilenum=1 +vprofile1=MJPEG +vprofileurl1=/video.cgi +vprofileres1=%%StringOfVideoResolution();%% +vDprofileurl1=/dgvideo.cgi +aprofilenum=1 +aprofile1=PCM +aprofileurl1=/audio.cgi +aDprofileurl1=/dgaudio.cgi diff --git a/verb/fs.etc_ro.web/web/cgi/system.cgi b/verb/fs.etc_ro.web/web/cgi/system.cgi new file mode 100644 index 0000000..4d23264 --- /dev/null +++ b/verb/fs.etc_ro.web/web/cgi/system.cgi @@ -0,0 +1,6 @@ +CameraName=%%CameraName();%% +Location=%%Location();%% +AdminID=%%AdminID();%% +AdminPassword=%%AdminPassword();%% +LEDControl=%%LEDControl();%% +SnapshotURLAuthentication=%%SnapshotURLAuthentication();%% \ No newline at end of file diff --git a/verb/fs.etc_ro.web/web/cgi/upgradestatus.cgi b/verb/fs.etc_ro.web/web/cgi/upgradestatus.cgi new file mode 100644 index 0000000..df08eb9 --- /dev/null +++ b/verb/fs.etc_ro.web/web/cgi/upgradestatus.cgi @@ -0,0 +1 @@ +upgrade=%%LastDownloadStatus();%% diff --git a/verb/fs.etc_ro.web/web/cgi/upload.cgi b/verb/fs.etc_ro.web/web/cgi/upload.cgi new file mode 100644 index 0000000..15843d3 --- /dev/null +++ b/verb/fs.etc_ro.web/web/cgi/upload.cgi @@ -0,0 +1,18 @@ +FTPHostAddress=%%FTPHostAddress();%% +FTPPortNumber=%%FTPPortNumber();%% +FTPUserName=%%FTPUserName();%% +FTPPassword=%%FTPPassword();%% +FTPDirectoryPath=%%FTPDirectoryPath();%% +FTPPassiveMode=%%FTPPassiveMode();%% +FTPScheduleEnable=%%FTPScheduleEnable();%% +FTPScheduleMode=%%FTPScheduleMode();%% +FTPScheduleDay=%%FTPScheduleDay();%% +FTPScheduleTimeStart=%%FTPScheduleTimeStart();%% +FTPScheduleTimeStop=%%FTPScheduleTimeStop();%% +FTPScheduleVideoFrequencyMode=%%FTPScheduleVideoFrequencyMode();%% +FTPScheduleFramePerSecond=%%FTPScheduleFramePerSecond();%% +FTPScheduleSecondPerFrame=%%FTPScheduleSecondPerFrame();%% +FTPScheduleBaseFileName=%%FTPScheduleBaseFileName();%% +FTPScheduleFileMode=%%FTPScheduleFileMode();%% +FTPScheduleMaxFileSequenceNumber=%%FTPScheduleMaxFileSequenceNumber();%% +FTPCreateFolderInterval=%%FTPCreateFolderInterval();%% diff --git a/verb/fs.etc_ro.web/web/cgi/user.cgi b/verb/fs.etc_ro.web/web/cgi/user.cgi new file mode 100644 index 0000000..fc02c5c --- /dev/null +++ b/verb/fs.etc_ro.web/web/cgi/user.cgi @@ -0,0 +1 @@ +AccessControlEnable=%%AccessControlEnable();%% diff --git a/verb/fs.etc_ro.web/web/cgi/userlist.cgi b/verb/fs.etc_ro.web/web/cgi/userlist.cgi new file mode 100644 index 0000000..1220d10 --- /dev/null +++ b/verb/fs.etc_ro.web/web/cgi/userlist.cgi @@ -0,0 +1 @@ +%%UserTable(1);%% diff --git a/verb/fs.etc_ro.web/web/cgi/usermod.cgi b/verb/fs.etc_ro.web/web/cgi/usermod.cgi new file mode 100644 index 0000000..96517e0 --- /dev/null +++ b/verb/fs.etc_ro.web/web/cgi/usermod.cgi @@ -0,0 +1,3 @@ +name=%%ModName();%% +password=%%ModPassword();%% +group=%%ModGroup();%% diff --git a/verb/fs.etc_ro.web/web/cgi/wireless.cgi b/verb/fs.etc_ro.web/web/cgi/wireless.cgi new file mode 100644 index 0000000..4ac7112 --- /dev/null +++ b/verb/fs.etc_ro.web/web/cgi/wireless.cgi @@ -0,0 +1,16 @@ +WirelessDisable=%%WirelessDisable();%% +ConnectionMode=%%ConnectionMode();%% +SSID=%%SSID();%% +WirelessChannel=%%WirelessChannel();%% +TransmissionRate=%%StringOfTransmissionRate();%% +WEPEncryption=%%WEPEncryption();%% +WEPKeyFormat=%%WEPKeyFormat();%% +Key1=%%Key1();%% +Key2=%%Key2();%% +Key3=%%Key3();%% +Key4=%%Key4();%% +TxKey=%%TxKey();%% +BeaconInterval=%%BeaconInterval();%% +Preamble=%%Preamble();%% +AuthenticationType=%%AuthenticationType();%% +PreSharedKey=%%PreSharedKey();%% diff --git a/verb/fs.etc_ro.web/web/dcs932lb2.jpg b/verb/fs.etc_ro.web/web/dcs932lb2.jpg new file mode 100644 index 0000000..ee00df0 Binary files /dev/null and b/verb/fs.etc_ro.web/web/dcs932lb2.jpg differ diff --git a/verb/fs.etc_ro.web/web/devmodel.jpg b/verb/fs.etc_ro.web/web/devmodel.jpg new file mode 100644 index 0000000..736d83c Binary files /dev/null and b/verb/fs.etc_ro.web/web/devmodel.jpg differ diff --git a/verb/fs.etc_ro.web/web/dloadbar.gif b/verb/fs.etc_ro.web/web/dloadbar.gif new file mode 100644 index 0000000..35117d5 Binary files /dev/null and b/verb/fs.etc_ro.web/web/dloadbar.gif differ diff --git a/verb/fs.etc_ro.web/web/edit.jpg b/verb/fs.etc_ro.web/web/edit.jpg new file mode 100644 index 0000000..24a3ef7 Binary files /dev/null and b/verb/fs.etc_ro.web/web/edit.jpg differ diff --git a/verb/fs.etc_ro.web/web/favicon.ico b/verb/fs.etc_ro.web/web/favicon.ico new file mode 100644 index 0000000..d577080 Binary files /dev/null and b/verb/fs.etc_ro.web/web/favicon.ico differ diff --git a/verb/fs.etc_ro.web/web/pack/cht b/verb/fs.etc_ro.web/web/pack/cht new file mode 100644 index 0000000..deab2e1 Binary files /dev/null and b/verb/fs.etc_ro.web/web/pack/cht differ diff --git a/verb/fs.etc_ro.web/web/pack/dbgulf b/verb/fs.etc_ro.web/web/pack/dbgulf new file mode 100644 index 0000000..1d3012c Binary files /dev/null and b/verb/fs.etc_ro.web/web/pack/dbgulf differ diff --git a/verb/fs.etc_ro.web/web/pack/eng b/verb/fs.etc_ro.web/web/pack/eng new file mode 100644 index 0000000..c316255 Binary files /dev/null and b/verb/fs.etc_ro.web/web/pack/eng differ diff --git a/verb/fs.etc_ro.web/web/pack/frh b/verb/fs.etc_ro.web/web/pack/frh new file mode 100644 index 0000000..54579cc Binary files /dev/null and b/verb/fs.etc_ro.web/web/pack/frh differ diff --git a/verb/fs.etc_ro.web/web/pack/grm b/verb/fs.etc_ro.web/web/pack/grm new file mode 100644 index 0000000..ff239ff Binary files /dev/null and b/verb/fs.etc_ro.web/web/pack/grm differ diff --git a/verb/fs.etc_ro.web/web/pack/itn b/verb/fs.etc_ro.web/web/pack/itn new file mode 100644 index 0000000..9406e7f Binary files /dev/null and b/verb/fs.etc_ro.web/web/pack/itn differ diff --git a/verb/fs.etc_ro.web/web/pack/kor b/verb/fs.etc_ro.web/web/pack/kor new file mode 100644 index 0000000..44319f8 Binary files /dev/null and b/verb/fs.etc_ro.web/web/pack/kor differ diff --git a/verb/fs.etc_ro.web/web/pack/sph b/verb/fs.etc_ro.web/web/pack/sph new file mode 100644 index 0000000..d1ae23a Binary files /dev/null and b/verb/fs.etc_ro.web/web/pack/sph differ diff --git a/verb/fs.etc_ro.web/web/pack/twn b/verb/fs.etc_ro.web/web/pack/twn new file mode 100644 index 0000000..78d9983 Binary files /dev/null and b/verb/fs.etc_ro.web/web/pack/twn differ diff --git a/verb/fs.etc_ro.web/web/radiooff.gif b/verb/fs.etc_ro.web/web/radiooff.gif new file mode 100644 index 0000000..b246acb Binary files /dev/null and b/verb/fs.etc_ro.web/web/radiooff.gif differ diff --git a/verb/fs.etc_ro.web/web/radioon.gif b/verb/fs.etc_ro.web/web/radioon.gif new file mode 100644 index 0000000..8ebd283 Binary files /dev/null and b/verb/fs.etc_ro.web/web/radioon.gif differ diff --git a/verb/fs.etc_ro.web/web/security.gif b/verb/fs.etc_ro.web/web/security.gif new file mode 100644 index 0000000..6234cf8 Binary files /dev/null and b/verb/fs.etc_ro.web/web/security.gif differ diff --git a/verb/fs.etc_ro.web/web/title.gif b/verb/fs.etc_ro.web/web/title.gif new file mode 100644 index 0000000..a371fad Binary files /dev/null and b/verb/fs.etc_ro.web/web/title.gif differ diff --git a/verb/fs.etc_ro.web/web/trash.jpg b/verb/fs.etc_ro.web/web/trash.jpg new file mode 100644 index 0000000..97c2a48 Binary files /dev/null and b/verb/fs.etc_ro.web/web/trash.jpg differ diff --git a/verb/fs.sbin/acodec b/verb/fs.sbin/acodec new file mode 100755 index 0000000..249c1f9 --- /dev/null +++ b/verb/fs.sbin/acodec @@ -0,0 +1,33 @@ +#!/bin/sh +# acodec -a -d + +if [ "$1" == "-a" ]; then + if [ "$2" == "" ]; then + echo "Usage: acodec -a -d " + fi + if [ "$3" == "" ]; then + i2c -cfg f8 -dev 1a -clk 200 -a $2 + echo "read WM8960: Register ($2)." + elif [ "$3" != "-d" ] || [ "$4" == "" ]; then + echo "Usage: acodec -a -d " + else + i2c -cfg f8 -dev 1a -clk 200 -a $2 -d $4 + echo "write WM8960: Register ($2), Data ($4)." + fi + exit +fi + +if [ "$1" == "-d" ]; then + if [ "$2" == "" ]; then + echo "Usage: acodec -a -d " + fi + if [ "$3" != "-a" ] || [ "$4" == "" ]; then + echo "Usage: acodec -a -d " + else + i2c -cfg f8 -dev 1a -clk 200 -a $4 -d $2 + echo "write WM8960: Register ($4), Data ($2)." + fi + exit +fi +echo "Usage: acodec -a -d " + diff --git a/verb/fs.sbin/automount.sh b/verb/fs.sbin/automount.sh new file mode 100755 index 0000000..25c69f8 --- /dev/null +++ b/verb/fs.sbin/automount.sh @@ -0,0 +1,56 @@ +#! /bin/sh +if [ "$1" == "" ]; then +echo "parameter is none" +exit 1 +else + echo "***** $1 *****" +fi +mounted=`mount | grep $1 | wc -l` + +# mounted, assume we umount +if [ $mounted -ge 1 ]; then +echo "R/media/$1" +echo "R/media/$1" +if ! umount "/media/$1"; then +exit 1 +fi + +if ! rm -r "/media/$1"; then +exit 1 +fi +# not mounted, lets mount under /media +else +if ! mkdir -p "/media/$1"; then +exit 1 +fi +chkexfat -f /dev/$1 +chkhfs -f /dev/$1 +chkntfs -f /dev/$1 +mounted=`mount | grep $1 | wc -l` +num=3 +while [ $mounted -lt 1 -a $num -gt 0 ] +do + mount "/dev/$1" "/media/$1" + mounted=`mount | grep $1 | wc -l` + num=`expr $num - 1` +done +mounted=`mount | grep $1 | wc -l` +while [ $mounted -lt 1 -a $num -lt 3 ] +do + ntfs-3g "/dev/$1" "/media/$1" -o force + mounted=`mount | grep $1 | wc -l` + num=`expr $num + 1` +done + +if [ $mounted -lt 1 ]; then +rm -r "/media/$1" +exit 1 +fi +echo "A/media/$1" +echo "A/media/$1" +fi + +# Goahead need to know the event happened. +killall -SIGTTIN goahead +exit 0 + diff --git a/verb/fs.sbin/automount_boot.sh b/verb/fs.sbin/automount_boot.sh new file mode 100755 index 0000000..372470e --- /dev/null +++ b/verb/fs.sbin/automount_boot.sh @@ -0,0 +1,40 @@ +#! /bin/sh +if [ "$1" == "" ]; then +echo "parameter is none" +exit 1 +else + echo "***** $1 *****" +fi +mounted=`mount | grep $1 | wc -l` + +if ! mkdir -p "/media/$1"; then +exit 1 +fi +chkexfat -f /dev/$1 +chkhfs -f /dev/$1 +chkntfs -f /dev/$1 +mounted=`mount | grep $1 | wc -l` +num=3 +while [ $mounted -lt 1 -a $num -gt 0 ] +do + mount "/dev/$1" "/media/$1" + mounted=`mount | grep $1 | wc -l` + num=`expr $num - 1` +done +mounted=`mount | grep $1 | wc -l` +while [ $mounted -lt 1 -a $num -lt 3 ] +do + ntfs-3g "/dev/$1" "/media/$1" -o force + mounted=`mount | grep $1 | wc -l` + num=`expr $num + 1` +done + +if [ $mounted -lt 1 ]; then +rm -r "/media/$1" +exit 1 +fi + +# Goahead need to know the event happened. +killall -SIGTTIN goahead +exit 0 + diff --git a/verb/fs.sbin/cameraname.sh b/verb/fs.sbin/cameraname.sh new file mode 100755 index 0000000..79f3fb0 --- /dev/null +++ b/verb/fs.sbin/cameraname.sh @@ -0,0 +1,16 @@ +#!/bin/sh +# +# $Id: cameraname.sh, v1.00 2009-11-05 andy +# +# usage: cameraname.sh +# + +echo "*** begin cameraname.sh ***" + +# restart dhcp for camera name change (mydlink request -> will cause disconnection on mydlink relay mode) +# gpio dhcp + +# restart mDNSResponder for camera change - Remove (use BonjourName) +# killall -q mDNSResponder +# gpio mDNSResponder + diff --git a/verb/fs.sbin/chpasswd.sh b/verb/fs.sbin/chpasswd.sh new file mode 100755 index 0000000..c82969a --- /dev/null +++ b/verb/fs.sbin/chpasswd.sh @@ -0,0 +1,18 @@ +#!/bin/sh +# +# $Id: chpasswd.sh, v1.01 2015-03-24 steven +# +# usage: chpasswd.sh +# + +user=`nvram_get 2860 AdminID` +pass=`nvram_get 2860 AdminPassword` + +if [ "$user" == "" ]; then + echo "chpasswd: no user name" + exit 1 +fi + +echo "$user:$pass" > /tmp/tmpchpw +chpasswd < /tmp/tmpchpw +rm -f /tmp/tmpchpw diff --git a/verb/fs.sbin/config-dns.sh b/verb/fs.sbin/config-dns.sh new file mode 100755 index 0000000..bb77c7f --- /dev/null +++ b/verb/fs.sbin/config-dns.sh @@ -0,0 +1,29 @@ +#!/bin/sh +# +# $Id: config-dns.sh,v 1.2 2007-10-15 08:26:00 winfred Exp $ +# +# usage: config-dns.sh [] [] +# + +fname="/etc/resolv.conf" +fbak="/etc/resolv_conf.bak" + +# in case no previous file +touch $fname + +# backup file without nameserver part +sed -e '/nameserver/d' $fname > $fbak + +# set primary and seconday DNS +if [ "$1" != "" ]; then + echo "nameserver $1" > $fname +else # empty dns + rm -f $fname +fi +if [ "$2" != "" ]; then + echo "nameserver $2" >> $fname +fi + +cat $fbak >> $fname +rm -f $fbak + diff --git a/verb/fs.sbin/config-igmpproxy.sh b/verb/fs.sbin/config-igmpproxy.sh new file mode 100755 index 0000000..de000f5 --- /dev/null +++ b/verb/fs.sbin/config-igmpproxy.sh @@ -0,0 +1,13 @@ +#!/bin/sh +# +# $Id: //WIFI_SOC/release/SDK_4_1_0_0/source/user/rt2880_app/scripts/config-igmpproxy.sh#1 $ +# +# usage: config-igmpproxy.sh +# + +. /sbin/global.sh + +igmpproxy.sh $wan_ppp_if $lan_if +killall -q igmpproxy +igmpproxy + diff --git a/verb/fs.sbin/config-udhcpd.sh b/verb/fs.sbin/config-udhcpd.sh new file mode 100755 index 0000000..fc41ab0 --- /dev/null +++ b/verb/fs.sbin/config-udhcpd.sh @@ -0,0 +1,225 @@ +#!/bin/sh +# +# $Id: //WIFI_SOC/release/SDK_4_1_0_0/source/user/rt2880_app/scripts/config-udhcpd.sh#1 $ +# +# usage: see function usage() +# +. /sbin/config.sh +. /sbin/global.sh + +fname="/etc/udhcpd.conf" +fbak="/etc/udhcpd.conf_bak" +pidfile="/var/run/udhcpd.pid" +leases="/var/udhcpd.leases" + +usage () { + echo "usage: config-udhcpd.sh [option]..." + echo "options:" + echo " -h : print this help" + echo " -s ipaddr : set ipaddr as start of the IP lease block" + echo " -e ipaddr : set ipaddr as end of the IP lease block" + echo " -i ifc : set ifc as the interface that udhcpd will use" + echo " -d dns1 [dns2] : set dns1 and dns2 as DNS" + echo " -m mask : set mask as subnet netmask" + echo " -g gateway : set gateway as router's IP address" + echo " -t time : set time seconds as the IP life time" + echo " -r [sleep_time] : run dhcp server" + echo " -k : kill the running dhcp server" + echo " -S [mac ipaddr] : statically assign IP to given MAC address" +# echo " -x static_netmask : Ra propritary cmd" +# echo " -y static_router : Ra propritary cmd" + exit +} + +config () { + case "$1" in + "-s") + sed -e '/start/d' $fname > $fbak + echo "start $2" >> $fbak ;; + "-e") + sed -e '/end/d' $fname > $fbak + echo "end $2" >> $fbak ;; + "-i") + sed -e '/interface/d' $fname > $fbak + echo "interface $2" >> $fbak ;; + "-d") + sed -e '/option *dns/d' $fname > $fbak + echo "option dns $2 $3" >> $fbak ;; + "-m") + sed -e '/option *subnet/d' $fname > $fbak + echo "option subnet $2" >> $fbak ;; + "-g") + sed -e '/option *router/d' $fname > $fbak + echo "option router $2" >> $fbak ;; + "-t") + sed -e '/option *lease/d' $fname > $fbak + echo "option lease $2" >> $fbak ;; + "-S") + if [ "$2" = "" ]; then + sed -e '/static_lease/d' $fname > $fbak + elif [ "$3" = "" ]; then + echo "insufficient arguments.." + usage + else + echo "static_lease $2 $3" >> $fname + return + fi + ;; + "-x") + sed -e '/static_netmask/d' $fname > $fbak + echo "static_netmask $2" >> $fbak ;; + "-y") + sed -e '/static_router/d' $fname > $fbak + echo "static_router $2" >> $fbak ;; + *) return;; + esac + cat $fbak > $fname + rm -f $fbak + return +} + +# arg1: phy address. +link_down() +{ + # get original register value + get_mii=`mii_mgr -g -p $1 -r 0` + orig=`echo $get_mii | sed 's/^.....................//'` + + # stupid hex value calculation. + pre=`echo $orig | sed 's/...$//'` + post=`echo $orig | sed 's/^..//'` + num_hex=`echo $orig | sed 's/^.//' | sed 's/..$//'` + case $num_hex in + "0") rep="8" ;; + "1") rep="9" ;; + "2") rep="a" ;; + "3") rep="b" ;; + "4") rep="c" ;; + "5") rep="d" ;; + "6") rep="e" ;; + "7") rep="f" ;; + # The power is already down + *) echo "Port$1 is down. Skip.";return;; + esac + new=$pre$rep$post + # power down + mii_mgr -s -p $1 -r 0 -v $new +} + +link_up() +{ + # get original register value + get_mii=`mii_mgr -g -p $1 -r 0` + orig=`echo $get_mii | sed 's/^.....................//'` + + # stupid hex value calculation. + pre=`echo $orig | sed 's/...$//'` + post=`echo $orig | sed 's/^..//'` + num_hex=`echo $orig | sed 's/^.//' | sed 's/..$//'` + case $num_hex in + "8") rep="0" ;; + "9") rep="1" ;; + "a") rep="2" ;; + "b") rep="3" ;; + "c") rep="4" ;; + "d") rep="5" ;; + "e") rep="6" ;; + "f") rep="7" ;; + # The power is already up + *) echo "Port$1 is up. Skip.";return;; + esac + new=$pre$rep$post + # power up + mii_mgr -s -p $1 -r 0 -v $new +} + +reset_all_phys() +{ + sleep_time=$1 + + if [ "$CONFIG_RAETH_ROUTER" != "y" -a "$CONFIG_RT_3052_ESW" != "y" ]; then + return + fi + + opmode=`nvram_get 2860 OperationMode` + + #skip WAN port + if [ "$opmode" != "1" ]; then #no wan port + link_down 0 + link_down 4 + elif [ "$CONFIG_WAN_AT_P4" = "y" ]; then #wan port at port4 + link_down 0 + elif [ "$CONFIG_WAN_AT_P0" = "y" ]; then #wan port at port0 + link_down 4 + fi + link_down 1 + link_down 2 + link_down 3 + + #force Windows clients to renew IP and update DNS server + sleep $sleep_time + + #skip WAN port + if [ "$opmode" != "1" ]; then #no wan port + link_up 0 + link_up 4 + elif [ "$CONFIG_WAN_AT_P4" = "y" ]; then #wan port at port4 + link_up 0 + elif [ "$CONFIG_WAN_AT_P0" = "y" ]; then #wan port at port0 + link_up 4 + fi + link_up 1 + link_up 2 + link_up 3 +} + +# argv 1 is empty +if [ "$1" = "" ]; then + usage +fi + +# argv 2 is empty +if [ "$2" = "" ]; then + if [ "$1" != "-r" -a "$1" != "-k" -a "$1" != "-S" ]; then + usage + fi +fi + +touch $fname + +case "$1" in + "-h") usage;; + "-s") config "$1" "$2";; + "-e") config "$1" "$2";; + "-i") config "$1" "$2";; + "-d") config "$1" "$2" "$3";; + "-m") config "$1" "$2";; + "-g") config "$1" "$2";; + "-t") config "$1" "$2";; + "-S") config "$1" "$2" "$3";; + "-r") + if [ -e ${pidfile} ]; then + kill `cat $pidfile` + else + killall udhcpd + fi + rm -f $pidfile + touch $leases + sed '/^lease_file /d' $fname > $fbak + cat $fbak > $fname + echo "lease_file $leases" >> $fname + udhcpd $fname + reset_all_phys $2;; + "-k") + if [ -e ${pidfile} ]; then + kill `cat $pidfile` + else + killall udhcpd + fi + rm -f $pidfile ;; + "-x") config "$1" "$2";; + "-y") config "$1" "$2";; + *) usage;; +esac + + diff --git a/verb/fs.sbin/config.sh b/verb/fs.sbin/config.sh new file mode 100755 index 0000000..fd89871 --- /dev/null +++ b/verb/fs.sbin/config.sh @@ -0,0 +1,416 @@ +CONFIG_MIPS=y + +CONFIG_ZONE_DMA=y +CONFIG_RALINK_RT5350_MP=y +CONFIG_RALINK_RT5350=y +CONFIG_RT5350_ASIC=y +CONFIG_RT2880_DRAM_32M=y +CONFIG_MTD_SPI_RALINK=y +CONFIG_KERNEL_NVRAM=y +CONFIG_RALINK_RAM_SIZE=32 +CONFIG_MTD_PHYSMAP_START=0x1C000000 +CONFIG_MTD_PHYSMAP_LEN=0x1000000 +CONFIG_MTD_PHYSMAP_BUSWIDTH=2 +CONFIG_RT2880_ROOTFS_IN_RAM=y +CONFIG_BLK_DEV_RAM_SIZE=8192 +CONFIG_LZMARAMFS=y +CONFIG_RWSEM_GENERIC_SPINLOCK=y +CONFIG_GENERIC_FIND_NEXT_BIT=y +CONFIG_GENERIC_HWEIGHT=y +CONFIG_GENERIC_CALIBRATE_DELAY=y +CONFIG_GENERIC_TIME=y +CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y +CONFIG_DMA_NONCOHERENT=y +CONFIG_DMA_NEED_PCI_MAP_STATE=y +CONFIG_CPU_LITTLE_ENDIAN=y +CONFIG_SYS_SUPPORTS_LITTLE_ENDIAN=y +CONFIG_IRQ_CPU=y +CONFIG_SWAP_IO_SPACE=y +CONFIG_BOOT_ELF32=y +CONFIG_MIPS_L1_CACHE_SHIFT=5 + +CONFIG_CPU_MIPS32_R2=y +CONFIG_SYS_HAS_CPU_MIPS32_R1=y +CONFIG_SYS_HAS_CPU_MIPS32_R2=y +CONFIG_CPU_MIPS32=y +CONFIG_CPU_MIPSR2=y +CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y +CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y + +CONFIG_32BIT=y +CONFIG_PAGE_SIZE_4KB=y +CONFIG_CPU_HAS_PREFETCH=y +CONFIG_MIPS_MT_DISABLED=y +CONFIG_CPU_HAS_LLSC=y +CONFIG_CPU_HAS_SYNC=y +CONFIG_GENERIC_HARDIRQS=y +CONFIG_GENERIC_IRQ_PROBE=y +CONFIG_CPU_SUPPORTS_HIGHMEM=y +CONFIG_ARCH_FLATMEM_ENABLE=y +CONFIG_SELECT_MEMORY_MODEL=y +CONFIG_FLATMEM_MANUAL=y +CONFIG_FLATMEM=y +CONFIG_FLAT_NODE_MEM_MAP=y +CONFIG_SPLIT_PTLOCK_CPUS=4 +CONFIG_ZONE_DMA_FLAG=1 +CONFIG_HZ_250=y +CONFIG_SYS_SUPPORTS_ARBIT_HZ=y +CONFIG_HZ=250 +CONFIG_PREEMPT_NONE=y +CONFIG_LOCKDEP_SUPPORT=y +CONFIG_STACKTRACE_SUPPORT=y +CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" + +CONFIG_EXPERIMENTAL=y +CONFIG_BROKEN_ON_SMP=y +CONFIG_INIT_ENV_ARG_LIMIT=32 + +CONFIG_LOCALVERSION="" +CONFIG_SYSVIPC=y +CONFIG_SYSVIPC_SYSCTL=y +CONFIG_BLK_DEV_INITRD=y +CONFIG_INITRAMFS_SOURCE="../romfs" +CONFIG_INITRAMFS_ROOT_UID=0 +CONFIG_INITRAMFS_ROOT_GID=0 +CONFIG_SYSCTL=y +CONFIG_EMBEDDED=y +CONFIG_SYSCTL_SYSCALL=y +CONFIG_HOTPLUG=y +CONFIG_PRINTK_FUNC=y +CONFIG_PRINTK=y +CONFIG_FUTEX=y +CONFIG_SHMEM=y +CONFIG_SLAB=y +CONFIG_TINY=y +CONFIG_MEMPOOL=y +CONFIG_AIO=y +CONFIG_XATTR=y +CONFIG_FILE_LOCKING=y +CONFIG_INETPEER=y +CONFIG_NET_SK_FILTER=y +CONFIG_NET_DEV_MULTICAST=y +CONFIG_IGMP=y +CONFIG_MAX_SWAPFILES_SHIFT=5 +CONFIG_NR_LDISCS=16 +CONFIG_MAX_USER_RT_PRIO=100 +CONFIG_TINY_EXPERIMENTAL=y +CONFIG_PDFLUSH=y +CONFIG_RT_MUTEXES=y +CONFIG_BASE_SMALL=1 + +CONFIG_MODULES=y +CONFIG_MODULE_UNLOAD=y + +CONFIG_BLOCK=y + +CONFIG_IOSCHED_NOOP=y +CONFIG_DEFAULT_NOOP=y +CONFIG_DEFAULT_IOSCHED="noop" + +CONFIG_MMU=y + + + +CONFIG_BINFMT_ELF=y +CONFIG_TRAD_SIGNALS=y + + +CONFIG_NET=y + +CONFIG_PACKET=y +CONFIG_UNIX=y +CONFIG_INET=y +CONFIG_IP_MULTICAST=y +CONFIG_IP_FIB_HASH=y +CONFIG_IP_MROUTE=y +CONFIG_TCP_CONG_CUBIC=y +CONFIG_DEFAULT_TCP_CONG="cubic" + +CONFIG_NETFILTER=y + +CONFIG_NAT_RCONE=y +CONFIG_NF_CONNTRACK_ENABLED=y +CONFIG_NF_CONNTRACK_SUPPORT=y +CONFIG_NF_CONNTRACK=y +CONFIG_NF_CONNTRACK_FTP=y +CONFIG_NETFILTER_XTABLES=y +CONFIG_NETFILTER_XT_TARGET_TCPMSS=y +CONFIG_NETFILTER_XT_MATCH_TCPMSS=y + +CONFIG_NF_CONNTRACK_IPV4=y +CONFIG_NF_CONNTRACK_PROC_COMPAT=y +CONFIG_IP_NF_IPTABLES=y +CONFIG_NF_NAT=y +CONFIG_NF_NAT_NEEDED=y +CONFIG_IP_NF_TARGET_MASQUERADE=y +CONFIG_IP_NF_TARGET_REDIRECT=y +CONFIG_NF_NAT_FTP=y + + + + +CONFIG_BRIDGE=y +CONFIG_LLC=y + + +CONFIG_WIRELESS_EXT=y + + + + +CONFIG_MTD=y +CONFIG_MTD_PARTITIONS=y + +CONFIG_MTD_CHAR=y +CONFIG_MTD_BLKDEVS=y +CONFIG_MTD_BLOCK=y + +CONFIG_MTD_CFI=y +CONFIG_MTD_GEN_PROBE=y +CONFIG_MTD_MAP_BANK_WIDTH_1=y +CONFIG_MTD_MAP_BANK_WIDTH_2=y +CONFIG_MTD_MAP_BANK_WIDTH_4=y +CONFIG_MTD_CFI_I1=y +CONFIG_MTD_CFI_I2=y +CONFIG_MTD_CFI_AMDSTD=y +CONFIG_MTD_CFI_SSTSTD=y +CONFIG_MTD_CFI_UTIL=y + +CONFIG_MTD_RALINK=y + +CONFIG_MTD_BLOCK2MTD=y + + + + + + +CONFIG_BLK_DEV_RAM=y +CONFIG_BLK_DEV_RAM_COUNT=16 +CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024 + + + + + + + + + +CONFIG_NETDEVICES=y + + +CONFIG_NET_ETHERNET=y +CONFIG_MII=y + + + + +CONFIG_NET_RADIO=y + + +CONFIG_PPP=y +CONFIG_PPP_DEFLATE=y +CONFIG_PPP_BSDCOMP=y +CONFIG_PPPOE=y +CONFIG_SLHC=y + + + + + +CONFIG_RALINK_GPIO=y +CONFIG_RALINK_GPIO_LED=y +CONFIG_RALINK_GDMA=y +CONFIG_GDMA_EVERYBODY=y +CONFIG_RALINK_I2C=y +CONFIG_RALINK_I2S=y +CONFIG_I2S_MCLK_12MHZ=y +CONFIG_SERIAL_NONSTANDARD=y + +CONFIG_SERIAL_8250=y +CONFIG_SERIAL_8250_CONSOLE=y +CONFIG_SERIAL_8250_NR_UARTS=2 +CONFIG_SERIAL_8250_RUNTIME_UARTS=2 +CONFIG_SERIAL_8250_EXTENDED=y +CONFIG_SERIAL_8250_RALINK=y + +CONFIG_SERIAL_CORE=y +CONFIG_SERIAL_CORE_CONSOLE=y +CONFIG_UNIX98_PTYS=y +CONFIG_LEGACY_PTYS=y +CONFIG_LEGACY_PTY_COUNT=256 + + + + + + + + + +CONFIG_VIDEO_DEV=y +CONFIG_VIDEO_V4L1=y +CONFIG_VIDEO_V4L1_COMPAT=y +CONFIG_VIDEO_V4L2=y + + +CONFIG_USB_VIDEO_CLASS=y + + + + + + + + + + + + +CONFIG_SOUND=y + +CONFIG_SND=y +CONFIG_SND_TIMER=y +CONFIG_SND_PCM=y +CONFIG_SND_HWDEP=y +CONFIG_SND_RAWMIDI=y +CONFIG_SND_SUPPORT_OLD_API=y +CONFIG_SND_VERBOSE_PROCFS=y + + + +CONFIG_SND_USB_AUDIO=y + + + +CONFIG_USB_ARCH_HAS_HCD=y +CONFIG_USB_ARCH_HAS_OHCI=y +CONFIG_USB_ARCH_HAS_EHCI=y +CONFIG_USB=y + + +CONFIG_USB_EHCI_HCD=y +CONFIG_RT3XXX_EHCI=y +CONFIG_USB_OHCI_HCD=y +CONFIG_RT3XXX_OHCI=y +CONFIG_USB_OHCI_LITTLE_ENDIAN=y + + + + + + + + + + + + + + + + + + + + + + + + + + + + +CONFIG_PROC_FS=y +CONFIG_PROC_SYSCTL=y +CONFIG_SYSFS=y +CONFIG_RAMFS=y + + + +CONFIG_MSDOS_PARTITION=y + + + + +CONFIG_TRACE_IRQFLAGS_SUPPORT=y +CONFIG_LOG_BUF_SHIFT=14 +CONFIG_CROSSCOMPILE=y +CONFIG_CMDLINE="console=ttyS1,57600n8 root=/dev/ram0" + + + +CONFIG_CRC_CCITT=y +CONFIG_ZLIB_INFLATE=y +CONFIG_ZLIB_DEFLATE=y +CONFIG_PLIST=y +CONFIG_HAS_IOMEM=y +CONFIG_HAS_IOPORT=y + +CONFIG_RALINK_RDM=y +CONFIG_RAETH=y +CONFIG_RA_NETWORK_TASKLET_BH=y +CONFIG_RAETH_SKB_RECYCLE_2K=y +CONFIG_RAETH_CHECKSUM_OFFLOAD=y +CONFIG_RT_3052_ESW=y +CONFIG_LAN_WAN_SUPPORT=y +CONFIG_WAN_AT_P4=y +CONFIG_ESW_DOUBLE_VLAN_TAG=y +CONFIG_WIFI_DRIVER=y +CONFIG_FIRST_IF_RT2860=y +CONFIG_SECOND_IF_NONE=y +CONFIG_RALINK_RT5350_1T1R=y +CONFIG_RT2860V2_STA=y +CONFIG_RT2860V2_STA_WSC=y +CONFIG_RT2860V2_STA_WSC_V2=y +CONFIG_RT2860V2_STA_RTMP_INTERNAL_TX_ALC=y +CONFIG_RT2860V2_STA_ED_MONITOR=y +CONFIG_RT_FIRST_CARD=2860 +CONFIG_RT_FIRST_IF_RF_OFFSET=0x40000 + +CONFIG_LIB_LIBPTHREAD_FORCE=y +CONFIG_LIB_LIBNVRAM_FORCE=y +CONFIG_LIB_LIBUPNP_FORCE=y +CONFIG_LIB_CRYPT_FORCE=y +CONFIG_LIB_LIBM_FORCE=y +CONFIG_LIB_NSL_FORCE=y +CONFIG_LIB_UTIL_FORCE=y +CONFIG_LIB_RT_FORCE=y + + +CONFIG_USER_ALPHAPD_HTTPD=y +CONFIG_USER_ALPHAPD_SSL=y +CONFIG_USER_MATRIXSSL=y +CONFIG_USER_ALPHAPD_LANG_EN=y +CONFIG_LIB_LIBNVRAM_FORCE=y +CONFIG_USER_INADYN=y +CONFIG_USER_MATRIXSSL=y +CONFIG_USER_NTPCLIENT_NTPCLIENT=y +CONFIG_USER_OPENSSL=y +CONFIG_USER_PPPOECD=y +CONFIG_USER_UVC_STREAM=y +CONFIG_USER_UPNP_IGD=y +CONFIG_LIB_LIBPTHREAD_FORCE=y +CONFIG_LIB_LIBUPNP_FORCE=y +CONFIG_USER_WIRELESS_TOOLS=y +CONFIG_USER_WIRELESS_TOOLS_IWPRIV=y + +CONFIG_USER_BUSYBOX_BUSYBOX=y +CONFIG_USER_IPERF=y +CONFIG_LIB_LIBM_FORCE=y +CONFIG_USER_MTD_WRITE=y + +CONFIG_RALINKAPP=y +CONFIG_RALINKAPP_ATED=y +CONFIG_RALINKAPP_REG_RW=y +CONFIG_RALINKAPP_MII_MGR=y +CONFIG_RALINKAPP_NVRAM=y +CONFIG_LIB_LIBNVRAM_FORCE=y +CONFIG_RALINKAPP_GPIO=y +CONFIG_RALINKAPP_SWITCH=y +CONFIG_RALINKAPP_PCM=y +CONFIG_RALINKAPP_SCRIPTS=y + +CONFIG_USER_LLTD=y diff --git a/verb/fs.sbin/cpubusy.sh b/verb/fs.sbin/cpubusy.sh new file mode 100755 index 0000000..54cdbe9 --- /dev/null +++ b/verb/fs.sbin/cpubusy.sh @@ -0,0 +1,28 @@ +#!/bin/sh +# +# $Id: //WIFI_SOC/release/SDK_4_1_0_0/source/user/rt2880_app/scripts/cpubusy.sh#1 $ +# +# usage: cpubysu.sh +# + +echo "" +echo "!! 'killall cpubusy.sh' to Break !!" +echo "" + +file="/tmp/dummy" +cpfile="/tmp/testcopy" +i=0 +x=0 + +while true; do + i=`expr $i + 1` + echo "--- $i ---" > ${file} + j=0 + while [ $j -lt 1000 ]; do + j=`expr $j + 1` + echo " cpu dummy echo for the $i, $j times" >> ${file} + cp /bin/goahead ${cpfile} + done + sleep 1 +done + diff --git a/verb/fs.sbin/ddns.sh b/verb/fs.sbin/ddns.sh new file mode 100755 index 0000000..f0073c1 --- /dev/null +++ b/verb/fs.sbin/ddns.sh @@ -0,0 +1,54 @@ +#!/bin/sh +# +# $Id: ddns.sh, v1.00 2009-11-12 andy +# +# usage: ddns.sh +# + +killall -q inadyn + +# check ddns enable or disable +enable=`nvram_get 2860 DDNSEnable` +if [ "$enable" = "0" ]; then +exit 0 +fi + +srv=`nvram_get 2860 DDNSProvider` +ddns=`nvram_get 2860 DDNSHostName` +u=`nvram_get 2860 DDNSUserName` +pw=`nvram_get 2860 DDNSPassword` +to=`nvram_get 2860 DDNSTimeout` + +if [ "$srv" = "" -o "$srv" = "none" ]; then + exit 0 +fi +if [ "$ddns" = "" -o "$u" = "" -o "$pw" = "" ]; then + exit 0 +fi + +dyndnssrv="dyndns.org" + +if [ "$srv" = "www.dlinkddns.com" ]; then + inadyn -u $u -p $pw -a $ddns --dyndns_system dyndns@$dyndnssrv & +elif [ "$srv" = "www.DynDNS.org(Custom)" ]; then + inadyn -u $u -p $pw -a $ddns --dyndns_system custom@$dyndnssrv & +elif [ "$srv" = "www.DynDNS.org(Free)" ]; then + inadyn -u $u -p $pw -a $ddns --dyndns_system dyndns@$dyndnssrv & +elif [ "$srv" = "www.DynDNS.org" ]; then + inadyn -u $u -p $pw -a $ddns --dyndns_system dyndns@$dyndnssrv & +elif [ "$srv" = "members.dyndns.org" ]; then + inadyn -u $u -p $pw -a $ddns --dyndns_system dyndns@$dyndnssrv & +elif [ "$srv" = "dyndns.org" ]; then + inadyn -u $u -p $pw -a $ddns --dyndns_system dyndns@$dyndnssrv & +elif [ "$srv" = "freedns.afraid.org" ]; then + inadyn -u $u -p $pw -a $ddns --dyndns_system default@$srv & +elif [ "$srv" = "zoneedit.com" ]; then + inadyn -u $u -p $pw -a $ddns --dyndns_system default@$srv & +elif [ "$srv" = "no-ip.com" ]; then + inadyn -u $u -p $pw -a $ddns --dyndns_system default@$srv & +else + inadyn -u $u -p $pw -a $ddns --dyndns_server_name $srv & + #echo "$0: unknown DDNS provider: $srv" + #exit 1 +fi + diff --git a/verb/fs.sbin/dhcp.sh b/verb/fs.sbin/dhcp.sh new file mode 100755 index 0000000..b1d48e6 --- /dev/null +++ b/verb/fs.sbin/dhcp.sh @@ -0,0 +1,24 @@ +#!/bin/sh +# +# $Id: dhcp.sh, v1.00 2009-11-05 andy +# +# usage: dhcp.sh +# + +echo "*** begin dhcp.sh ***" + +lan_if="br0" +gpio dhcpstate 0 +ipmode=`nvram_get 2860 IPAddressMode` + +if [ "$ipmode" = "4" ]; then +echo "*** re-start dhcp client ***" +gpio dhcpstate 1 +gpio defaultip +gpio gw 0.0.0.0 +killall -q udhcpc +cameraname=`nvram_get 2860 CameraName` +udhcpc -i $lan_if -s /sbin/udhcpc.sh -p /var/run/udhcpc.pid -H $cameraname & +else +killall -q udhcpc +fi diff --git a/verb/fs.sbin/focus.sh b/verb/fs.sbin/focus.sh new file mode 100755 index 0000000..c31300f --- /dev/null +++ b/verb/fs.sbin/focus.sh @@ -0,0 +1,9 @@ +#!/bin/sh + +ov7740 -a 13 -d 00 +ov7740 -a 0f -d 00 +ov7740 -a 10 -d FC +ov7740 -a 00 -d 3f +ov7740 -a 01 -d 59 +ov7740 -a 02 -d 59 + diff --git a/verb/fs.sbin/internet.sh b/verb/fs.sbin/internet.sh new file mode 100755 index 0000000..8cf4c17 --- /dev/null +++ b/verb/fs.sbin/internet.sh @@ -0,0 +1,109 @@ +#!/bin/sh +# +# $Id: internet.sh, v1.00 2009-11-05 andy +# +# usage: internet.sh +# + +sleep 1 + +echo "*****************" +echo "* INTERNET.SH *" +echo "*****************" + +# run config.sh if this shell script have any configuration symbol +#. /sbin/config.sh + +lan_if="br0" + +# setup username:password +login=`nvram_get 2860 AdminID` +if [ "$login" = "" ]; then +echo "loading default configuration ..." +sleep 3 +login=`nvram_get 2860 AdminID` +fi +pass=`nvram_get 2860 AdminPassword` +echo "$login::0:0:Adminstrator:/:/bin/sh" > /etc/passwd +echo "$login:x:0:$login" > /etc/group +chpasswd.sh $login $pass + +# ftp server for wireless throughput test +echo "21 stream tcp nowait $login /usr/bin/ftpd ftpd -w" > /etc/inetd.conf +gpio telnetd_ftpd +#inetd & + +# audio +model=`gpio model` +if [ "$model" == "DCS-5000L" ]; then +pcmcmd -s -q 11025 & +else +pcmcmd -s -q 8000 -x 15 & +fi + +# video +uvc_stream -b & +# sleep 2 sec. in order to uvc_stream can get correct configuration data after factory reset +sleep 2 + +# Set RT5350 to dump switch mode (restore to no VLAN partition) +#switch reg w 14 5555 +#switch reg w 40 1001 +#switch reg w 44 1001 +#switch reg w 48 1001 +#switch reg w 4c 1 +#switch reg w 50 2001 +#switch reg w 70 ffffffff +#switch reg w 98 7f7f +#switch reg w e4 7f + +# lo interface up -- mydlink need it +ifconfig lo up + +# setup bridge, lan and wlan interface, and fast forwarding time (setfd, setmaxage) +ifconfig eth2 0.0.0.0 +ifconfig ra0 0.0.0.0 + +brctl addbr br0 +brctl addif br0 ra0 +brctl addif br0 eth2 + +brctl setfd br0 1 +brctl setmaxage br0 1 + +# setup wlan enable/disable +wlanonoff=`nvram_get 2860 WirelessDisable` +if [ "$wlanonoff" = "0" ]; then +gpio wlan 0 +fi +if [ "$wlanonoff" = "1" ]; then +ifconfig ra0 down +gpio wlan 1 +fi + +# setup lan +lan.sh + +# lltd +lld2d $lan_if + +# ping (send arp) +gpio ping & +swing + +# Set RT5350 to dump switch mode (restore to no VLAN partition) +switch reg w 14 5555 +switch reg w 40 1001 +switch reg w 44 1001 +switch reg w 48 1001 +switch reg w 4c 1 +switch reg w 50 2001 +switch reg w 70 ffffffff +switch reg w 98 7f7f +switch reg w e4 7f + +echo "************************" +echo "* END OF INTERNET.SH *" +echo "************************" + + diff --git a/verb/fs.sbin/lan.sh b/verb/fs.sbin/lan.sh new file mode 100755 index 0000000..be5b5ad --- /dev/null +++ b/verb/fs.sbin/lan.sh @@ -0,0 +1,134 @@ +#!/bin/sh +# +# $Id: lan.sh, v1.00 2009-11-05 andy +# +# usage: lan.sh +# + +echo "*** begin lan.sh ***" + +lan_if="br0" + +gpio dhcpstate 0 + +# ip address mode +ipmode=`nvram_get 2860 IPAddressMode` + +# ip address, subnet mask, default gateway +# Fixed IP (1) and PPPoE (5) -- Init with Fixed IP +# DHCP (4) -- Init with Default IP +if [ "$ipmode" != "4" ]; then + +ip=`nvram_get 2860 IPAddress` +nm=`nvram_get 2860 SubnetMask` +gw=`nvram_get 2860 DefaultGateway` +ifconfig $lan_if $ip netmask $nm +route del default +gpio gw 0.0.0.0 +if [ "$gw" == "0.0.0.0" ]; then +gw="" +fi +if [ "$gw" != "" ]; then +route add default gw $gw +gpio gw $gw +else +route add default gw $ip +fi + +else + +gpio defaultip +gpio gw 0.0.0.0 + +fi + +# dns address +pd=`nvram_get 2860 DNSIPAddress1` +sd=`nvram_get 2860 DNSIPAddress2` +config-dns.sh $pd $sd +gpio dns1 0.0.0.0 +gpio dns2 0.0.0.0 +gpio dns1 $pd +gpio dns2 $sd + +# web server alphapd +#killall -q alphapd +#alphapd & +web.sh + +# ddns +ddns.sh + +# ntp +ntp.sh + +# schedule for mail and ftp client +killall -q schedule +killall -q mail +killall -q ftpputimage +schedule & + +# udp configuration and tftp upload +killall -q lanconfig +killall -q tftpupload +lanconfig & +tftpupload & + +# mydlinkevent +killall -q mydlinkevent +mydlinkevent & + +# mDNSResponder +killall -q mDNSResponder +gpio mDNSResponder + +# upnp +#upnp=`nvram_get 2860 UPnPEnable` +#if [ "$upnp" = "1" ]; then +route add -net 239.0.0.0 netmask 255.0.0.0 dev br0 +killall -q udev +killall -q ucp +udev & +ucp & +#else +#route del -net 239.0.0.0 netmask 255.0.0.0 dev br0 +#killall -q udev +#killall -q ucp +#fi + +# mydlink +#/mydlink/opt.local stop +#/mydlink/opt.local start +echo "from lan.sh" +gpio mydlink + + +# dhcp client mode +if [ "$ipmode" = "4" ]; then +gpio dhcpstate 1 +killall -q udhcpc +cameraname=`nvram_get 2860 CameraName` +udhcpc -i $lan_if -s /sbin/udhcpc.sh -p /var/run/udhcpc.pid -H $cameraname & +else +killall -q udhcpc +killall -q zcip +ifconfig br0:0 down +gpio autoip 0.0.0.0 +fi + +# pppoe mode +if [ "$ipmode" = "5" ]; then +u=`nvram_get 2860 PPPoEUserID` +pw=`nvram_get 2860 PPPoEPassword` +# pppoecd must be kill twice. why? +killall -q pppoecd +killall -q pppoecd +gpio pppoe_state 16 +pppoecd $lan_if -u "$u" -p "$pw" -R -k -I 30 -T 6 -N -1 -d & +else +killall -q pppoecd +killall -q pppoecd +gpio pppoe 0.0.0.0 0.0.0.0 +fi + +echo "*** end lan.sh ***" diff --git a/verb/fs.sbin/ntp.sh b/verb/fs.sbin/ntp.sh new file mode 100755 index 0000000..9a6605e --- /dev/null +++ b/verb/fs.sbin/ntp.sh @@ -0,0 +1,38 @@ +#!/bin/sh +# +# $Id: ntp.sh, v1.00 2009-11-09 andy +# +# usage: ntp.sh +# + +killall -q ntpclient + +# check manual mode or NTP mode +mode=`nvram_get 2860 DateTimeMode` +if [ "$mode" = "1" ]; then +exit 0 +fi + +srv=`nvram_get 2860 TimeServerIPAddress` +tz=`nvram_get 2860 TimeZone` + +if [ "$srv" = "" ]; then +exit 0 +fi + +# 10 minutes = 600 seconds +# sync=600 +# change to 24 hour = 24*60*60 = 86400 seconds +sync=86400 + +if [ "$tz" = "" ]; then +tz="UCT_000" +fi + +echo $tz > /etc/tmpTZ +sed -e 's#.*_\(-*\)0*\(.*\)#GMT-\1\2#' /etc/tmpTZ > /etc/tmpTZ2 +sed -e 's#\(.*\)--\(.*\)#\1\2#' /etc/tmpTZ2 > /etc/TZ +rm -rf /etc/tmpTZ +rm -rf /etc/tmpTZ2 +ntpclient -s -c 0 -h $srv -i $sync & + diff --git a/verb/fs.sbin/pppoe.sh b/verb/fs.sbin/pppoe.sh new file mode 100755 index 0000000..ba054df --- /dev/null +++ b/verb/fs.sbin/pppoe.sh @@ -0,0 +1,74 @@ +#!/bin/sh +# +# $Id: pppoe.sh, v1.00 2009-11-11 andy +# +# usage: pppoe.sh +# + +echo "**** pppoe.sh ***" + +# ip address and subnet mask +gpio pppoe 0.0.0.0 0.0.0.0 +gpio pppoe $1 $2 + +# default gateway +if [ $3 != "0.0.0.0" ]; then + gpio gw 0.0.0.0 + gpio gw $3 + route del default dev br0 +else + ip=`nvram_get 2860 IPAddress` + gw=`nvram_get 2860 DefaultGateway` + route del default + gpio gw 0.0.0.0 + if [ "$gw" != "" ]; then + route add default gw $gw + gpio gw $gw + else + route add default gw $ip + fi +fi + +# dns +RESOLV_CONF="/etc/resolv.conf" +echo -n > $RESOLV_CONF +if [ $4 != "0.0.0.0" -a $5 != "0.0.0.0" ]; then + echo nameserver $4 >> $RESOLV_CONF + gpio dns1 0.0.0.0 + gpio dns1 $4 + echo nameserver $5 >> $RESOLV_CONF + gpio dns2 0.0.0.0 + gpio dns2 $5 +elif [ $4 != "0.0.0.0" -a $5 = "0.0.0.0" ]; then + echo nameserver $4 >> $RESOLV_CONF + gpio dns1 0.0.0.0 + gpio dns1 $4 + pd=`nvram_get 2860 DNSIPAddress1` + gpio dns2 0.0.0.0 + if [ "$pd" != "" ]; then + echo nameserver $pd >> $RESOLV_CONF + gpio dns2 $pd + fi +elif [ $4 = "0.0.0.0" -a $5 = "0.0.0.0" ]; then + pd=`nvram_get 2860 DNSIPAddress1` + sd=`nvram_get 2860 DNSIPAddress2` + gpio dns1 0.0.0.0 + gpio dns2 0.0.0.0 + if [ "$pd" != "" ]; then + echo nameserver $pd >> $RESOLV_CONF + gpio dns1 $pd + fi + if [ "$sd" != "" ]; then + echo nameserver $sd >> $RESOLV_CONF + gpio dns2 $sd + fi +fi + +ddns.sh + +if [ $1 != "0.0.0.0" ]; then +ntp.sh +else +killall -q ntpclient +fi + diff --git a/verb/fs.sbin/snort.sh b/verb/fs.sbin/snort.sh new file mode 100755 index 0000000..f0092bd --- /dev/null +++ b/verb/fs.sbin/snort.sh @@ -0,0 +1,18 @@ +#!/bin/sh +# +# $Id: //WIFI_SOC/release/SDK_4_1_0_0/source/user/rt2880_app/scripts/snort.sh#1 $ +# +# usage: snort.sh +# + +se=`nvram_get 2860 SnortEnable` + +killall -q snort + +# debug +#echo "se=$se" + +#run snort +if [ "$se" = "1" ]; then +/bin/snort -c /etc_ro/snort.conf -l /var/log -s & +fi diff --git a/verb/fs.sbin/ucp b/verb/fs.sbin/ucp new file mode 100755 index 0000000..756bf24 Binary files /dev/null and b/verb/fs.sbin/ucp differ diff --git a/verb/fs.sbin/udev b/verb/fs.sbin/udev new file mode 100755 index 0000000..5b76634 Binary files /dev/null and b/verb/fs.sbin/udev differ diff --git a/verb/fs.sbin/udhcpc.sh b/verb/fs.sbin/udhcpc.sh new file mode 100755 index 0000000..ee5cf23 --- /dev/null +++ b/verb/fs.sbin/udhcpc.sh @@ -0,0 +1,133 @@ +#!/bin/sh +# +# udhcpc script, v1.00 2009-11-05 andy +# + +[ -z "$1" ] && echo "Error: should be called from udhcpc" && exit 1 + +RESOLV_CONF="/etc/resolv.conf" +[ -n "$broadcast" ] && BROADCAST="broadcast $broadcast" +[ -n "$subnet" ] && NETMASK="netmask $subnet" + +case "$1" in + deconfig) +# /sbin/ifconfig $interface 0.0.0.0 #don't clear to 0, leave it to be config ip + + ;; + + bound) + # change dhcp state + gpio dhcpstate 2 + killall -q zcip + ifconfig br0:0 down + gpio autoip 0.0.0.0 + + /sbin/ifconfig $interface $ip $BROADCAST $NETMASK + + if [ -n "$router" ] ; then + echo "deleting route" + while route del default gw 0.0.0.0 dev $interface ; do + : + done + gpio gw 0.0.0.0 + + metric=0 + for i in $router ; do + metric=`expr $metric + 1` + route add default gw $i dev $interface metric $metric + done + gpio gw $i + fi + + echo -n > $RESOLV_CONF + [ -n "$domain" ] && echo search $domain >> $RESOLV_CONF + idx="1" + for i in $dns ; do + echo adding dns $i + echo nameserver $i >> $RESOLV_CONF + if [ $idx = "1" ]; then + gpio dns1 0.0.0.0 + gpio dns1 $i + idx="2" + elif [ $idx = "2" ]; then + gpio dns2 0.0.0.0 + gpio dns2 $i + idx="3" + fi + done + + if [ $idx = "1" ]; then + pd=`nvram_get 2860 DNSIPAddress1` + sd=`nvram_get 2860 DNSIPAddress2` + if [ "$pd" != "" ]; then + echo -n > $RESOLV_CONF + echo nameserver $pd >> $RESOLV_CONF + gpio dns1 0.0.0.0 + gpio dns1 $pd + fi + if [ "$sd" != "" ]; then + echo nameserver $sd >> $RESOLV_CONF + gpio dns2 0.0.0.0 + gpio dns2 $sd + fi + elif [ $idx = "2" ]; then + pd=`nvram_get 2860 DNSIPAddress1` + if [ "$pd" != "" ]; then + echo nameserver $pd >> $RESOLV_CONF + gpio dns2 0.0.0.0 + gpio dns2 $pd + fi + fi + + # ddns + ddns.sh + + # upnp + #upnp=`nvram_get 2860 UPnPEnable` + #if [ "$upnp" = "1" ]; then + route add -net 239.0.0.0 netmask 255.0.0.0 dev br0 + killall -q udev + killall -q ucp + udev & + ucp & + #fi + + # ntp + ntp.sh + + # schedule for mail and ftp client + killall -q schedule + killall -q mail + killall -q ftpputimage + schedule & + + # udp configuration and tftp upload + killall -q lanconfig + killall -q tftpupload + lanconfig & + tftpupload & + + # mydlinkevent + killall -q mydlinkevent + mydlinkevent & + + # mDNSResponder + killall -q mDNSResponder + gpio mDNSResponder + + # mydlink + #/mydlink/opt.local stop + #/mydlink/opt.local start + echo "from udhcpc.sh" + gpio mydlink + + # web server alphapd + # killall -q alphapd + # alphapd & + web.sh + + ;; +esac + +exit 0 + diff --git a/verb/fs.sbin/video.sh b/verb/fs.sbin/video.sh new file mode 100755 index 0000000..60cf137 --- /dev/null +++ b/verb/fs.sbin/video.sh @@ -0,0 +1,12 @@ +#!/bin/sh +# +# $Id: video.sh, v1.00 2009-11-11 andy +# +# usage: video.sh +# + +echo "**** video.sh ***" + +killall -q uvc_stream +sleep 3 +uvc_stream -b & \ No newline at end of file diff --git a/verb/fs.sbin/vpn-passthru.sh b/verb/fs.sbin/vpn-passthru.sh new file mode 100755 index 0000000..790d22a --- /dev/null +++ b/verb/fs.sbin/vpn-passthru.sh @@ -0,0 +1,35 @@ +#!/bin/sh + +. /sbin/config.sh +. /sbin/global.sh + +l2tp_pt=`nvram_get 2860 l2tpPassThru` +ipsec_pt=`nvram_get 2860 ipsecPassThru` +pptp_pt=`nvram_get 2860 pptpPassThru` + + +# note: they must be removed in order +if [ "$CONFIG_NF_CONNTRACK_SUPPORT" = "y" ]; then + rmmod nf_nat_pptp 1>/dev/null 2>&1 + rmmod nf_conntrack_pptp 1>/dev/null 2>&1 + rmmod nf_nat_proto_gre 1>/dev/null 2>&1 + rmmod nf_conntrack_proto_gre 1>/dev/null 2>&1 +else + rmmod ip_nat_pptp 1>/dev/null 2>&1 + rmmod ip_conntrack_pptp 1>/dev/null 2>&1 +fi + +if [ "$pptp_pt" = "1" -o "$l2tp_pt" = "1" -o "$ipsec_pt" = "1" ]; then +if [ "$CONFIG_NF_CONNTRACK_SUPPORT" = "y" ]; then + insmod -q nf_conntrack_proto_gre + insmod -q nf_nat_proto_gre + + if [ "$pptp_pt" = "1" ]; then + insmod -q nf_conntrack_pptp + insmod -q nf_nat_pptp + fi +else + insmod -q ip_conntrack_pptp + insmod -q ip_nat_pptp +fi +fi diff --git a/verb/fs.sbin/web.sh b/verb/fs.sbin/web.sh new file mode 100755 index 0000000..ae9bb1e --- /dev/null +++ b/verb/fs.sbin/web.sh @@ -0,0 +1,5 @@ +# reload web server alphapd +killall -q alphapd +sleep 1 +alphapd & + diff --git a/verb/fs.sbin/wlan.sh b/verb/fs.sbin/wlan.sh new file mode 100755 index 0000000..81cc973 --- /dev/null +++ b/verb/fs.sbin/wlan.sh @@ -0,0 +1,32 @@ +#!/bin/sh +# +# $Id: wlan.sh, v1.00 2009-11-11 andy +# +# usage: wlan.sh +# + +echo "**** wlan.sh ***" + +lan_link=`gpio lanlink` +if [ "$lan_link" = "1" ]; then +exit 0 +fi + +ifconfig ra0 down + +wlan_disable=`nvram_get 2860 WirelessDisable` +if [ "$wlan_disable" = "0" ]; then +gpio wlan 0 +ifconfig ra0 up +fi + +if [ "$wlan_disable" = "1" ]; then +gpio wlan 1 +fi + +# mydlink +#/mydlink/opt.local stop +#/mydlink/opt.local start +gpio mydlink + +gpio ping & \ No newline at end of file diff --git a/verb/fs.sbin/zcip.sh b/verb/fs.sbin/zcip.sh new file mode 100755 index 0000000..087ee89 --- /dev/null +++ b/verb/fs.sbin/zcip.sh @@ -0,0 +1,45 @@ +#!/bin/sh + +# only for use as a "zcip" callback script +if [ "x$interface" = x ] +then + exit 1 +fi + +# zcip should start on boot/resume and various media changes +case "$1" in +init) + # for now, zcip requires the link to be already up, + # and it drops links when they go down. that isn't + # the most robust model... + exit 0 + ;; +config) + if [ "x$ip" = x ] + then + exit 1 + fi + # remember $ip for $interface, to use on restart + if [ "x$IP" != x -a -w "$IP.$interface" ] + then + echo $ip > "$IP.$interface" + fi + #exec ip address add dev $interface \ + # scope link local "$ip/16" broadcast + + ifconfig br0:0 $ip + gpio autoip $ip + killall -q mDNSResponder + gpio mDNSResponder + exit 0 + ;; +deconfig) + if [ x$ip = x ] + then + exit 1 + fi + #exec ip address del dev $interface local $ip + ifconfig br0:0 down + exit 0 + ;; +esac +exit 1