Giter Club home page Giter Club logo

aristoteles's People

Contributors

jiska2342 avatar saibotk avatar sterzy 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

aristoteles's Issues

Add the "virtual" "GMID"-field

In libARI.dylib on iOS 14.3 there is virtual field in the ARI header called the "GMID". It consists of the group field and type field concatenated in the following manor:

GMID = Group ID || 0 || Type ID || 000000000000000

See the following frida script for more information. I uses the AriMsg::GetBufGmid(uint32_t * buf, uint32_t len) function:

// GMID = GID || 0 || MID || 000000000000000; Proof

var getBufGmidPtr = Module.getExportByName("libARI.dylib", "_ZN6AriMsg10GetBufGmidEPKhm");
var getBufGmidFun = new NativeFunction(
            getBufGmidPtr,
            'uint32',
            ['pointer', 'int32']);

var payloadBuf = Memory.alloc(12);

var ari = [0xde, 0xc0, 0x7e, 0xab, 0xF8, 0x01, 0x00, 0x00, 0xc0, 0xFF, 0x00, 0x00];
Memory.writeByteArray(payloadBuf, ari);
var a = getBufGmidFun(payloadBuf, ari.length);

ari = [0xde, 0xc0, 0x7e, 0xab, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF];
Memory.writeByteArray(payloadBuf, ari);
var b = getBufGmidFun(payloadBuf, ari.length);

var c = 0xfdff8000; // === (0x3f << 26) | (0x03ff << 15)

a === b && b === c;

Field Names ARIstoteles vs. libARI.dylib

Field names in the dissector differ from log strings and function signatures in libARI.dylib. This may be relevant and should probably be documented. Examples:

ARIstoteles libARI.dylib
Group gid or just g
Type id mid or just m
ID (TLVs) tid
Transaction Either ctx (context) or trx (transaction).

Sample log strings:

(%s:%d) trying to pack gid(%d) mid(0x%03x) tid(%d) with sz(%zu) > max size(%zu)
(%s:%d) trying to pack gid(%d) mid(0x%03x) tid(%d) with sz(%zu) not multiple of element sz(%zu)
(%s:%d) UNKNOWN tlv with g(%d) m(0x%03x) tid(%d), ignored
(%s:%d) canceling ctx 0x%x gmid 0x%x %s
(%s:%d) Client (0x%x) cancelTrx(0x%x) done

Symbols for functions:

Symbol (frida) Function signature
_ZN6AriMsg9GetBufGidEPKhm AriMsg::GetBufGid(uint32_t * buf, uint64_t len)
_ZN6AriMsg9GetBufMidEPKhm AriMsg::GetBufMid(uint32_t * buf, uint64_t len)
_ZN6AriMsg9GetBufCtxEPKhm AriMsg::GetBufCtx(uint32_t * buf, uint64_t len)

Add Acknowledgement Option

When analyzing libARI.dylib there is a function that parses an acknowledgement option or flag from a given ARI header (AriMsg::GetBufAckOpt(uint32_t * buf, uint32_t len)). The option is the 4th bit of the 8th byte. Please see the attached frida script:

// ACK Option = Byte 8, Bit 4

var getAckOptPtr = Module.getExportByName("libARI.dylib", "_ZN6AriMsg12GetBufAckOptEPKhm");
var getAckOptFun = new NativeFunction(
            getAckOptPtr,
            'uint32',
            ['pointer', 'int32']);

var payloadBuf = Memory.alloc(12);

var ari = [0xde, 0xc0, 0x7e, 0xab, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00];
Memory.writeByteArray(payloadBuf, ari);
var a = getAckOptFun(payloadBuf, ari.length);

ari = [0xde, 0xc0, 0x7e, 0xab, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF];
Memory.writeByteArray(payloadBuf, ari);
var b = getAckOptFun(payloadBuf, ari.length);

a === b;

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.