Register for your free account! | Forgot your password?

You last visited: Today at 07:27

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



Hex to Dec

Discussion on Hex to Dec within the CO2 Private Server forum part of the Conquer Online 2 category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Nov 2009
Posts: 342
Received Thanks: 17
Hex to Dec

hey brothers, in my source i'd like to convert Hex to Dec
is there idea for converting by debugging the project? and how would it be liked?
|xabi| is offline  
Old 03/13/2013, 02:25   #2
 
elite*gold: 0
Join Date: Sep 2012
Posts: 775
Received Thanks: 327
i don't think it could be done but manually
search entire project for "0x"
open the calculator or code a simple app
copy and past manually
else
code simple c# app.
select all text and past them to this app. text box
a cute button which do the following
loop on all strings
once found "0x"
select chars starting with that 0 ending with the next space ' ' or next ')'
lets say the string it found was 0xc3
//it will keep searching for the next space char as any hex number should end with space or ')'
copy this string (which is the number in hex)
then convert it to dec
by
Code:
String decimal = new Org.BouncyCastle.Math.BigInteger(hex, 16).ToString();
or
Code:
// Store integer 182
int decValue = 182;
// Convert integer 182 as a hex in a string variable
string hexValue = decValue.ToString("X");
// Convert the hex string back to the number
int decAgain = int.Parse(hexValue, System.Globalization.NumberStyles.HexNumber);
or any other way , go search google or msdn

then simply replace the dec value for the hex value
//take a copy from the hex value before converting or use the copy you already selected as you are not sending reference you are only sending copy and do something like main string replace(hex variable,dec variable)

once it loop on all the hex values it will convert all of them
i may release a tool like this later (im going to bed atm)

the point was to be able to detect the hex value to replace it
all you know about hex value is that it start with 0x and end with space or bracket , but maybe also in for loop it will end with semicolon ;

so i guess that's the 3 chars following any hex value
it end at the closest value to your selection (the start of 0x)

edit about your sig
and btw i think it's hybrid who wrote the cv3

edit 2 , hex numbers may also end with ',' , ex. at packets 0x00, 0x01, 0x44,

edit 3 , you may also make a simple log about what you edit
text box , scroll to crate , vertical and horizontal scroll bars , method of text += new text + /r/n , write hex value + /t + dec value
it will log something like

Quote:
0x01 1
0x05 5
0x0c 12
so you figure out if all conversations went smooth

edit 5
and please don't fucking tell me that all you want was to convert a value and not all values in the source :\
go for it is offline  
Thanks
1 User
Old 03/13/2013, 02:29   #3
 
Spirited's Avatar
 
elite*gold: 12
Join Date: Jul 2011
Posts: 8,211
Received Thanks: 4,114
"In mathematics and computer science, hexadecimal (also base 16, or hex) is a positional numeral system with a radix, or base, of 16. It uses sixteen distinct symbols, most often the symbols 0–9 to represent values zero to nine, and A, B, C, D, E, F (or alternatively a–f) to represent values ten to fifteen. For example, the hexadecimal number 2AF3 is equal, in decimal, to (2 × 163) + (10 × 162) + (15 × 161) + (3 × 160), or 10995.

Each hexadecimal digit represents four binary digits (bits), and the primary use of hexadecimal notation is a human-friendly representation of binary-coded values in computing and digital electronics. One hexadecimal digit represents a nibble, which is half of an octet or byte (8 bits). For example, byte values can range from 0 to 255 (decimal), but may be more conveniently represented as two hexadecimal digits in the range 00 to FF. Hexadecimal is also commonly used to represent computer memory addresses."

If you don't understand any of that.... no problem. Consider going to school though. Here's a converter:
Spirited is offline  
Thanks
1 User
Old 03/13/2013, 02:32   #4
 
elite*gold: 0
Join Date: Sep 2012
Posts: 775
Received Thanks: 327
Quote:
Originally Posted by Fаng View Post
"In mathematics and computer science, hexadecimal (also base 16, or hex) is a positional numeral system with a radix, or base, of 16. It uses sixteen distinct symbols, most often the symbols 0–9 to represent values zero to nine, and A, B, C, D, E, F (or alternatively a–f) to represent values ten to fifteen. For example, the hexadecimal number 2AF3 is equal, in decimal, to (2 × 163) + (10 × 162) + (15 × 161) + (3 × 160), or 10995.

Each hexadecimal digit represents four binary digits (bits), and the primary use of hexadecimal notation is a human-friendly representation of binary-coded values in computing and digital electronics. One hexadecimal digit represents a nibble, which is half of an octet or byte (8 bits). For example, byte values can range from 0 to 255 (decimal), but may be more conveniently represented as two hexadecimal digits in the range 00 to FF. Hexadecimal is also commonly used to represent computer memory addresses."

If you don't understand any of that.... no problem. Consider going to school though. Here's a converter:

i bet he wasn't asking about how to convert a single value o-0
i so doubt he want to know how to convert hex base to dec base

but most likely it's what i guessed
in edited trinity some freak replaced all dec values with hex values and he want to convert them all back with a non manual way

ill go burn myself if he was really asking how to convert hex base to dec base :'(
go for it is offline  
Thanks
1 User
Old 03/13/2013, 02:57   #5
 
