Flux rss
Collection CommentCaMarche.net
Rechercher : dans
Par : Pertinence Date Nom d'utilisateur
Statut : Non résolu

[JAVA] problème JPCAP

calaglin2, le vendredi 29 février 2008 à 22:43:19
Bonjour,
Je suis actuellement entrain de développer (dans le cadre d'un projet pour ma fac je précise) un programme permettant de sniffer et d'envoyer des trames arp. Je n'aime pas le c et ne connait pas le c++ donc je me suis tourné vers java et la librairie jpcap ( celle qui permet de forger ). Je teste actuellement la forge de paquets mais je rencontre un problème à l'exécution (bon courage pour la lecture je ne comprend rien ) :

#
# An unexpected error has been detected by Java Runtime Environment:
#
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x6d892831, pid=6444, tid=6484
#
# Java VM: Java HotSpot(TM) Client VM (1.6.0-b105 mixed mode, sharing)
# Problematic frame:
# V [jvm.dll+0xd2831]
#
# If you would like to submit a bug report, please visit:
# http://java.sun.com/webapps/bugreport/crash.jsp
#

--------------- T H R E A D ---------------

Current thread (0x00296400): JavaThread "main" [_thread_in_vm, id=6484]

siginfo: ExceptionCode=0xc0000005, reading address 0x00000000

Registers:
EAX=0x00000000, EBX=0x00296400, ECX=0x00000006, EDX=0x6d8927d0
ESP=0x0090f55c, EBP=0x6d9c5e60, ESI=0x00000000, EDI=0x0090f5e6
EIP=0x6d892831, EFLAGS=0x00010246

Top of Stack: (sp=0x0090f55c)
0x0090f55c: 0090f5e6 002964e8 0090fc60 00296400
0x0090f56c: 00000000 100039c1 100039cc 100039d6
0x0090f57c: 00296400 00000000 00000000 00000000
0x0090f58c: 0090f5f8 00000000 6d9c5e60 1000329f
0x0090f59c: 00000000 002964e8 0090fc60 0090fc64
0x0090f5ac: 6d9a9320 0000000e 0090fc60 10002e17
0x0090f5bc: 10002e47 0090fc60 00000000 00296400
0x0090f5cc: 2699b5d8 0090fc50 2699b5d8 00040000

Instructions: (pc=0x6d892831)
0x6d892821: 0c e8 c9 30 08 00 8b 74 24 28 85 f6 8b 44 24 24
0x6d892831: 8b 00 7c 54 8b 54 24 2c 85 d2 7c 4c 8b 78 08 8d


Stack: [0x008c0000,0x00910000), sp=0x0090f55c, free space=317k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V [jvm.dll+0xd2831]

Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j jpcap.JpcapSender.nativeSendPacket(Ljpcap/packet/Packet;)V+0
j jpcap.JpcapSender.sendPacket(Ljpcap/packet/Packet;)V+19
j arpSender.constructPacket()Ljpcap/packet/Packet;+271
j arpSender.main([Ljava/lang/String;)V+9
v ~StubRoutines::call_stub

--------------- P R O C E S S ---------------

Java Threads: ( => current thread )
0x02a7cc00 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=2964]
0x02a78000 JavaThread "CompilerThread0" daemon [_thread_blocked, id=4776]
0x02a77000 JavaThread "Attach Listener" daemon [_thread_blocked, id=7992]
0x02a76400 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=6864]
0x02a71800 JavaThread "Finalizer" daemon [_thread_blocked, id=7108]
0x02a6d400 JavaThread "Reference Handler" daemon [_thread_blocked, id=260]
=>0x00296400 JavaThread "main" [_thread_in_vm, id=6484]

Other Threads:
0x02a64000 VMThread [id=5412]
0x02a7e400 WatcherThread [id=1004]

VM state:not at safepoint (normal execution)

VM Mutex/Monitor currently owned by a thread: None

Heap
def new generation total 960K, used 407K [0x22990000, 0x22a90000, 0x22e70000)
eden space 896K, 45% used [0x22990000, 0x229f5e48, 0x22a70000)
from space 64K, 0% used [0x22a70000, 0x22a70000, 0x22a80000)
to space 64K, 0% used [0x22a80000, 0x22a80000, 0x22a90000)
tenured generation total 4096K, used 0K [0x22e70000, 0x23270000, 0x26990000)
the space 4096K, 0% used [0x22e70000, 0x22e70000, 0x22e70200, 0x23270000)
compacting perm gen total 12288K, used 72K [0x26990000, 0x27590000, 0x2a990000)
the space 12288K, 0% used [0x26990000, 0x269a2050, 0x269a2200, 0x27590000)
ro space 8192K, 66% used [0x2a990000, 0x2aed9920, 0x2aed9a00, 0x2b190000)
rw space 12288K, 52% used [0x2b190000, 0x2b7d6130, 0x2b7d6200, 0x2bd90000)

