Giter VIP home page Giter VIP logo

cr-messages's People

Contributors

akirarat avatar clugh avatar d3death avatar jadbalout avatar noext avatar srabouin avatar waqasrana avatar xyzwarrior avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cr-messages's Issues

Proxy setting problem

Hi, sorry if i open an issue, but is the only way to get in touch with you.
i'm a developer and i'm really interested in reverse clash royale protocol. I love clash royale and on reddit i usually datamine csv files. However i want to learn more. I know python, and with some help i can work on this project.
First of all i want to set up the proxy. I used a modified version of coc-patcher to try to patch the apk file. However the url is a problem to me. i really don't know what to write as the url in the json config file.
Can youi help me to setup my environment?

Need combat-related messages' structures

I'm not sure this is the best way to reach you about this, but here goes.

I'm looking to create a tool that can extract blow-by-blow combat logs (like what World of Warcraft produces with the /combatlog command) as a first step toward automating after-action review. I figure the safest and easiest way to do this, despite requiring a rooted/jailbroken device, is with a packet sniffer running as a separate app. But to do this, I need definitions for the messages that carry unit movement, attacks and casting. How close are you to deciphering those?

Update Required

Clash Royale was updated nowadays. Could you update your content for us?
By the way, thank you for your remarkable resources!

Clan chat message structure

Hi!
I'm currently working on the clan chat message structure.
The thing is that the messages are obfuscated, so we have to go on low-level contents.
This is a raw chat message content
5ef800003800000200819eec561d8ed0051d8ed00500000005416c676f7506040000000000194a276169206c6f6f746572206c65207072696e6365203a2d29

5ef8 = 24312 is the message type id (AllianceStreamEntry by cocdp).

In the part 00003800000200819eec561d8ed0 there is normally the post time, but I didn't found it...

416c676f750604 = Algou, the author's name

0000000000194a is a separator (at least 0000000000 I think)

276169206c6f6f746572206c65207072696e6365203a2d29 = "J'ai looter le prince :-)", it's the message content

How can we get this with the json selector?

Beta structures

I tried to figure out some message structures, but I encountered some problems, which I hope someone else already figured out :).

I started with the message pair 14324 (SearchAlliances) and 24310 (AllianceList).
First my "beta" structures:

{
    "id": 14324,
    "name": "SearchAlliances",
    "fields": [
        {"name": "searchString", "type": "STRING"},
        {"name": "clanLocation", "type": "?3BYTE"},
        {"name": "minMembers", "type": "INT"},
        {"name": "maxMembers", "type": "INT"},
        {"type": "BYTE"},
        {"type": "BYTE"},
        {"name": "trophyLimit", "type": "2BYTE"},
        {"name": "joinable", "type": "BOOLEAN"},
        {"type": "INT"},
        {"type": "INT"}
    ]
}
{
   "id": 24310,
   "name": "AllianceList",
   "fields": [
      {"name": "searchString", "type": "STRING"},
      {"name": "searchEntries", "type": "SearchEntry[]"}
   ]
}
{
   "name": "SearchEntry",
   "fields": [
      {"name": "clanId", "type": "LONG"},
      {"name": "clanName", "type": "STRING"},
      {"name": "clanBadge", "type": "3BYTE"},
      {"name": "memberCount", "type": "BYTE"},
      {"name": "trophies", "type": "2BYTE"},
      {"type": "BYTE"},
      {"name": "requiredTrophies", "type": "?2BYTE"},
      {"type": "BYTE"},
      {"type": "2BYTE"},
      {"type": "2BYTE"},
      {"type": "2BYTE"},
      {"type": "INT"}
   ]
}
  1. For what I saw, message fields can have sizes of 1, 2, 3, 4 and 8 bytes. For example memberCount can only be max 50 so only 1 byte is used. No big problem, but it makes it hard reading those hex dumps.
  2. Many values are somehow obfuscated and can't be extracted directly. For example trophies, gold, gems, etc.. Again from looking at the hex dumps of 24310 (AllianceList) the trophies field needs some math to get the real value. Something like:
    base_value + trophy_count * factor
    But base_valueand factor changes if you compare it to different clans. Same with requiredTrophies, but a different formula.
    Understanding the message reader needs some debugging I guess. Maybe someone has already done this?
  3. The last thing the optional field changed. For example clanLocation can have a length between 1-3.
    Any = 0x00, Europe = 0x3900, Zimbabwe = 0x398404
    Depending on the value the length changes of those fields. I can handle that, but there are additional problems. For example SearchEntry does not work as it is, because the length also changes and I don't know why, mainly because of problem 2 und 3 :).

So does anyone has some hints/tips how to handle these problems or has someone done some debugging?

Link Code Message (16002) in example i used fafa fafa fafa as link code.

16002 payload length: 16 version: 0
00000000:  3e 82 00 00 10 00 00 00  00 00 0c 66 61 66 61 66   |>..........fafaf|
00000010:  61 66 61 66 61 66 61                               |afafafa|
26005 Error: 'Message definition missing (26005).'
26005 payload length: 44 version: 0
00000000:  65 95 00 00 2c 00 00 00  00 00 0c 66 61 66 61 66   |e...,......fafaf|
00000010:  61 66 61 66 61 66 61 00  00 00 00 00 00 00 00 00   |afafafa.........|
00000020:  00 00 00 00 00 00 04 00  00 00 00 00 00 00 00 00   |................|
00000030:  00 00 00```

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.