elite*gold: 0
Join Date: Feb 2007
Posts: 240
Received Thanks: 22
heres i found on my book mark..

agathom is offline  
Thanks
1 User
Old 03/13/2013, 08:37   #6
 
elite*gold: 0
Join Date: Sep 2012
Posts: 51
Received Thanks: 30
Quote:
Originally Posted by Fаng View Post
For example, the hexadecimal number 2AF3 is equal, in decimal, to (2 × 163) + (10 × 162) + (15 × 161) + (3 × 160), or 10995.

The way you wrote that could confuse anybody who does not understand hexadecimal numbers. I know this forum does not support superscripts, but I propose to do it this way:

0x2AF3 = (2 × 16³) + (10 × 16²) + (15 × 16¹) + (3 × 16°) = 10995
urgabel is offline  
Thanks
1 User
Old 03/13/2013, 12:26   #7
 
elite*gold: 0
Join Date: Nov 2009
Posts: 342
Received Thanks: 17
Thanks all of you but as go for it said i didn't want to Convert to single value!!
i already knew by using calc.
#go for it thank you i got you as it your idea right but it boring Because every value will use it by the cute GUI that suppose i made.
maybe i can re-solve it by using Ctrl + H in the c#
search for and replace it easier than yours but anyway thanks for trying to help me
|xabi| is offline  
Old 03/13/2013, 18:05   #8
 
elite*gold: 0
Join Date: Sep 2012
Posts: 775
Received Thanks: 327
Quote:
Originally Posted by |xabi| View Post
Thanks all of you but as go for it said i didn't want to Convert to single value!!
i already knew by using calc.
#go for it thank you i got you as it your idea right but it boring Because every value will use it by the cute GUI that suppose i made.
maybe i can re-solve it by using Ctrl + H in the c#
search for and replace it easier than yours but anyway thanks for trying to help me
i know you were not that stupid to ask about converting single value :P
it's easier but less professional and more tiring
today before i go to the college i started a c# app. called IEditor
this app. will replace all that values for you automatically and give you log of listbox with stripping menu to restore a value or restore all or edit certain value
you are searching for unknown values/strings with unknown length
and you may apply scripts to them

so far in two hours i made the main engine , will work on that once i wake up and sure will be done tomorrow with more options and more pre made scripts
you may expect it tomorrow (may release it with small script engine)
engine will let you add letters or remove letters or do anything to strings , also will let you convert from any base to any base

gosh i forgot
you search for that values/strings by searching for certain chars which that words/values may begin and end with

tomorrow ill be releasing it and maybe will release the code source for others to learn as i'm learning good stuff throw coding it and sure others will
go for it is offline  
Old 03/13/2013, 20:56   #9
 
elite*gold: 0
Join Date: Nov 2009
Posts: 342
Received Thanks: 17
Quote:
Originally Posted by go for it View Post
i know you were not that stupid to ask about converting single value :P
it's easier but less professional and more tiring
today before i go to the college i started a c# app. called IEditor
this app. will replace all that values for you automatically and give you log of listbox with stripping menu to restore a value or restore all or edit certain value
you are searching for unknown values/strings with unknown length
and you may apply scripts to them

so far in two hours i made the main engine , will work on that once i wake up and sure will be done tomorrow with more options and more pre made scripts
you may expect it tomorrow (may release it with small script engine)
engine will let you add letters or remove letters or do anything to strings , also will let you convert from any base to any base

gosh i forgot
you search for that values/strings by searching for certain chars which that words/values may begin and end with

tomorrow ill be releasing it and maybe will release the code source for others to learn as i'm learning good stuff throw coding it and sure others will
thanks bro
[allah y5leek ya prince el sense ]
|xabi| is offline  
Old 03/17/2013, 19:18   #10
 
elite*gold: 0
Join Date: Feb 2013
Posts: 26
Received Thanks: 2
Why to make your self tired
here is the best & fastest way
!KrAToS! is offline  
Old 03/17/2013, 20:07   #11
 
elite*gold: 0
Join Date: Nov 2009
Posts: 342
Received Thanks: 17
thanks for trying me but really you didn't understand what iam talking about.
|xabi| is offline  
Old 03/17/2013, 21:09   #12
 
elite*gold: 0
Join Date: May 2011
Posts: 19
Received Thanks: 4
Talking

Quote:
Originally Posted by |xabi| View Post
thanks for trying me but really you didn't understand what iam talking about.
u mean convert all values in source by 1 click ??
M.Dego is offline  
Old 03/17/2013, 21:47   #13
 
elite*gold: 0
Join Date: Nov 2009
Posts: 342
Received Thanks: 17
Quote:
Originally Posted by M.Dego View Post
u mean convert all values in source by 1 click ??
i like ur post
el targma
ya3gbny feek mola7ztk el mawdo3ya xD
|xabi| is offline  
Old 03/18/2013, 03:22   #14
 
elite*gold: 0
Join Date: Jun 2009
Posts: 787
Received Thanks: 314
_tao4229_ is offline  
Thanks
2 Users
Old 03/19/2013, 05:26   #15
 
elite*gold: 0
Join Date: Sep 2012
Posts: 775
Received Thanks: 327
go for it is offline  
Thanks
1 User
Reply




All times are GMT +2. The time now is 07:27.


Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2024 elitepvpers All Rights Reserved.