Having a nightmare developing API for Purebasic

Hi all, i have been busy the last couple of days porting the API to purebasic. I have hit a brick wall and it is frustrating the hell out of me. The docs are not helping me much either. I am having problems authenticating my client with the server.

  1. Send a chr(6)
  2. Send “/login”+chr(0)

I get a response from the server “!done%=ret=” and the 32 character hash.

  1. Convert the 32 character hash to binary
  2. md5 chr(0)+password+binary hash
  3. hex the md5
  4. Send a chr(6)
  5. Send “/login”+chr(0)+“=name=admin,”+“=response=00”+hexed md5+chr(0)

The server sends “!done%=ret=” and the 32 character hash i got previously.

Thats as far as i get. I checked my hash conversion and i also Wiresharked api studio to compare. Both look the same.
I am stumped.

I figured it out. The second “/login” ends with chr(11). Is there anywhere in the docs that tells you this stuff?

The spec says that each word is the length, followed by that many bytes of data.

In the examples, each “line” is actually a “word”, and the length byte is omitted for readability. That particular aspect is more clearly elaborated at the notes.

So

/login  

!done  
=ret=ebddd18303a54111e2dea05a92ab46b4  

/login  
=name=admin
=response=001ea726ed53ae38520c8334f82d44c9f2  

!done

is actually

chr(6) + "/login" +
chr(0)

and then later

chr(6) + "/login" +
chr(11) + "=name=admin" +
chr(44) + "=response=001ea726ed53ae38520c8334f82d44c9f2" +
chr(0)

Thank you. Understood