亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? registry.pm

?? dhcp服務器的源代碼
?? PM
字號:
# Registry.pm
#   A perl module provided easy Windows Registry access
#
# Author: Shu-Min Chang
#
# Copyright(c) 2002 Intel Corporation.  All rights reserved
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
#    this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright notice
#    this list of conditions and the following disclaimer in the documentation
#    and/or other materials provided with the distribution
# 3. Neither the name of Intel Corporation nor the names of its contributors
#    may be used to endorse or promote products derived from this software
#    without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE INTEL CORPORATION AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED.  IN NO EVENT SHALL THE INTEL CORPORATION OR CONTRIBUTORS BE
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO PROCUREMENT OF SUBSTITUE
# GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
# OF THE USE OF THIS SOFTWARE, EVEN IF ADVICED OF THE POSSIBILITY OF SUCH
# DAMAGE.

package Registry;
use strict;
use Win32API::Registry 0.21 qw( :ALL );


###############################################################################

#-----------------------------------------
sub GetRegKeyVal($*) {
	my ($FullRegPath, $value) = @_;
#-----------------------------------------
# Purpose: uses Win32API to get registry information from a given server
#
# WARNING: this procedure is VERY Win32 specific, you'll need a Win32 manual
#          to figure out why something is done.
# input: $FullRegPath: a MS specific way of fully qualifying a registry path
#                     \\Server\RootKey\Path\ValueName
# output: *value: the value of the registry key of $FullRegPath
#

	my ($RemoteMachine, $RootKey, $RegPath, $KeyName, $i);

#print "in sub:GetRegKeyVal:Parameters:", @_, "\n";

	# Check the for valid fully qualified registry path
	return -1 if (! ($FullRegPath =~ /\\.+\\.+/)) && (!($FullRegPath =~ /\\\\.+\\.+\\.+/));


	$RemoteMachine = (index($FullRegPath, "\\\\") == $[ ? substr($FullRegPath, $[+2, index($FullRegPath, "\\", $[+2)-2):0);

#print "RemoteMachine = $RemoteMachine\n";

	$i = $RemoteMachine ? $[+3+length($RemoteMachine) : $[+1;
	$RootKey = substr ($FullRegPath, $i, index($FullRegPath, "\\", $i)-$i);

	$KeyName = $FullRegPath;
	$KeyName =~ s/.*\\(.+)/$1/;
#print "KeyName = $KeyName\n";

	$i = index($FullRegPath, $RootKey, $[+length($RemoteMachine)) + $[ + length($RootKey)+1;
	$RegPath = substr ($FullRegPath, $i, length($FullRegPath) - length($KeyName) -$i - 1);
#print "RegPath = $RegPath\n";

	my ($RootKeyHandle, $handle, $key, $type);

  if ($RemoteMachine) {
		$RootKeyHandle = regConstant($RootKey);

		if (!RegConnectRegistry ($RemoteMachine, $RootKeyHandle, $handle)) {
			$$value = regLastError();
			return -2;
		}
	} else { # not valid actually because I can't find the mapping table of default 
            # local handle mapping.  Should always pass in the Machine name to use for now
		$handle = $RootKey;
	}

	if (!RegOpenKeyEx ($handle, $RegPath, 0, KEY_READ, $key)) {
		$$value = regLastError();
#print "regLastError = $$value\n";
		return -3;
	}
	if (!RegQueryValueEx( $key, $KeyName, [], $type, $$value, [] )) {
		$$value = regLastError();
#print "regLastError = $$value\n";
		return -4;
	}

#print "RegType=$type\n";	# Perl doesn't fetch type, at this in this 
				# ActiveState 5.6.0 that I'm using
#print "RegValue=$$value\n";
	RegCloseKey ($key);
	RegCloseKey ($handle);

	return 0;
}

###############################################################################

#-----------------------------------------
sub GetRegSubkeyList($*) {
	my ($FullKeyRegPath, $Subkeys) = @_;
#-----------------------------------------
# Purpose: uses Win32API to get registry subkey list from a given server
#
# WARNING: this procedure is VERY Win32 specific, you'll need a Win32 manual
#          to figure out why something is done.
# input: $FullKeyRegPath: a MS specific way of fully qualifying a registry path
#                     \\Server\RootKey\Path\KeyName
# output: *Subkeys: the list of subkeys in array of the registry key of 
#                   $FullKeyRegPath
#

	my ($RemoteMachine, $RootKey, $RegPath, $KeyName, $i);

#print "in sub:GetRegSubkeyList:Parameters:", @_, "\n";

	# Check the for valid registry key path
	return -1 if (! ($FullKeyRegPath =~ /\\.+\\.+/)) && (!($FullKeyRegPath =~ /\\\\.+\\.+\\.+/));


	$RemoteMachine = (index($FullKeyRegPath, "\\\\") == $[ ? substr($FullKeyRegPath, $[+2, index($FullKeyRegPath, "\\", $[+2)-2):0);

#print "RemoteMachine = $RemoteMachine\n";

	$i = $RemoteMachine ? $[+3+length($RemoteMachine) : $[+1;
	$RootKey = substr ($FullKeyRegPath, $i, index($FullKeyRegPath, "\\", $i)-$i);

	$i = index($FullKeyRegPath, $RootKey, $[+length($RemoteMachine)) + $[ + length($RootKey)+1;
	$RegPath = substr ($FullKeyRegPath, $i);

#print "RegPath = $RegPath\n";

	my ($RootKeyHandle, $handle, $key, $type);

	if ($RemoteMachine) {
		$RootKeyHandle = regConstant($RootKey);

		if (!RegConnectRegistry ($RemoteMachine, $RootKeyHandle, $handle)) {
			@$Subkeys[0]= regLastError();
			return -2;
		}
	} else { # not valid actually because I can't find the mapping table of default 
            # local handle mapping.  Should always pass in the Machine name to use for now
		$handle = $RootKey;
	}

	if (!RegOpenKeyEx ($handle, $RegPath, 0, KEY_READ, $key)) {
		@$Subkeys[0] = regLastError();
#print "regLastError = @$Subkeys[0]\n";
		return -3;
	}

	my $tmp;
	# For some reason, the regLastError() stays at ERROR_NO_MORE_ITEMS
	# in occasional call sequence, so I'm resetting the error code
	# before entering the loop
	regLastError(0);
	for ($i=0; regLastError()==regConstant("ERROR_NO_MORE_ITEMS"); $i++) {
#print "\nERROR: error enumumerating reg\n";
		if (RegEnumKeyEx ($key, $i, $tmp, [], [], [], [], [])) {
			@$Subkeys[$i] = $tmp;
		}
	}
	
#print "RegType=$type\n";
#print "RegValue=@$Subkeys\n";
	RegCloseKey ($key);
	RegCloseKey ($handle);

	return 0;
}

#####################################################

sub ExtractOptionIps ($) {
	my ($MSDHCPOption6Value) = @_;
	my @ip;
# purpose: DHCP registry specific; to return the extracted IP addresses from 
#          the input variable
# input:
#   $MSDHCPOption6Value: Option 6 was used to develop, but it works for any
#                        other options of the same datatype.
# output: none
# return: 
#   @ip: an arry of IP addresses in human readable format.


	# First extract the size of the option
	my ($byte, $size, $ind1, $ind2, @octet) = unpack("VVVV", $MSDHCPOption6Value);
# print "byte = $byte\nsize=$size\nind1=$ind1\nind2=$ind2\n";

	# Calculate total number of bytes that IP addresses occupy
	my $number = $size * $ind1;
	($byte, $size, $ind1, $ind2, @octet) = unpack("VVVVC$number", $MSDHCPOption6Value);

	for (my $i=0; $i<$#octet; $i=$i+4) {
		$ip[$i/4] = "$octet[$i+3]\.$octet[$i+2]\.$octet[$i+1]\.$octet[$i]";
	}

	return @ip;
}

#####################################################

sub ExtractOptionStrings ($) {
	my ($MSDHCPOption15Value) = @_;
	my @string;
# purpose: DHCP registry specific; to return the extracted string from 
#          the input variable
# input:
#   $MSDHCPOption15Value: Option 15 was used to develop, but it works for any
#                         other options of the same datatype.
# output: none
# return: 
#   @string: an arry of strings in human readable format.


	# First extract the size of the option
	my ($byte, $start, $ind1, $ind2, $size, @data) = unpack("VVVVV", $MSDHCPOption15Value);
# print "byte = $byte\nstart=$start\nind1=$ind1\nind2=$ind2\nsize=$size\n";

	# Calculate total number of bytes that IP addresses occupy
	my $number = $size * $ind1;
	($byte, $start, $ind1, $ind2, $size, @data) = unpack("VVVVVC$number", $MSDHCPOption15Value);

	for (my $i=0; $i<$ind1; $i++) {
	# actually this is only programmed to do one string, until I see
	# example of how the multiple strings are represented, I don't have a
	# guess to how to program them properly.
		for (my $j=0; $j<$#data & $data[$j]!=0; $j+=2) {
			$string[$i] = $string[$i].chr($data[$j]);
		}
	}

	return @string;
}

#####################################################

sub ExtractOptionHex ($) {
	my ($MSDHCPOption46Value) = @_;
	my @Hex;
# purpose: DHCP registry specific; to return the extracted hex from the input
#          variable
# input:
#   $MSDHCPOption46Value: Option 46 was used to develop, but it works for any
#                         other options of the same datatype.
# output: none
# return: 
#   @Hex: an arry of hex strings in human readable format.
	my $Temp;


	# First extract the size of the option
	my ($byte, $unknown, $ind1, $ind2, @data) = unpack("VVVV", $MSDHCPOption46Value);
# print "byte=$byte\nunknown=$unknown\nind1=$ind1\nind2=$ind2\n";

	# Calculate total number of bytes that IP addresses occupy
	my $number = $byte - 15;
	($byte, $unknown, $ind1, $ind2, @data) = unpack("VVVVC$number", $MSDHCPOption46Value);

# printf "data=%4x\n", $data[0];

	for (my $i=0; $i<$ind1; $i++) {
	# actually this is only programmed to do one Hex, until I see
	# example of how the multiple Hexes are represented, I don't have a
	# guess to how to program them properly.
		for (my $j=3; $j>=0; $j--) {
			$Hex[$i] = $Hex[$i].sprintf ("%x", $data[$j+$i*4]);
		}
	}

	return @Hex;
}

#####################################################

sub ExtractExclusionRanges ($) {
	my ($MSDHCPExclusionRanges) = @_;
	my @RangeList;
# purpose: DHCP registry specific; to return the extracted exclusion ranges 
#          from the input variable
# input:
#   $MSDHCPExclusionRanges: Exclusion range as DHCP server returns them
# output: none
# return: 
#   @RangeList: an arry of paird IP addresses strings in human readable format.


	# First extract the size of the option
	my ($paircount, @data) = unpack("V", $MSDHCPExclusionRanges);
# print "paircount = $paircount\n";

	# Calculate total number of bytes that IP addresses occupy
#	my $number = $paircount * 4*2;
#	($paircount, @data) = unpack("VC$number", $MSDHCPExclusionRanges);
#
#	for (my $i=0; $i<$#data; $i=$i+4) {
#		$ip[$i/4] = "$data[$i+3]\.$data[$i+2]\.$data[$i+1]\.$data[$i]";
#	}
#
	my $number = $paircount * 2;
	($paircount, @data) = unpack("VL$number", $MSDHCPExclusionRanges);

	for (my $i=0; $i<=$#data; $i++) {
		$RangeList[$i] = pack ("L", $data[$i]);
# print "extracted", ExtractIp ($RangeList[$i]), "\n";
	}

	return @RangeList;
}
#####################################################

sub ExtractIp ($) {
	my ($octet) = @_;
# purpose: to return the registry saved IP address in a readable form
# input:
#   $octet: a 4 byte data storing the IP address as the registry save it as
# output: none
# return: anonymous variable of a string of IP address

	my (@data) = unpack ("C4", $octet);

	return "$data[3]\.$data[2]\.$data[1]\.$data[0]";

}
#####################################################

sub ExtractHex ($) {
	my ($HexVal) = @_;
	my @Hex;
# purpose: to return the registry saved hex number in a readable form
# input:
#   $octet: a 4 byte data storing the hex number as the registry save it as
# output: none
# return: 
#   $Hex: string of hex digit


	# First extract the size of the option
	my (@data) = unpack("C4", $HexVal);

	for (my $i=3; $i>=0; $i--) {
		$Hex[0] = $Hex[0] . sprintf ("%x", $data[$i]);
	}

	return @Hex;
}
1;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲成a人v欧美综合天堂| 欧日韩精品视频| 国产精品理论片在线观看| 岛国av在线一区| 亚洲欧美日韩综合aⅴ视频| 欧美日韩亚洲另类| 国产91综合一区在线观看| 五月天网站亚洲| 国产精品久久三| 国产精品久久久久aaaa樱花| 欧美国产日韩精品免费观看| 精品视频色一区| 欧美精品xxxxbbbb| 国产999精品久久| www.日韩在线| 久久不见久久见免费视频7| 国产精品久久久久久户外露出 | 欧美一区二区三区啪啪| 福利电影一区二区| 99re热视频这里只精品| 国产呦萝稀缺另类资源| 亚洲精品ww久久久久久p站| 精品黑人一区二区三区久久| 91网上在线视频| 成人性色生活片| 91黄色激情网站| 99久久精品国产精品久久| 91国产免费看| 日韩精品一区二区三区在线观看 | 欧美日韩在线播放三区| 欧美日韩免费在线视频| 日韩欧美一级片| 精品对白一区国产伦| 国产精品午夜免费| 久久蜜臀精品av| 欧美一区二区啪啪| 欧美激情一区在线| 亚洲午夜一区二区| 亚洲小少妇裸体bbw| 久久99最新地址| 色综合久久综合中文综合网| www.亚洲国产| 91精品国产福利在线观看| 久久精品欧美一区二区三区不卡| 久久在线观看免费| 久久噜噜亚洲综合| 亚洲综合在线观看视频| 久久久精品综合| 亚洲国产另类精品专区| 精品在线观看视频| 久久99精品久久久| 日本国产一区二区| 精品国产91久久久久久久妲己| 亚洲欧美色综合| 国产真实乱子伦精品视频| 国产精品综合二区| 高清av一区二区| 欧美日韩黄视频| 欧美电影精品一区二区| 亚洲男人电影天堂| 国产精品自拍网站| 欧美日韩高清一区二区| 国产精品成人一区二区三区夜夜夜| 视频一区免费在线观看| 青青草原综合久久大伊人精品优势 | 亚洲国产精品成人久久综合一区| 亚洲国产精品精华液2区45| 午夜视频在线观看一区二区| 国产成人在线色| 99在线精品免费| 精品区一区二区| 日本一区二区三区国色天香| 亚洲欧美中日韩| 亚洲图片欧美视频| av在线这里只有精品| 26uuu久久天堂性欧美| 婷婷久久综合九色综合绿巨人| 97久久超碰国产精品| 国产午夜亚洲精品理论片色戒 | 成人午夜av电影| 欧美精品一区二区蜜臀亚洲| 日本亚洲视频在线| 国产一区二区在线看| 欧美一区二区三区婷婷月色| 一区二区三区在线不卡| 91在线精品一区二区三区| 国产嫩草影院久久久久| 国产一区二区三区四| 精品免费视频.| 看电视剧不卡顿的网站| 欧美精选午夜久久久乱码6080| 一区二区在线免费观看| 99国产精品久久久久久久久久久 | 国产精品亚洲人在线观看| 2024国产精品视频| 乱中年女人伦av一区二区| 欧美精品在线一区二区三区| 午夜久久久久久久久久一区二区| 色婷婷综合久久久久中文一区二区 | 精品播放一区二区| 美国一区二区三区在线播放| 99精品热视频| 国产精品久久久久久久久晋中| 国产在线日韩欧美| 久久久精品中文字幕麻豆发布| 精品亚洲porn| 久久亚洲春色中文字幕久久久| 精一区二区三区| 久久这里只精品最新地址| 国产一区二区伦理片| 国产欧美日韩另类视频免费观看| 大陆成人av片| 亚洲品质自拍视频网站| 欧美日韩中字一区| 午夜精品一区二区三区免费视频 | 91丨porny丨首页| 亚洲人成小说网站色在线| 91国产成人在线| 石原莉奈在线亚洲三区| 日韩美女一区二区三区| 国产麻豆午夜三级精品| 国产精品久久久久永久免费观看| 91亚洲男人天堂| 亚洲成人激情av| 精品久久久久久久久久久院品网| 国内不卡的二区三区中文字幕| 日本一区免费视频| 在线区一区二视频| 蜜臀av国产精品久久久久| 久久免费视频一区| 91毛片在线观看| 日韩经典一区二区| 久久欧美一区二区| 91丨九色丨蝌蚪富婆spa| 婷婷综合另类小说色区| 久久久久久久久久久99999| 91丝袜美腿高跟国产极品老师| 亚洲成a人片在线不卡一二三区 | 亚洲一区二区三区精品在线| 欧美一区二区女人| 国产91精品露脸国语对白| 亚洲视频一区在线| 成人免费看视频| 午夜日韩在线观看| 久久综合久久综合久久| heyzo一本久久综合| 日韩精品1区2区3区| 亚洲国产精品成人综合| 欧美精品免费视频| 国产成人精品aa毛片| 丝袜诱惑制服诱惑色一区在线观看 | 国产片一区二区三区| 欧美在线观看视频在线| 91福利国产精品| 麻豆精品一区二区| 国产精品国产三级国产aⅴ原创| 欧洲一区二区三区在线| 国产一区二区三区四| 亚洲在线视频网站| 欧美国产综合一区二区| 337p亚洲精品色噜噜噜| 日韩在线a电影| 中文字幕国产一区| 日韩一级二级三级精品视频| 麻豆91精品91久久久的内涵| 中文字幕中文字幕在线一区| 欧美一区二区三区爱爱| 欧美自拍丝袜亚洲| 丁香婷婷深情五月亚洲| 老司机精品视频导航| 亚洲一区二区精品视频| 国产日韩欧美精品电影三级在线| 欧美精品在线观看一区二区| 成人97人人超碰人人99| 亚洲一区中文在线| 亚洲国产精品成人综合色在线婷婷 | 亚洲欧美日韩中文字幕一区二区三区 | 亚欧色一区w666天堂| 国产午夜亚洲精品理论片色戒| 欧美丰满高潮xxxx喷水动漫 | 国产精品福利电影一区二区三区四区| 欧美一级理论性理论a| 色综合久久88色综合天天免费| 国产99久久久国产精品潘金| 极品瑜伽女神91| 日本美女一区二区| 亚洲一区在线播放| 亚洲欧美偷拍卡通变态| 国产精品乱码久久久久久| 久久久精品影视| 久久久久久久综合日本| 日韩欧美一区二区三区在线| 制服丝袜亚洲色图| 欧美日韩一区二区欧美激情 | 亚洲精品v日韩精品| 亚洲欧洲一区二区在线播放| 欧美激情在线一区二区| 欧美激情一区二区三区| 国产日韩av一区二区| 欧美国产国产综合|