Creating manual protobuf request?

I saw the post about using plugins to create protobuf req but im not familiar enough with protobuf to get it to work.

Is it possible to start with?
What i tried instead was grabbing the request data as HEX, and by using Protobuf Code Generator and Parser | protobufnet | Marc Gravell i figured out that the request consists of email and base64 password and some other things [REMOVED]
So then in my config i turn username and base64 password into hex format and place em into same spots that they are in the original hex string. 0a00101d1a10<usernameHex>2210<passwordHex>
Now i have identical hex what the app uses, but how do i post something like this, usually post data consists of value1=value but i only have the value. I hope someone understands what i mean

Once you have the hex string, you need to use the Hex => Bytes block to convert it to a byte array. Then, in the Http Block switch to Raw content mode and plug in the variable with the byte array in it, done. If you have trouble let me know.

I keep getting [Executing block POST Login] ArgumentOutOfRangeException: Specified argument was out of the range of valid values.

BLOCK:StringToBytes
LABEL:Username String => Bytes
  input = $"<input.USERNAME>"
  => VAR @usernameBytes
ENDBLOCK

BLOCK:ByteArrayToHexString
LABEL:Username Bytes => Hex
  bytes = @usernameBytes
  => VAR @usernameHex
ENDBLOCK

BLOCK:UTF8ToBase64
LABEL:Password UTF8 => Base64
  input = @input.PASSWORD
  => VAR @passwordBase64
ENDBLOCK

BLOCK:ByteArrayToHexString
LABEL:Password Bytes => Hex
  bytes = @passwordBase64
  => VAR @passwordHex
ENDBLOCK

BLOCK:HexStringToByteArray
LABEL:Final Hex => Bytes
  hexString = $"0a00101d1a10<usernameHex>2210<passwordHex>"
  => VAR @finalBytes
ENDBLOCK

BLOCK:RandomString
LABEL:rng deviceid
  input = "?d?d?d?d?d?d?d?d?d?d?d?d?l?l?d?l"
  => VAR @deviceid
ENDBLOCK

BLOCK:RandomString
LABEL:rng client id
  input = "?d?d?d"
  => VAR @clientid
ENDBLOCK

BLOCK:HttpRequest
LABEL:POST Login
  url = "https://*censored*/authenticate"
  method = POST
  alwaysSendContent = True
  customHeaders = ${("User-Agent", "Dalvik/2.1.0 (Linux; U; Android 11; SM-A525F Build/RP1A.200720.012)"), ("Pragma", "no-cache"), ("Accept", "*/*"), ("x-unity-version", "2018.4.26f1"), ("locale", "fi_FI"), ("host", "censored"), ("device-id", "<deviceid>"), ("app-id", "1"), ("app-version", "22.18.534"), ("client-id", "<clientid>"), ("expect", "100-continue")}
  TYPE:RAW
  @finalBytes
  "application/protobuf"
ENDBLOCK

Hello, I just discovered that a bug in OB2 is causing this, I am working on a fix right now, it should be patched in the next version, sorry for the trouble. Please open an issue in github so that the progress can be tracked properly, thanks!

Done [Bug]: ByteArray as raw post data · Issue #485 · openbullet/OpenBullet2 · GitHub

Thank you, issue fixed. Please wait for 0.1.26 or build yourself from the source code, sorry for the problem :sweat_smile:

1 Like

Also I think there is something wrong in your config, you are doing it correctly for username but for password it goes to base64 and then to hex, is this intended? :thinking:

This should be better

BLOCK:StringToBytes
  input = @input.USERNAME
  => VAR @username
ENDBLOCK

BLOCK:ByteArrayToHexString
LABEL:Username Bytes => Hex
  bytes = @username
  => VAR @usernameHex
ENDBLOCK

BLOCK:StringToBytes
  input = @input.PASSWORD
  => VAR @password
ENDBLOCK

BLOCK:ByteArrayToHexString
LABEL:Password Bytes => Hex
  bytes = @password
  => VAR @passwordHex
ENDBLOCK

BLOCK:HexStringToByteArray
LABEL:Final Hex => Bytes
  hexString = $"0a00101d1a10<usernameHex>2210<passwordHex>"
  => VAR @finalBytes
ENDBLOCK

BLOCK:RandomString
LABEL:rng deviceid
  input = "?d?d?d?d?d?d?d?d?d?d?d?d?l?l?d?l"
  => VAR @deviceid
ENDBLOCK

BLOCK:RandomString
LABEL:rng client id
  input = "?d?d?d"
  => VAR @clientid
ENDBLOCK

BLOCK:HttpRequest
LABEL:POST Login
  url = "https://httpbin.org/anything"
  method = POST
  alwaysSendContent = True
  customHeaders = ${("User-Agent", "Dalvik/2.1.0 (Linux; U; Android 11; SM-A525F Build/RP1A.200720.012)"), ("Pragma", "no-cache"), ("Accept", "*/*"), ("x-unity-version", "2018.4.26f1"), ("locale", "fi_FI"), ("device-id", "<deviceid>"), ("app-id", "1"), ("app-version", "22.18.534"), ("client-id", "<clientid>"), ("expect", "100-continue")}
  TYPE:RAW
  @finalBytes
  "application/protobuf"
ENDBLOCK

Yeah its intended, in post data the pass is in base64 form turned into hex

1 Like