|
-
Jul 26th, 2001, 04:25 AM
#1
HEX editing
Hi
I have a BIG problem....
I'm working on an hex edit project,
So, the problem is that I have the adress of the value that
I want to modifie...this value is an Unsigned Long, when I store the value in a Long type variable
it give me a Signed Long, but me I want a Unsigned Long!!
So, in what type of variable I have to store it to have the correct value of an unsigned long? 
Understood?
no?..
hum...
look at this ;
Hex value = C7 CB4A DB
When I store this in a Long..
ea : Dim MyVariable as Long
MyVariable=&HC7CB4ADB
Text1.Text = MyVariable
In the screen, in my text box I see '-615855161', and this value is the Signed Long of the hex value
Me I need to see the Unsigned Long of the hex value that is '3679112135'
So, if you understand something and how to resolve this, please help........
-
Jul 26th, 2001, 04:40 AM
#2
Retired VBF Adm1nistrator
Use C++ instead of VB, or manually convert the number yourself.
Below is the source to one that I use.
I didnt write it though.
Microsoft MVP : Visual Developer - Visual Basic [2004-2005]
-
Jul 26th, 2001, 04:43 AM
#3
Retired VBF Adm1nistrator
Microsoft MVP : Visual Developer - Visual Basic [2004-2005]
-
Jul 26th, 2001, 04:44 AM
#4
Retired VBF Adm1nistrator
Microsoft MVP : Visual Developer - Visual Basic [2004-2005]
-
Jul 26th, 2001, 04:44 AM
#5
-
Jul 26th, 2001, 04:51 AM
#6
um...
thanx for the help
but if someone have an other option tell me...
-
Jul 26th, 2001, 04:53 AM
#7
Retired VBF Adm1nistrator
You can download it from here too :
http://www.tu-darmstadt.de/~rkibria
Microsoft MVP : Visual Developer - Visual Basic [2004-2005]
-
Jul 26th, 2001, 05:08 AM
#8
What is this URL for??
For the binary editor?
-
Jul 26th, 2001, 05:11 AM
#9
Retired VBF Adm1nistrator
Yeah the official website for the hex editor.
Its a real good editor. The one I use.
Microsoft MVP : Visual Developer - Visual Basic [2004-2005]
-
Jul 26th, 2001, 05:21 AM
#10
I/m using Hex WorkShop...that is really cool too
With a great file compare option
-
Jul 26th, 2001, 11:44 AM
#11
-
Jul 27th, 2001, 02:13 AM
#12
Retired VBF Adm1nistrator
Microsoft MVP : Visual Developer - Visual Basic [2004-2005]
-
Jul 27th, 2001, 03:18 AM
#13
Registered User
Also try this function out:
VB Code:
Private Sub Command1_Click()
Dim MyVariable
MyVariable = HexToDec("C7CB4ADB")
Debug.Print MyVariable
End Sub
Function HexToDec(ByVal sHex As String) As Variant
'Nucleus
Dim ba() As Byte, i&, bitval As Variant, b As Byte
bitval = 1
ba = sHex
For i = UBound(ba) - 1 To 0 Step -2
b = ba(i)
If b < 58 Then HexToDec = CDec(HexToDec + (b - 48) * bitval) Else HexToDec = CDec(HexToDec + (b - 55) * bitval)
bitval = CDec(bitval * 16)
Next i
End Function
-
Jul 27th, 2001, 03:21 AM
#14
Registered User
BTW when you convert hex C7CB4ADB to decimal the result is: 3351988955 not 3679112135.
-
Jul 27th, 2001, 07:01 AM
#15
-
Jul 29th, 2001, 07:52 AM
#16
heu...
plendj, do you know where I can find some of these ocx for my 16 bit version of vb 4 ??
-
Jul 29th, 2001, 07:58 AM
#17
Nucleus..
I have verify with HexWorkShop, the unsigned long for the hex C7 CB4A DB is 3679112135....
-
Jul 29th, 2001, 05:52 PM
#18
Registered User
Originally posted by craky2ooo
Nucleus..
I have verify with HexWorkShop, the unsigned long for the hex C7 CB4A DB is 3679112135....
Well I verified it with the windows calculator and the base 10 value of C7CB4ADB (base 16) does not equal 3679112135.
Do you mean you want to convert it to a different base?
-
Jul 30th, 2001, 10:30 AM
#19
Do you have a hex editor, if so try to convert the signed long value of the hex to his unsigned long....
you'll see
-
Jul 30th, 2001, 12:44 PM
#20
Frenzied Member
I think its pretty tragic that theres an argument over the decimal value of a number...but just for the record i got the same as Nucleus...and i really doubt that the windows calc. is wrong....but maybe theres a mixup in this signed and unsigned stuff.
You just proved that sig advertisements work.
-
Jul 30th, 2001, 06:19 PM
#21
Registered User
Perhaps it is the unsigned integer that is the cause of the differing results?
I am sure someone knows the largest integer an unsigned integer can support?
-
Jul 31st, 2001, 02:00 AM
#22
Retired VBF Adm1nistrator
Code:
unsigned Integer 0 - 65535
unsigned Long 0 - 4294967295
Microsoft MVP : Visual Developer - Visual Basic [2004-2005]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|