Coder Social home page Coder Social logo

iosauthruntime's Introduction

iOS-Authorize-Runtime

996.icu

用于给指定设备进行帐号授权的运行时库

说明

此工程是iOS-Auth的基础运行时支持库

iOSAuthSingle用于通过套接字授权单个设备(主要用于调试)

iOSAuthService用于通过套接字监听授权数据并创建管道及iOSAuthHandle进行授权(主要用于防止运行时错误及内存泄漏)

iOSAuthHandle用于通过管道连接iOSAuthService进行单个设备授权

模块

Library: 扫描当前设备的iTunes库并加载

Handle: 根据iTunes版本设置指定的偏移地址并调用

Network: 通过套接字或管道与客户端或服务器通信

Convert: 十六进制转换

Process: 进程执行函数封装

Exec: 执行入口

通信流程

客户端: 第一次数据,格式:前4字节udid长度,再4字节FairPlayCertificate长度,再加GrappaSupportInfo长度为0x14,再加FairPlayArg长度0x10,再加udid,再加FairPlayCertificate数据

服务端: 第一次数据,长度是固定的0x54 (84)字节(Grappa)

客户端: 第二次数据,前0x53个字节为Grappa数据,再跟0x15字节为afsync.rq.sig,再跟afsync.rq

服务端: 第二次数据,格式:前面15个字节为/AirFair/sync/afsync.rs.sig,后面的字节为/AirFair/sync/afsync.rs

运行流程

加载iTunes.dll/iTunesCore.dll以及AirTrafficHost.dll

根据iTunes.dll/iTunesCore.dll版本找到指定的偏移地址(欢迎补充其它版本的偏移地址)

调用 KBSyncMachineKey 获取本机的同步ID

调用 KBSyncLibraryKey 获取库的同步ID

调用 KBSyncTokenCreate 获取同步Token,这里的 SCInfoDir 下必须要求有用iTunes.exe授权过此电脑产生的 SC Info.sidb 和 SC Info.sidd 文件

接收第一个客户端的包,并拆分 UDID、FairPlayCertificate、FairPlayDeviceType 以及 KeyTypeSupportVersion。具体请看 auth_exec_recv_package_1

通过得到的数据调用 AirFairSyncSessionCreate 获得同步Session

使用 UDID 调用 AirFairSyncGrappaCreate 获得 Grappa 数据及ID

将 Grappa 发送至客户端。具体请看 auth_exec_send_package

接收第二个客户端的包,并拆分 Grappa、/AirFair/sync/afsync.rq 以及 /AirFair/sync/afsync.rq.sig。具体请看 auth_exec_recv_package_2

调用 AirFairSyncSetRequest 设置 RQ

调用 AirFairSyncAccountAuthorize 给此请求授权,DSID由使用者自己抓包获取,AppleId会绑定到一个DSID,DSID需要和 SC Info 相匹配

使用设备传回的 Grappa 调用 AirFairSyncGrappaUpdate 去更新随机密钥

调用 AirFairSyncGetResponse 获取答复

通过前面获取的 GrappaID 调用 AirFairSyncCalcSig 去计算 SIG签名

将生成的数据发回客户端设备

iosauthruntime's People

Contributors

ios-auth avatar

Stargazers

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

Watchers

 avatar  avatar  avatar

iosauthruntime's Issues

搭建demo环境

我在搭建项目的测试,希望能跑通基本流程.目前我失败了,失败在不知道如何和手机对接.期望得到作者的支持.我愿意为知识付费.我的email:ghp3000◎gmail.com

代码中对应版本的函数 AirFairSyncGrappaCreate 调用不成功

调用的时候报错:

Run-Time Check Failure #0 - The value of ESP was not properly saved across a function call. This is usually a result of calling a function declared with one calling convention with a function pointer declared with a different calling convention.

可以提供一下itunes安装包吗?谢谢大佬!

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.