Sign in to follow this  
Followers 0
creeping

how to create a string in hex

3 posts in this topic

Right, Im not sure how to create this packet to send, the details are below which I obtained form a website

Login Packet - For logging in.

To log in:

A login packet: [Note: I have removed all the stack details from the

dump; this is only the payload of the packet.]

59 43 : 48 54 00 00 01 00 00 00 YCHT......

00 01 00 00 00 4A 41 73 : 6B 46 6F 72 42 6F 6F 7A .....JAskForBooz

65 01 76 3D 31 26 6E 3D : 38 6C 35 67 33 33 39 70 e.v=1&n=8l5g339p

37 6A 30 66 66 26 6C 3D : 37 30 64 36 63 30 64 5F 7j0ff&l=70d6c0d_

31 65 6A 2F 6F 26 70 3D : 6D 32 63 32 62 38 36 35 1ej/o&p=m2c2b865

31 30 30 30 32 26 72 3D : 34 67 26 6C 67 3D 75 73 10002&r=4g&lg=us

The first 16 bytes are header. Of that, the first 4 are "YCHT", then the

next 4 will be 00 00 01 00, then the next 4 will be the packet type from

the index above.

Sure enough, a login is 00 00 00 01.

The next 2 will be 00 00, and the next two will be the size of the payload.

This is the entire packet's data minus the 16-byte Yahoo header.

0x4A is 74, and there is 74 bytes of data.

The rest of the format for the login packet is (username, 0x01, cookie).

That is all there is to it.

Example - if we have read in our variables correctly, we can send them very easily.

To login:

ycht + ver + type + size + name + del1 + cookie

where

ycht = YCHT

ver = 0010

login = 0001

size = len(name) + len(cookie) + len(del1)

name = username

cookie = cookie

del1 = 0x01

Above is what i need to create.

Im not sure to create the 4 bytes 00 00 01 00 then add them to the string etc.

$packet = "YCHT"
$packet = packet & ????

Also size = len(name) + len(cookie) + len(del1)

How would I convert 'size' to a 2 byte hex number to insert in the packet?

Any ideas on how to construct the packet?

Thanks

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

I'm probly way off base here but, look in the help file at _HexToString() and _StringToHex()

--hope this helps

~cdkid

Edited by cdkid

AutoIt Console written in C#. Write au3 code right at the console :D_FileWriteToLineWrite to a specific line in a file.My UDF Libraries: MySQL UDF Library version 1.6 MySQL Database UDF's for AutoItI have stopped updating the MySQL thread above, all future updates will be on my SVN. The svn location is:kan2.sytes.net/publicsvn/mysqlnote: This will still be available, but due to my new job, and school hours, am no longer developing this udf.My business: www.hirethebrain.com Hire The Brain HireTheBrain.com Computer Consulting, Design, Assembly and RepairOh no! I've commited Scriptocide!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0