Dynamic libraries:
0x00400000 - 0x00423000 C:\Program Files\Java\jdk1.6.0\bin\java.exe
0x7c910000 - 0x7c9c7000 C:\WINDOWS\system32\ntdll.dll
0x7c800000 - 0x7c905000 C:\WINDOWS\system32\kernel32.dll
0x77da0000 - 0x77e4c000 C:\WINDOWS\system32\ADVAPI32.dll
0x77e50000 - 0x77ee1000 C:\WINDOWS\system32\RPCRT4.dll
0x7c340000 - 0x7c396000 C:\Program Files\Java\jdk1.6.0\jre\bin\msvcr71.dll
0x6d7c0000 - 0x6da07000 C:\Program Files\Java\jdk1.6.0\jre\bin\client\jvm.dll
0x7e390000 - 0x7e420000 C:\WINDOWS\system32\USER32.dll
0x77ef0000 - 0x77f37000 C:\WINDOWS\system32\GDI32.dll
0x76ae0000 - 0x76b0f000 C:\WINDOWS\system32\WINMM.dll
0x76320000 - 0x7633d000 C:\WINDOWS\system32\IMM32.DLL
0x62dc0000 - 0x62dc9000 C:\WINDOWS\system32\LPK.DLL
0x753c0000 - 0x7542b000 C:\WINDOWS\system32\USP10.dll
0x77be0000 - 0x77c38000 C:\WINDOWS\system32\msvcrt.dll
0x6d310000 - 0x6d318000 C:\Program Files\Java\jdk1.6.0\jre\bin\hpi.dll
0x76ba0000 - 0x76bab000 C:\WINDOWS\system32\PSAPI.DLL
0x6d770000 - 0x6d77c000 C:\Program Files\Java\jdk1.6.0\jre\bin\verify.dll
0x6d3b0000 - 0x6d3cf000 C:\Program Files\Java\jdk1.6.0\jre\bin\java.dll
0x6d7b0000 - 0x6d7bf000 C:\Program Files\Java\jdk1.6.0\jre\bin\zip.dll
0x10000000 - 0x10028000 C:\WINDOWS\system32\Jpcap.dll
0x719f0000 - 0x71a07000 C:\WINDOWS\system32\WS2_32.dll
0x719e0000 - 0x719e8000 C:\WINDOWS\system32\WS2HELP.dll
0x02dd0000 - 0x02e11000 C:\WINDOWS\system32\wpcap.dll
0x02e20000 - 0x02e35000 C:\WINDOWS\system32\packet.dll
0x02e40000 - 0x02e50000 C:\WINDOWS\system32\WanPacket.dll
0x669b0000 - 0x669c1000 C:\WINDOWS\system32\NPPTools.dll
0x5f800000 - 0x5f8f2000 C:\WINDOWS\system32\MFC42u.DLL
0x774a0000 - 0x775dd000 C:\WINDOWS\system32\ole32.dll
0x770e0000 - 0x7716b000 C:\WINDOWS\system32\OLEAUT32.dll
0x76d10000 - 0x76d29000 C:\WINDOWS\system32\iphlpapi.dll
0x77bd0000 - 0x77bd8000 C:\WINDOWS\system32\VERSION.dll
0x61d70000 - 0x61d7e000 C:\WINDOWS\system32\MFC42LOC.DLL
0x673f0000 - 0x67401000 C:\WINDOWS\system32\npp\ndisnpp.dll
0x5b090000 - 0x5b0c8000 C:\WINDOWS\system32\uxtheme.dll
0x02ef0000 - 0x02f21000 C:\Program Files\F-Secure\Spam Control\fsscoepl.dll
0x7c9d0000 - 0x7d1f5000 C:\WINDOWS\system32\SHELL32.dll
0x77f40000 - 0x77fb6000 C:\WINDOWS\system32\SHLWAPI.dll
0x77390000 - 0x77493000 C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.2600.2982_x-ww_ac3f9c03\comctl32.dll
0x58b50000 - 0x58bea000 C:\WINDOWS\system32\comctl32.dll
0x17100000 - 0x17120000 c:\program files\f-secure\tnb\fstnb.dll
0x02f70000 - 0x02f99000 c:\program files\f-secure\common\fslapi.dll
0x02fb0000 - 0x02fc0000 C:\Program Files\F-Secure\Spam Control\fsscmso.eng
0x02fc0000 - 0x02fc7000 C:\Program Files\Macrogaming\SweetIM\mgAdaptersProxy.dll
0x74690000 - 0x746db000 C:\WINDOWS\system32\MSCTF.dll
0x76f80000 - 0x76fff000 C:\WINDOWS\system32\CLBCATQ.DLL
0x77000000 - 0x770d4000 C:\WINDOWS\system32\COMRes.dll
0x77fc0000 - 0x77fd1000 C:\WINDOWS\system32\Secur32.dll

