Convert .txt file to .cap to open it by Wireshark

2,588

How is the text file formatted? What kind of data does it contain? If it's some sort of hex dump, e.g.

9   0.167204 64.28.67.150 -> 192.168.0.2  TCP 80 > 2741 [ACK] Seq=1 Ack=641 Win=7040 Len=0 TSV=282917349 TSER=38398814

0000  00 20 af 1b 07 fa 00 e0 29 68 8b fb 08 00 45 00   . ......)h....E.
0010  00 34 9e 12 40 00 26 06 72 55 40 1c 43 96 c0 a8   .4..@.&[email protected]...
0020  00 02 00 50 0a b5 75 c8 67 f6 74 49 46 3d 80 10   ...P..u.g.tIF=..
0030  1b 80 7b 2c 00 00 01 01 08 0a 10 dc f9 e5 02 49   ..{,...........I
0040  eb 5e                                             .^

you should be able to use text2pcap to convert it.

Share:
2,588

Related videos on Youtube

Chelsie Rae McNulty
Author by

Chelsie Rae McNulty

Updated on September 17, 2022

Comments

  • Chelsie Rae McNulty
    Chelsie Rae McNulty over 1 year

    I am trying to make a simple project when you click a button a draggable MovieClip is added to the stag and when you click it releases the MovieClip to the X/Y where you clicked, you can then pickup the MovieClip and drag it into a bin (MovieClip) where it destroys itself. The code is working great I can make multiple Movieclips with the button and they are all destroyed when I drag them in the bin however I don't like having "Error Codes".

    import flash.events.MouseEvent;
    var rubbish:my_mc = new my_mc();
    btntest.addEventListener(MouseEvent.CLICK, makeRubbish);
    
    function makeRubbish (event:MouseEvent):void {
    
    
    addChild(rubbish);
    
    rubbish.x = mouseX - 10;
    rubbish.y = mouseY - 10;
    rubbish.width = 50;
    this.addEventListener(MouseEvent.MOUSE_DOWN, startDragging);
    rubbish.buttonMode = true;
    }
    
    function stopDragging (event:MouseEvent):void {
        rubbish.stopDrag()
        event.target.addEventListener(MouseEvent.CLICK, startDragging);
        rubbish.buttonMode = true;
                if (event.target.hitTestObject(bin))
                {
                    trace("hit");
                     event.target.name = "rubbish"; 
        removeChild(getChildByName("rubbish"));
    
    
                }
    }
    function startDragging (event:MouseEvent):void {
    event.target.startDrag();
    this.addEventListener(MouseEvent.CLICK, stopDragging);
    }
    
  • ferg
    ferg over 13 years
    I am trying now to find the text2pcap app and download it
  • ferg
    ferg over 13 years
    Sorry mate, where I can find the text2pcap app? and how I can use it.
  • dsolimano
    dsolimano over 13 years
    @freehonest, I believe it's part of the wireshark install. On my windows machine, it's located at C:\Program Files\Wireshark\text2pcap.exe.
  • Denys
    Denys over 13 years
    @dsolimano is correct. It and a bunch of other command line utilities are part of the default Windows and OS X installs. On Linux you have to install the "bunch of CLI utilities that ship with Wireshark package" which is often named "wireshark-common" or something similar.
  • Chelsie Rae McNulty
    Chelsie Rae McNulty over 10 years
    hmm I'm still getting the error but now the whole stage moves when I drag and it doesn't like to let go of the rubbish
  • Chelsie Rae McNulty
    Chelsie Rae McNulty over 10 years
    line 41 error 1118 implict coercion of value with a static type to a possible unrelated type my_mc
  • shennan
    shennan over 10 years
    @ChelsieRaeMcNulty Try now. Note the change is dragging = event.currentTarget as my_mc;
  • Chelsie Rae McNulty
    Chelsie Rae McNulty over 10 years
    No errors anymore however the rubbish is deleted after you drag and let go anywhere on the stage, it doesn't have to hit the bin like it should? its like collision is always on?
  • Chelsie Rae McNulty
    Chelsie Rae McNulty over 10 years
    seems to work perfect with no errors if I change dragging = event.currentTarget as my_mc; to event.taget