Click here to Skip to main content
15,896,912 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionBinding Problem Pin
vidhish24-Aug-08 1:32
vidhish24-Aug-08 1:32 
AnswerRe: Binding Problem Pin
Mycroft Holmes24-Aug-08 16:48
professionalMycroft Holmes24-Aug-08 16:48 
Questionupdate the datagrid Pin
Ahamed Azeem24-Aug-08 0:28
Ahamed Azeem24-Aug-08 0:28 
AnswerRe: update the datagrid Pin
paas24-Aug-08 0:57
paas24-Aug-08 0:57 
QuestionBinary files - determing format or internal structure Pin
Dennis Lokken23-Aug-08 8:15
Dennis Lokken23-Aug-08 8:15 
AnswerRe: Binary files - determing format or internal structure Pin
csciwizard23-Aug-08 9:05
csciwizard23-Aug-08 9:05 
GeneralRe: Binary files - determing format or internal structure Pin
Dennis Lokken23-Aug-08 10:18
Dennis Lokken23-Aug-08 10:18 
GeneralRe: Binary files - determing format or internal structure [modified] Pin
Dennis Lokken24-Aug-08 8:11
Dennis Lokken24-Aug-08 8:11 
I recently found some information on the COff file format.
and I have started to parse some of the data from a byte array that holds the file contents.

However, when I display the data byte by byte I get the following as a short example: b5-60-8b-48-
If I do a conversion.hex(bitconverter.ToUint32 _(returnvalue,4)
I get the information reversed which makes sense. 488b60b5 being as the conversion.hex routine is starting at the high byte. I am just not certain this is how it should be interpreted in the file according to the following definition from the COFF format.
So, I do not know if I should be starting with byte 4,5,6,7 or the reverse 7,6,5,4
'---------------------------------
byte
Number Type Description
0–1 Unsigned short Version ID; indicates version of
COFF filestructure
2–3 Unsigned short Number of section headers
4–7 Integer Time and date stamp; indicates when the file
was created
8–11 Integer File pointer; contains the symbol table’s
starting address
12–15 Integer Number of entries in the symbol table
20–21 Unsigned short Target ID; magic number (0099h)
indicates the file can be executed in a C6000 system
xx-xxx (continued for several hundrd bytes...I think)
'----------------------------
Imports Microsoft.Visualbasic.FileIO
Imports System.IO
Imports System.Text

Dim StrTime As String
Dim StrCoff_Ver_ID, StrNum_Section_Headers As String
Dim ReturnValue As Byte()
Dim x as integer

'file is the binary COFF file being read
'Returnvalue is byte array of entire file contents
ReturnValue = FileSystem.ReadAllBytes(file)
x = 0
StrCoff_Ver_ID =
Conversion.Hex(BitConverter.ToUInt16(ReturnValue, x))

x = 4
StrTime =
Conversion.Hex(BitConverter.ToUInt32(ReturnValue, x))


question: can the byte order be easily reversed if neccessary? They refer to "big endian format" in the documentation. I think I know what this format is and how to handle it for a 2 byte chunk of code. (0c d0) However when it gets to a 4 byte chunk like the filesystem var then I'm not sure what the order is (0c d0 1f 4c) is it (1f 4c 0c d0) or (4c 1f d0 0c),etc. ??

modified on Sunday, August 24, 2008 4:41 PM

QuestionNeed help with SystemParametersInfo (setting desktop work area) Pin
xx77abs23-Aug-08 8:03
xx77abs23-Aug-08 8:03 
AnswerRe: Need help with SystemParametersInfo (setting desktop work area) Pin
Dave Kreskowiak24-Aug-08 17:28
mveDave Kreskowiak24-Aug-08 17:28 
GeneralRe: Need help with SystemParametersInfo (setting desktop work area) Pin
xx77abs25-Aug-08 8:14
xx77abs25-Aug-08 8:14 
QuestionAdding Windows Form to DLL? Pin
LloydA11123-Aug-08 4:33
LloydA11123-Aug-08 4:33 
AnswerRe: Adding Windows Form to DLL? Pin
Thomas Stockwell23-Aug-08 7:20
professionalThomas Stockwell23-Aug-08 7:20 
AnswerRe: Adding Windows Form to DLL? Pin
Mycroft Holmes23-Aug-08 22:52
professionalMycroft Holmes23-Aug-08 22:52 
QuestionUsing temp data in a loop [modified] Pin
Netblue23-Aug-08 3:33
Netblue23-Aug-08 3:33 
AnswerRe: Using temp data in a loop Pin
xx77abs23-Aug-08 8:04
xx77abs23-Aug-08 8:04 
AnswerRe: Using temp data in a loop Pin
Guffa23-Aug-08 15:00
Guffa23-Aug-08 15:00 
GeneralRe: Using temp data in a loop Pin
Netblue23-Aug-08 16:05
Netblue23-Aug-08 16:05 
GeneralRe: Using temp data in a loop Pin
Guffa24-Aug-08 12:47
Guffa24-Aug-08 12:47 
QuestionReading arguments from external associated file Pin
WhitW22-Aug-08 23:48
WhitW22-Aug-08 23:48 
AnswerRe: Reading arguments from external associated file Pin
jzonthemtn23-Aug-08 2:03
jzonthemtn23-Aug-08 2:03 
QuestionAvoid connecting to a database through a connection string Pin
John Kh22-Aug-08 23:02
John Kh22-Aug-08 23:02 
AnswerRe: Avoid connecting to a database through a connection string Pin
coolguy007023-Aug-08 0:55
coolguy007023-Aug-08 0:55 
GeneralRe: Avoid connecting to a database through a connection string Pin
jzonthemtn23-Aug-08 2:05
jzonthemtn23-Aug-08 2:05 
AnswerRe: Avoid connecting to a database through a connection string Pin
jzonthemtn23-Aug-08 2:07
jzonthemtn23-Aug-08 2:07 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.