How to extract addresses from input in raw transaction I need help to get input addresses from "vin" in offline mode.

I don't know how https://live.blockcypher.com/btc/decodetx/ is doing it.

Example raw transaction:

txn id : b0dd3d915a568c9d48e37b3fbfca58ae3276a5dba176fdf30f18af794310cc02

raw txn :

01000000000102b4370d52c1e1dc67b0250ef7bd5265146d4def0beacfefd99660a86baf97faf000000000232200202dc520822e73d4262000d3b456b16df1d07b0ba9d238f3063379d65840fd38e7feffffff92e7b08c7a67a7a783b52d83e7b051a4812e496fac181aaadcaa69a3b526ca500100000023220020357bc74e1f825c4628519a3322f2aa9b2c5bd55b523149d4e1f7fe2f273ce7d6feffffff02a08601000000000017a914113e1767186f0280174123ad0c22e8929f994c1c87f4fd01000000000017a9148160a47aeafb68288f0df8551d5d9dddd22a643387040047304402202575f8326e510b8213d70a8213ab1a36cd2984b16673ef3579960d0089ad13de022020ec4e78129c084103909acec0319f7d326fff699de142ab354be9570d68dc170147304402202bc22860e84e0311bbc175940c2b3b5435255dc7ca3fb0d12e5f03df80237b880220536eceee1aace094825f0fd884d057e395102f4e4627188fe6dd5648cdc7a457014752210274ecb4e28e6b7be314d844bb7561b605d537106f7f5c3eaba31a8cd3dd0097c8210343ed9c58350b4013b3c9a02da2148d59e8109a90f0fa0ea77d31b8570990d46352ae0400473044022042d6861f81b617cfbe51e7efefb59dd990d4c0057b43645d2f006db93b38c59e02204595b7f822546082b0ee1efb6966c97b2d8174c96b670a10bc9d78d3cf7ba99101483045022100bb3a612fe17f261a0c5e9db20a087362c10556571ef54866ab29cfdb94975236022037bebec4c0459bba21656cb36b331313c2dd6008ed7a2479efca659c7fc97c9d0147522103838edaeadeed0e9f660e725970787b69ad4926afe1f19626d5476d356cb3b4722103c37f3b264f674c6c2e273e06da7fb7fe720be6828f251c71d0cb10e349d0222d52ae2f3f0800


Expected "input addresses":

38Rgbmaxitveg1S8UNbWjwV5UMoBt3PtnG

3Bx1UMJieKFngvBA8m2VqE6s4wXYKWzhkP

Thank you.
Addresses are associated with output scripts (scriptPubKeys). This information is not encoded in the transaction, the only information in the input is the txid and index of the output that is being redeemed. In order to do this offline you need to have the previous transaction. 

The way they do it for inputs is they look up the previous output that the input is spending in their internal database and get the script from there.

In your example, this is the first input:

    {
        "addresses": [
            "38Rgbmaxitveg1S8UNbWjwV5UMoBt3PtnG"
        ], 
        "age": 539082, 
        "output_index": 0, 
        "output_value": 18640, 
        "prev_hash": "f0fa97af6ba86096d9efcfea0bef4d6d146552bdf70e25b067dce1c1520d37b4", 
        "script": "2200202dc520822e73d4262000d3b456b16df1d07b0ba9d238f3063379d65840fd38e7",

        "script_type": "pay-to-script-hash", 
        "sequence": 4294967294, 
        "witness": [
            "", 
            "304402202575f8326e510b8213d70a8213ab1a36cd2984b16673ef3579960d0089ad13de022020ec4e78129c084103909acec0319f7d326fff699de142ab354be9570d68dc1701",

            "304402202bc22860e84e0311bbc175940c2b3b5435255dc7ca3fb0d12e5f03df80237b880220536eceee1aace094825f0fd884d057e395102f4e4627188fe6dd5648cdc7a45701",

            "52210274ecb4e28e6b7be314d844bb7561b605d537106f7f5c3eaba31a8cd3dd0097c8210343ed9c58350b4013b3c9a02da2148d59e8109a90f0fa0ea77d31b8570990d46352ae"
        ]
    },


So you have to have the full tx with txid f0fa97af6ba86096d9efcfea0bef4d6d146552bdf70e25b067dce1c1520d37b4 in which case you inspect the first output (index 0) and from this output's script OP_HASH160 49e282ad0605c1cb63ff45fc34b14357859e8d08 OP_EQUAL you can derive the address 38Rgbmaxitveg1S8UNbWjwV5UMoBt3PtnG