You can check this post for some background. BangDream now use “on demand” delivery and I can get only arm64 blobs now. They are so different with old armv7 instrcutions so I have to rewrite some code to get correct tag numbers.
At first, use latestil2cppdumper, or you may have some errors when running the script. I tried immediately with my old script, and all tag numbers are reported None. It’s pretty annoying but it should have something to do with new instructions of arm64 (aarch64). Now let’s check what happend.
Like in armv7, protobuf-net codes are also compiled into two kinds of instructions. Use UserAuthRequest as an example. userId is compiled into:
But how are the immediate encoded? By checking the reference and the instruction encoding I figured out that MOVZ use direct immediate and ORR use bitmask immediate. Although they are aarch64 instructions, both of them use 32 bit immediate.
The direct immediate is pretty direct, just read the immediate and it’s finished:
x10x 0010 1xxi iiii iiii iiii iiid dddd
But how about bitmask immediate? They are like the rotating encoding of immediate in armv7 but have some different. ORR immediate instruction looks like this:
x01x 0010 0Nii iiii iiii iinn nnnd dddd
N together with first x (as known as sf) refers to bit length (sf==0 AND N==0 => 32bit or sf==1 => 64bit), first six binary digits of immediate are immr and last six binary digits of immediate are imms. You can find the code to decode bitmask immediate in the arm official reference: