What type of image is this?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • fractalengine
    New Member
    • Jun 2010
    • 5

    What type of image is this?

    I have been trying to reverse engineer a small hardware scanning device. The vendor has a DLL with a function called "GetImageDa ta" that I've been executing in VB.NET

    It is defined as below:

    Code:
    GetImageData(imageData_out as String, pWitdh as Uinteger, pHeight as Uinteger) as Boolean

    Right after calling the function I execute the following:
    Code:
    Text.ASCIIEncoding.Default.GetBytes(imageData_out)
    Which always returns an Array of 8192 bytes (regardless of the width, height). After looking at the byte array I noticed only following 10 numbers re-occurring:

    Byte - # occurrence in array
    63 -> 3894
    0 -> 2677
    32 -> 592
    255 -> 313
    64 -> 302
    96 -> 221
    160 -> 81
    134 -> 71
    192 -> 65
    48 -> 21

    This is typical with each scan with some variation in the counts.

    I am assuming that it returns some sort of BITMAP image. Possibly black and white with representation of how dark or light each pixel is? Anybody have an idea what type of image is being returned, or how I can go about displaying the data that comes back as an image?
  • Frinavale
    Recognized Expert Expert
    • Oct 2006
    • 9749

    #2
    Contact the vendor and get their documentation on the SDK that they have provided to you.

    Comment

    • fractalengine
      New Member
      • Jun 2010
      • 5

      #3
      Well that's the worst part of it all. The vendor doesn't exist anymore, and their is no documentation or SDK, just a DLL that is used by their application. This is just a shot in the dark at reverse engineering their product.

      Comment

      • Plater
        Recognized Expert Expert
        • Apr 2007
        • 7872

        #4
        Is this really the case: imageData_out as String
        I can't believe (even with VB) that someone would return data as a string like that?

        Comment

        • fractalengine
          New Member
          • Jun 2010
          • 5

          #5
          Originally posted by Plater
          Is this really the case: imageData_out as String
          I can't believe (even with VB) that someone would return data as a string like that?
          my thoughts exactly.. When I imported the DLL that's what the object browser reports it as. I assume it's a IntPtr to the image data but not quite sure how to construct the image. After digging around I believe it would be a 8bpp image.

          Comment

          • Plater
            Recognized Expert Expert
            • Apr 2007
            • 7872

            #6
            Have you tried creating a Bitmap class from it?
            You can make a MemoryStream from a byte[] and try to construct the Bitmap object with it using Bitmap.FromStre am(myMemoryStre am)

            See if it can figure it out?

            Comment

            • fractalengine
              New Member
              • Jun 2010
              • 5

              #7
              Originally posted by Plater
              Have you tried creating a Bitmap class from it?
              You can make a MemoryStream from a byte[] and try to construct the Bitmap object with it using Bitmap.FromStre am(myMemoryStre am)

              See if it can figure it out?
              "It throws a Parameter is not valid" exception when trying to read from the stream.

              :(

              Comment

              Working...