VM Arguments:
java_command: arpSender
Launcher Type: SUN_STANDARD

Environment Variables:
CLASSPATH=.;C:\Program Files\Java\jre1.6.0_03\lib\ext\QTJava.zip
PATH=C:\GNAT\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\Fichiers communs\GTK\2.0\bin;C:\Program Files\QuickTime\QTSystem\;C:\Program Files\Satsuki Decoder Pack\filtres\divers
USERNAME=PIERRE HENRI
OS=Windows_NT
PROCESSOR_IDENTIFIER=x86 Family 15 Model 2 Stepping 9, GenuineIntel



--------------- S Y S T E M ---------------

OS: Windows XP Build 2600 Service Pack 2

CPU:total 1 family 15, cmov, cx8, fxsr, mmx, sse, sse2

Memory: 4k page, physical 521712k(209824k free), swap 1277976k(736608k free)

vm_info: Java HotSpot(TM) Client VM (1.6.0-b105) for windows-x86, built on Nov 29 2006 00:48:48 by "java_re" with unknown MS VC++:1310









voilà le code :






import java.io.*;
import java.lang.*;
import jpcap.*;
import jpcap.packet.*;






class arpSender {



private JpcapSender sender;


public arpSender(){


try{

NetworkInterface[] devices = JpcapCaptor.getDeviceList();

sender=JpcapSender.openDevice(devices[0]); ;
}
catch(IOException e){
e.printStackTrace();
}
}



public void constructPacket(){


ARPPacket p=new ARPPacket();

Integer proto=2054;

EthernetPacket ether=new EthernetPacket();

ether.frametype=EthernetPacket.ETHERTYPE_IP;

ether.src_mac=new byte[]{(byte)8,(byte)11,(byte)106,(byte)102,(byte)80,(byte)10};
ether.dst_mac=new byte[]{(byte)255,(byte)255,(byte)255,(byte)255 };



p.datalink=ether;
p.prototype=proto.shortValue();
p.sender_hardaddr=new byte[]{(byte)8,(byte)11,(byte)106,(byte)102,(byte)80,(byte)10};
p.sender_protoaddr=new byte[]{(byte)192,(byte)168,(byte)7,(byte)2 };
p.target_protoaddr=new byte[]{(byte)255,(byte)255,(byte)255,(byte)255 };

sender.sendPacket(p);

sender.close();


}



public static void main(String[] args){


arpSender a=new arpSender();

a.constructPacket();





}




}





Merci d'avance à ceux qui pourront me dire ce qui ne va pas
Configuration: Windows XP
Firefox 2.0.0.12
Répondre à calaglin2  Signaler ce message aux modérateurs Aller au dernier message

1


  • Ce message vous semble utile, votez !
  • Signaler ce message aux modérateurs
calaglin2, le jeudi 6 mars 2008 à 18:26:43
personne n'a d'idée ?
Répondre à calaglin2

2


  • Ce message vous semble utile, votez !
  • Signaler ce message aux modérateurs
 dagost, le mardi 2 décembre 2008 à 17:07:45
Salut,

Enlève sender.close();

Bon courage pour ton projet.

A+
Répondre à dagost

Résultats pour [JAVA] problème JPCAP

Javascript - Introduction au langage Javascript Qu'est-ce que le Javascript? Le Javascript est un langage de script incorporé dans un document HTML. Historiquement il s'agit même du premier langage de script pour le Web. Ce langage est un langage de programmation qui permet d'apporter des... www.commentcamarche.net/contents/javascript/jsintro.php3
Javascript - Les événements Qu'appelle-t-on un événement? Les événements sont des actions de l'utilisateur, qui vont pouvoir donner lieu à une interactivité. L'événement par excellence est le clic de souris, car c'est le seul que le HTML gère. Grâce au Javascript il est... www.commentcamarche.net/contents/javascript/jsevent.php3
Java - Premier programme Première application avec Java La première chose à faire est de créer un simple fichier texte (sans mise en forme) et de taper les quelques lignes suivantes : // Votre premiere application en Java class FirstApp { public static void main... www.commentcamarche.net/contents/java/javaprem.php3

