Results 1 to 4 of 4

Thread: take binary information

  1. #1

    take binary information

    My question is quite simple. If You have a network with a few computers and you move one program from one computer to another. Then the computers send a binary code, right. Can you, somehow make a program that intercept that information and save it in a *.txt file? So if you open the text file it will look something like this:
    10011101010100101001101011001110101010010100110101 10011101010100101001101011001110101010010100110101 10011101010100101001101011001110101010010100110101 10011101010100101001101011001110101010010100110101 10011101010100101001101011001110101010010100110101 10011101010100101001101011001110101010010100110101 10011101010100101001101011001110101010010100110101 10011101010100101001101011001110101010010100110101 10011101010100101001101011001110101010010100110101

  2. #2

    Re: take binary information

    Quote Originally Posted by neafriem
    My question is quite simple. If You have a network with a few computers and you move one program from one computer to another. Then the computers send a binary code, right. Can you, somehow make a program that intercept that information and save it in a *.txt file? So if you open the text file it will look something like this:
    1001110101010010100110101100111010101001...
    Nope, Acually while data between network connections is transfered physically in binary, it always gets translated by the network driver back into hex. Most data on the computer when siad to be in binary format is usually represented to the user in hex format. That is the reason that you hear about hex editors so much. Now you could take that hedx representation and convert it back to binary but that would be the only whay I know that you could do it..

    -Jeremy

  3. #3

    take binary information

    I can't imagine why you'd want that as its unreadable and inefficient, but yes you can do it with some bit fiddling like:
    [pascal]var
    i, j: integer;
    pData: pbyte;
    WriteStr: string[9];
    begin
    pData:= @Data;
    for j:= 0 to ByteCount-1 do
    begin
    for i:=0 to 7 do
    begin
    WriteStr[i+1]:= '0';
    if ((pData^ shr i) and $1) = 1 then
    WriteStr[i+1]:= '1';
    end;
    write(file, WriteStr);
    inc(pData);
    end;
    end;[/pascal]
    And no one converts between hexadecimal and binary, hexadecimal is just 4 bits in a row, most binary editing is done with hexadecimal values to make reading easyer

  4. #4
    Co-Founder / PGD Elder WILL's Avatar
    Join Date
    Apr 2003
    Location
    Canada
    Posts
    6,107
    Blog Entries
    25

    take binary information

    I'd have to agree. Just use hex for something like that. If you need to. Even hackers would prefer that.
    Jason McMillen
    Pascal Game Development
    Co-Founder





Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •