Path: blob/main/crypto/openssl/ms/uplink-common.pl
34860 views
#! /usr/bin/env perl1# Copyright 2008-2016 The OpenSSL Project Authors. All Rights Reserved.2#3# Licensed under the Apache License 2.0 (the "License"). You may not use4# this file except in compliance with the License. You can obtain a copy5# in the file LICENSE in the source distribution or at6# https://www.openssl.org/source/license.html78# pull APPLINK_MAX value from applink.c...9$applink_c=$0;10$applink_c=~s|[^/\\]+$||g;11$applink_c.="applink.c";12open(INPUT,$applink_c) || die "can't open $applink_c: $!";13@max=grep {/APPLINK_MAX\s+(\d+)/} <INPUT>;14close(INPUT);15($#max==0) or die "can't find APPLINK_MAX in $applink_c";1617$max[0]=~/APPLINK_MAX\s+(\d+)/;18$N=$1; # number of entries in OPENSSL_UplinkTable not including19# OPENSSL_UplinkTable[0], which contains this value...20211;2223# Idea is to fill the OPENSSL_UplinkTable with pointers to stubs24# which invoke 'void OPENSSL_Uplink (ULONG_PTR *table,int index)';25# and then dereference themselves. Latter shall result in endless26# loop *unless* OPENSSL_Uplink does not replace 'table[index]' with27# something else, e.g. as 'table[index]=unimplemented;'...282930