Résultats pour [JAVA] problème JPCAP

[Firefox] plugin Java Jre de SunA) Les différentes variantes Java chez Sun B) Installation sous Mandriva Limited Edition 2005 ETAPE 1 ETAPE 2: Création du lien symbolique C) Installation sous debian lenny D) Installation sous ubuntu hardy heron A) Les différentes... www.commentcamarche.net/faq/sujet-1824-firefox-plugin-java-jre-de-sun
Installer Java sous UbuntuPar défaut, Firefox n'est pas fourni avec Java. Voici comment procéder pour l'installer: Ouvrez un terminal (Menu Applications > Accessoires > Terminal) et tapez: sudo aptitude install sun-java6-jre sun-java6-plugin ou sudo aptitude install ... www.commentcamarche.net/faq/sujet-5400-installer-java-sous-ubuntu
Java Runtime MachineJava Runtime Machine Certains sites internet mais aussi certains programmes requièrent la présence de la Java Runtime Machine (JRM) pour exécuter les applets Java. Si vous n'avez pas, ou plus, cette Java Runtime Machine,... www.commentcamarche.net/faq/sujet-640-java-runtime-machine

Résultats pour [JAVA] problème JPCAP

Convert String to int in Java (Résolu)Bonjour tt le monde, Un petit question par rapport à la conversion de types en java, pour passer un type char to int on fait: int nbr = + caractere; c magique ca converti en entier le caractère mais pour passer un String to int auncune idée qqun... www.commentcamarche.net/forum/affich-499267-convert-string-to-int-in-java
Jeux java pour samsung SGH-J600 (Résolu)bonjour a tous, je viens d acheter le samsung SGH-J600 je voudrais savoir si c est possible de mettre des java gratuitement dans mon telephone et si oui comment faire? merci d'avance pour vos reponses. www.commentcamarche.net/forum/affich-3932183-jeux-java-pour-samsung-sgh-j600

Résultats pour [JAVA] problème JPCAP

Télécharger Cavaj Java DecompilerCavaj Java Decompiler est un éditeur gratuit de code Java. Il permet de recomposer le code source Java d'un fichier CLASS. Il prend en charge la décompilation des applets Java, des archives ZIP et JAR. Le code source Java obtenu est précis. Il intègre... www.commentcamarche.net/telecharger/telecharger-34056787-cavaj-java-decompiler
Télécharger JavaScript ObfuscatorJasob JavaScript Obfuscator est un logiciel de protection de code Javascript. Il intègre une interface simple. Il vous permet de convertir votre code Javascript en un code incompréhensible pour l’homme mais lisible pour le navigateur. Le logiciel... www.commentcamarche.net/telecharger/telecharger-34056889-javascript-obfuscator
Télécharger Java ToolsJava Tools est un IDE très léger pour la création, la compilation, l'exécution et le débogage des applications Java et des applettes. L'outil inclus des points et des clics d'accès aux commandes Java, aux documents, au répertoire et aux fichiers. Il... www.commentcamarche.net/telecharger/telecharger-34056297-java-tools

Résultats pour [JAVA] problème JPCAP

Javascript - Les variablesLe concept de variable Une variable est un objet repéré par son nom, pouvant contenir des données, qui pourront être modifiées lors de l'exécution du programme. En Javascript, les noms de variables peuvent être aussi long que l'on désire,... www.commentcamarche.net/contents/javascript/jsvar.php3
J2EE - Java 2 Enterprise EditionIntroduction au Java Framework Le «Java Framework» (Java 2 Platform) est composé de trois éditions, destinées à des usages différents : J2ME : Java 2 Micro Edition est prévu pour le développement d'applications embarquées, notamment sur des... www.commentcamarche.net/contents/j2ee/j2ee-intro.php3
JavaHistoire de Java Java est un langage objet ressemblant au langage C++. Il a été mis au point en 1991 par la firme Sun Microsystems. Le but de Java à l'époque était de constituer un langage de programmation pouvant être intégré dans les appareils... www.commentcamarche.net/contents/java/javaintro.php3