主頁 >  其他 > 斗地主老是輸?一起用Python做個AI出牌器!

斗地主老是輸?一起用Python做個AI出牌器!

2021-08-11 09:56:37 其他

前言

最近在網上看到一個有意思的開源專案,快手團隊開發的開源AI斗地主——DouZero,今天我們就一起來學習制作一個基于DouZero的歡樂斗地主出牌器,看看AI是如何來幫助我們斗地主,贏歡樂豆,實作財富自由的吧!

下面,我們開始介紹這個AI出牌器的制作程序,

一、核心功能設計

首先我們這款出牌器是基于DouZero開發的,核心是需要利用訓練好的AI模型來幫住我們,給出最優出牌方案,

其次關于出牌器,先要需要確認一個AI出牌角色,代表我們玩家自己,我們只要給這個AI輸入玩家手牌和三張底牌,確認好地主和農民的各個角色,告訴它三個人對應的關系,這樣就可以確定隊友和對手,我們還要將每一輪其他兩人的出牌輸入,這樣出牌器就可以根據出牌資料,及時提供給我們最優出牌決策,帶領我們取得勝利!

那么如何獲取三者之間的關系呢?誰是地主?誰是農民?是自己一人作戰還是農民合作?自己玩家的手牌是什么?三張底牌是什么?這些也都需要在開局后確認好,

拆解需求,大致可以整理出核心功能如下:

  • UI設計排版布局

    • 顯示三張底牌
    • 顯示AI角色出牌資料區域,上家出牌資料區域,下家出牌資料區域,本局勝率區域
    • AI玩家手牌區域
    • AI出牌器開始停止
  • 手牌和出牌資料識別

    • 游戲剛開始根據螢屏位置,截圖識別AI玩家手牌及三張底牌
    • 確認三者之間的關系,識別地主和農民角色,確認隊友及對手關系
    • 識別每輪三位玩家依次出了什么牌,重繪顯示對應區域
  • AI出牌方案輸出

    • 加載訓練好的AI模型,初始化游戲環境
    • 每輪出牌判斷,根據上家出牌資料給出最優出牌決策
    • 自動重繪玩家剩余手牌和本局勝率預測

二、實作步驟

1. UI設計排版布局

根據上述功能,我們首先考慮進行簡單的UI布局設計,這里我們使用的是pyqt5,核心設計代碼如下:

def setupUi(self, Form):
    Form.setObjectName("Form")
    Form.resize(440, 395)
    font = QtGui.QFont()
    font.setFamily("Arial")
    font.setPointSize(9)
    font.setBold(True)
    font.setItalic(False)
    font.setWeight(75)
    Form.setFont(font)
    self.WinRate = QtWidgets.QLabel(Form)
    self.WinRate.setGeometry(QtCore.QRect(240, 180, 171, 61))
    font = QtGui.QFont()
    font.setPointSize(14)
    self.WinRate.setFont(font)
    self.WinRate.setAlignment(QtCore.Qt.AlignCenter)
    self.WinRate.setObjectName("WinRate")
    self.InitCard = QtWidgets.QPushButton(Form)
    self.InitCard.setGeometry(QtCore.QRect(60, 330, 121, 41))
    font = QtGui.QFont()
    font.setFamily("Arial")
    font.setPointSize(14)
    font.setBold(True)
    font.setWeight(75)
    self.InitCard.setFont(font)
    self.InitCard.setStyleSheet("")
    self.InitCard.setObjectName("InitCard")
    self.UserHandCards = QtWidgets.QLabel(Form)
    self.UserHandCards.setGeometry(QtCore.QRect(10, 260, 421, 41))
    font = QtGui.QFont()
    font.setPointSize(14)
    self.UserHandCards.setFont(font)
    self.UserHandCards.setAlignment(QtCore.Qt.AlignCenter)
    self.UserHandCards.setObjectName("UserHandCards")
    self.LPlayer = QtWidgets.QFrame(Form)
    self.LPlayer.setGeometry(QtCore.QRect(10, 80, 201, 61))
    self.LPlayer.setFrameShape(QtWidgets.QFrame.StyledPanel)
    self.LPlayer.setFrameShadow(QtWidgets.QFrame.Raised)
    self.LPlayer.setObjectName("LPlayer")
    self.LPlayedCard = QtWidgets.QLabel(self.LPlayer)
    self.LPlayedCard.setGeometry(QtCore.QRect(0, 0, 201, 61))
    font = QtGui.QFont()
    font.setPointSize(14)
    self.LPlayedCard.setFont(font)
    self.LPlayedCard.setAlignment(QtCore.Qt.AlignCenter)
    self.LPlayedCard.setObjectName("LPlayedCard")
    self.RPlayer = QtWidgets.QFrame(Form)
    self.RPlayer.setGeometry(QtCore.QRect(230, 80, 201, 61))
    font = QtGui.QFont()
    font.setPointSize(16)
    self.RPlayer.setFont(font)
    self.RPlayer.setFrameShape(QtWidgets.QFrame.StyledPanel)
    self.RPlayer.setFrameShadow(QtWidgets.QFrame.Raised)
    self.RPlayer.setObjectName("RPlayer")
    self.RPlayedCard = QtWidgets.QLabel(self.RPlayer)
    self.RPlayedCard.setGeometry(QtCore.QRect(0, 0, 201, 61))
    font = QtGui.QFont()
    font.setPointSize(14)
    self.RPlayedCard.setFont(font)
    self.RPlayedCard.setAlignment(QtCore.Qt.AlignCenter)
    self.RPlayedCard.setObjectName("RPlayedCard")
    self.Player = QtWidgets.QFrame(Form)
    self.Player.setGeometry(QtCore.QRect(40, 180, 171, 61))
    self.Player.setFrameShape(QtWidgets.QFrame.StyledPanel)
    self.Player.setFrameShadow(QtWidgets.QFrame.Raised)
    self.Player.setObjectName("Player")
    self.PredictedCard = QtWidgets.QLabel(self.Player)
    self.PredictedCard.setGeometry(QtCore.QRect(0, 0, 171, 61))
    font = QtGui.QFont()
    font.setPointSize(14)
    self.PredictedCard.setFont(font)
    self.PredictedCard.setAlignment(QtCore.Qt.AlignCenter)
    self.PredictedCard.setObjectName("PredictedCard")
    self.ThreeLandlordCards = QtWidgets.QLabel(Form)
    self.ThreeLandlordCards.setGeometry(QtCore.QRect(140, 10, 161, 41))
    font = QtGui.QFont()
    font.setPointSize(16)
    self.ThreeLandlordCards.setFont(font)
    self.ThreeLandlordCards.setAlignment(QtCore.Qt.AlignCenter)
    self.ThreeLandlordCards.setObjectName("ThreeLandlordCards")
    self.Stop = QtWidgets.QPushButton(Form)
    self.Stop.setGeometry(QtCore.QRect(260, 330, 111, 41))
    font = QtGui.QFont()
    font.setFamily("Arial")
    font.setPointSize(14)
    font.setBold(True)
    font.setWeight(75)
    self.Stop.setFont(font)
    self.Stop.setStyleSheet("")
    self.Stop.setObjectName("Stop")

    self.retranslateUi(Form)
    self.InitCard.clicked.connect(Form.init_cards)
    self.Stop.clicked.connect(Form.stop)
    QtCore.QMetaObject.connectSlotsByName(Form)

def retranslateUi(self, Form):
    _translate = QtCore.QCoreApplication.translate
    Form.setWindowTitle(_translate("Form", "AI歡樂斗地主--Dragon少年"))
    self.WinRate.setText(_translate("Form", "勝率:--%"))
    self.InitCard.setText(_translate("Form", "開始"))
    self.UserHandCards.setText(_translate("Form", "手牌"))
    self.LPlayedCard.setText(_translate("Form", "上家出牌區域"))
    self.RPlayedCard.setText(_translate("Form", "下家出牌區域"))
    self.PredictedCard.setText(_translate("Form", "AI出牌區域"))
    self.ThreeLandlordCards.setText(_translate("Form", "三張底牌"))
    self.Stop.setText(_translate("Form", "停止"))

實作效果如下:
在這里插入圖片描述

2. 手牌和出牌資料識別

下面我們需要所有撲克牌的模板圖片與游戲螢屏特定區域的截圖進行對比,這樣才能獲取AI玩家手牌、底牌、每一輪出牌、三者關系(地主、地主上家、地主下家),

識別AI玩家手牌及三張底牌:

我們可以截取游戲螢屏,根據固定位置來識別當前AI玩家的手牌和三張底牌,核心代碼如下:

# 牌檢測結果濾波
def cards_filter(self, location, distance):  
    if len(location) == 0:
        return 0
    locList = [location[0][0]]
    count = 1
    for e in location:
        flag = 1  # “是新的”標志
        for have in locList:
            if abs(e[0] - have) <= distance:
                flag = 0
                break
        if flag:
            count += 1
            locList.append(e[0])
    return count

# 獲取玩家AI手牌
def find_my_cards(self, pos):
    user_hand_cards_real = ""
    img = pyautogui.screenshot(region=pos)
    for card in AllCards:
        result = pyautogui.locateAll(needleImage='pics/m' + card + '.png', haystackImage=img, confidence=self.MyConfidence)
        user_hand_cards_real += card[1] * self.cards_filter(list(result), self.MyFilter)
    return user_hand_cards_real

# 獲取地主三張底牌
def find_three_landlord_cards(self, pos):
    three_landlord_cards_real = ""
    img = pyautogui.screenshot(region=pos)
    img = img.resize((349, 168))
    for card in AllCards:
        result = pyautogui.locateAll(needleImage='pics/o' + card + '.png', haystackImage=img,
                                     confidence=self.ThreeLandlordCardsConfidence)
        three_landlord_cards_real += card[1] * self.cards_filter(list(result), self.OtherFilter)
    return three_landlord_cards_real

效果如下所示:
在這里插入圖片描述

地主、地主上家、地主下家:

同理我們可以根據游戲螢屏截圖,識別地主的圖示,確認地主角色,核心代碼如下:

# 查找地主角色
def find_landlord(self, landlord_flag_pos):
    for pos in landlord_flag_pos:
        result = pyautogui.locateOnScreen('pics/landlord_words.png', region=pos, confidence=self.LandlordFlagConfidence)
        if result is not None:
            return landlord_flag_pos.index(pos)
    return None

在這里插入圖片描述
這樣我們就可以得到玩家AI手牌,其他玩家手牌(預測),地主三張底牌,三者角色關系,出牌順序,核心代碼如下:

# 坐標
self.MyHandCardsPos = (414, 804, 1041, 59)  # AI玩家截圖區域
self.LPlayedCardsPos = (530, 470, 380, 160)  # 左側玩家截圖區域
self.RPlayedCardsPos = (1010, 470, 380, 160)  # 右側玩家截圖區域
self.LandlordFlagPos = [(1320, 300, 110, 140), (320, 720, 110, 140), (500, 300, 110, 140)]  # 地主標志截圖區域(右-我-左)
self.ThreeLandlordCardsPos = (817, 36, 287, 136)      # 地主底牌截圖區域,resize成349x168

def init_cards(self):
    # 玩家手牌
    self.user_hand_cards_real = ""
    self.user_hand_cards_env = []
    # 其他玩家出牌
    self.other_played_cards_real = ""
    self.other_played_cards_env = []
    # 其他玩家手牌(整副牌減去玩家手牌,后續再減掉歷史出牌)
    self.other_hand_cards = []
    # 三張底牌
    self.three_landlord_cards_real = ""
    self.three_landlord_cards_env = []
    # 玩家角色代碼:0-地主上家, 1-地主, 2-地主下家
    self.user_position_code = None
    self.user_position = ""
    # 開局時三個玩家的手牌
    self.card_play_data_list = {}
    # 出牌順序:0-玩家出牌, 1-玩家下家出牌, 2-玩家上家出牌
    self.play_order = 0
    self.env = None
    # 識別玩家手牌
    self.user_hand_cards_real = self.find_my_cards(self.MyHandCardsPos)
    self.UserHandCards.setText(self.user_hand_cards_real)
    self.user_hand_cards_env = [RealCard2EnvCard[c] for c in list(self.user_hand_cards_real)]
    # 識別三張底牌
    self.three_landlord_cards_real = self.find_three_landlord_cards(self.ThreeLandlordCardsPos)
    self.ThreeLandlordCards.setText("底牌:" + self.three_landlord_cards_real)
    self.three_landlord_cards_env = [RealCard2EnvCard[c] for c in list(self.three_landlord_cards_real)]
    # 識別玩家的角色
    self.user_position_code = self.find_landlord(self.LandlordFlagPos)
    if self.user_position_code is None:
        items = ("地主上家", "地主", "地主下家")
        item, okPressed = QInputDialog.getItem(self, "選擇角色", "未識別到地主,請手動選擇角色:", items, 0, False)
        if okPressed and item:
            self.user_position_code = items.index(item)
        else:
            return
    self.user_position = ['landlord_up', 'landlord', 'landlord_down'][self.user_position_code]
    for player in self.Players:
        player.setStyleSheet('background-color: rgba(255, 0, 0, 0);')
    self.Players[self.user_position_code].setStyleSheet('background-color: rgba(255, 0, 0, 0.1);')

    # 整副牌減去玩家手上的牌,就是其他人的手牌,再分配給另外兩個角色(如何分配對AI判斷沒有影響)
    for i in set(AllEnvCard):
        self.other_hand_cards.extend([i] * (AllEnvCard.count(i) - self.user_hand_cards_env.count(i)))
    self.card_play_data_list.update({
        'three_landlord_cards': self.three_landlord_cards_env,
        ['landlord_up', 'landlord', 'landlord_down'][(self.user_position_code + 0) % 3]:
            self.user_hand_cards_env,
        ['landlord_up', 'landlord', 'landlord_down'][(self.user_position_code + 1) % 3]:
            self.other_hand_cards[0:17] if (self.user_position_code + 1) % 3 != 1 else self.other_hand_cards[17:],
        ['landlord_up', 'landlord', 'landlord_down'][(self.user_position_code + 2) % 3]:
            self.other_hand_cards[0:17] if (self.user_position_code + 1) % 3 == 1 else self.other_hand_cards[17:]
    })
    print(self.card_play_data_list)
    # 生成手牌結束,校驗手牌數量
    if len(self.card_play_data_list["three_landlord_cards"]) != 3:
        QMessageBox.critical(self, "底牌識別出錯", "底牌必須是3張!", QMessageBox.Yes, QMessageBox.Yes)
        self.init_display()
        return
    if len(self.card_play_data_list["landlord_up"]) != 17 or \
        len(self.card_play_data_list["landlord_down"]) != 17 or \
        len(self.card_play_data_list["landlord"]) != 20:
        QMessageBox.critical(self, "手牌識別出錯", "初始手牌數目有誤", QMessageBox.Yes, QMessageBox.Yes)
        self.init_display()
        return
    # 得到出牌順序
    self.play_order = 0 if self.user_position == "landlord" else 1 if self.user_position == "landlord_up" else 2

效果如下:
在這里插入圖片描述

3. AI出牌方案輸出

下面我們就需要用到DouZero開源的AI斗地主了,DouZero專案地址:https://github.com/kwai/DouZero,我們需要將該開源專案下載并匯入專案中,

創建一個AI玩家角色,初始化游戲環境,加載模型,進行每輪的出牌判斷,控制一局游戲流程的進行和結束,核心代碼如下:

# 創建一個代表玩家的AI
ai_players = [0, 0]
ai_players[0] = self.user_position
ai_players[1] = DeepAgent(self.user_position, self.card_play_model_path_dict[self.user_position])
# 初始化游戲環境
self.env = GameEnv(ai_players)
# 游戲開始
self.start()

def start(self):
    self.env.card_play_init(self.card_play_data_list)
    print("開始出牌\n")
    while not self.env.game_over:
        # 玩家出牌時就通過智能體獲取action,否則通過識別獲取其他玩家出牌
        if self.play_order == 0:
            self.PredictedCard.setText("...")
            action_message = self.env.step(self.user_position)
            # 更新界面
            self.UserHandCards.setText("手牌:" + str(''.join(
                [EnvCard2RealCard[c] for c in self.env.info_sets[self.user_position].player_hand_cards]))[::-1])

            self.PredictedCard.setText(action_message["action"] if action_message["action"] else "不出")
            self.WinRate.setText("勝率:" + action_message["win_rate"])
            print("\n手牌:", str(''.join(
                    [EnvCard2RealCard[c] for c in self.env.info_sets[self.user_position].player_hand_cards])))
            print("出牌:", action_message["action"] if action_message["action"] else "不出", ", 勝率:",
                  action_message["win_rate"])
            while self.have_white(self.RPlayedCardsPos) == 1 or \
                    pyautogui.locateOnScreen('pics/pass.png',
                                             region=self.RPlayedCardsPos,
                                             confidence=self.LandlordFlagConfidence):
                print("等待玩家出牌")
                self.counter.restart()
                while self.counter.elapsed() < 100:
                    QtWidgets.QApplication.processEvents(QEventLoop.AllEvents, 50)
            self.play_order = 1
        elif self.play_order == 1:
            self.RPlayedCard.setText("...")
            pass_flag = None
            while self.have_white(self.RPlayedCardsPos) == 0 and \
                    not pyautogui.locateOnScreen('pics/pass.png',
                                                 region=self.RPlayedCardsPos,
                                                 confidence=self.LandlordFlagConfidence):
                print("等待下家出牌")
                self.counter.restart()
                while self.counter.elapsed() < 500:
                    QtWidgets.QApplication.processEvents(QEventLoop.AllEvents, 50)
            self.counter.restart()
            while self.counter.elapsed() < 500:
                QtWidgets.QApplication.processEvents(QEventLoop.AllEvents, 50)
            # 不出
            pass_flag = pyautogui.locateOnScreen('pics/pass.png',
                                                 region=self.RPlayedCardsPos,
                                                 confidence=self.LandlordFlagConfidence)
            # 未找到"不出"
            if pass_flag is None:
                # 識別下家出牌
                self.other_played_cards_real = self.find_other_cards(self.RPlayedCardsPos)
            # 找到"不出"
            else:
                self.other_played_cards_real = ""
            print("\n下家出牌:", self.other_played_cards_real)
            self.other_played_cards_env = [RealCard2EnvCard[c] for c in list(self.other_played_cards_real)]
            self.env.step(self.user_position, self.other_played_cards_env)
            # 更新界面
            self.RPlayedCard.setText(self.other_played_cards_real if self.other_played_cards_real else "不出")
            self.play_order = 2
        elif self.play_order == 2:
            self.LPlayedCard.setText("...")
            while self.have_white(self.LPlayedCardsPos) == 0 and \
                    not pyautogui.locateOnScreen('pics/pass.png',
                                                region=self.LPlayedCardsPos,
                                                confidence=self.LandlordFlagConfidence):
                print("等待上家出牌")
                self.counter.restart()
                while self.counter.elapsed() < 500:
                    QtWidgets.QApplication.processEvents(QEventLoop.AllEvents, 50)
            self.counter.restart()
            while self.counter.elapsed() < 500:
                QtWidgets.QApplication.processEvents(QEventLoop.AllEvents, 50)
            # 不出
            pass_flag = pyautogui.locateOnScreen('pics/pass.png',
                                                 region=self.LPlayedCardsPos,
                                                 confidence=self.LandlordFlagConfidence)
            # 未找到"不出"
            if pass_flag is None:
                # 識別上家出牌
                self.other_played_cards_real = self.find_other_cards(self.LPlayedCardsPos)
            # 找到"不出"
            else:
                self.other_played_cards_real = ""
            print("\n上家出牌:", self.other_played_cards_real)
            self.other_played_cards_env = [RealCard2EnvCard[c] for c in list(self.other_played_cards_real)]
            self.env.step(self.user_position, self.other_played_cards_env)
            self.play_order = 0
            # 更新界面
            self.LPlayedCard.setText(self.other_played_cards_real if self.other_played_cards_real else "不出")
        else:
            pass

        self.counter.restart()
        while self.counter.elapsed() < 100:
            QtWidgets.QApplication.processEvents(QEventLoop.AllEvents, 50)

    print("{}勝,本局結束!\n".format("農民" if self.env.winner == "farmer" else "地主"))
    QMessageBox.information(self, "本局結束", "{}勝!".format("農民" if self.env.winner == "farmer" else "地主"),
                            QMessageBox.Yes, QMessageBox.Yes)
    self.env.reset()
    self.init_display()

到這里,整個AI斗地主出牌流程基本已經完成了,
在這里插入圖片描述

三、出牌器用法

按照上述程序,這款AI出牌器已經制作完成了,后面應該如何使用呢?如果不想研究原始碼,只想使用這款AI斗地主出牌器,驗證下效果,該怎么配置環境運行這個AI出牌器呢?下面就開始介紹,

1. 環境配置

首先我們需要安裝這些第三方庫,配置相關環境,如下所示:

torch==1.9.0
GitPython==3.0.5
gitdb2==2.0.6
PyAutoGUI==0.9.50
PyQt5==5.13.0
PyQt5-sip==12.8.1
Pillow>=5.2.0
opencv-python
rlcard

2. 坐標調整確認

我們可以打開游戲界面,將游戲視窗模式下最大化運行,把AI出牌器程式視窗需要移至右下角,不能遮擋手牌、地主標志、底牌、歷史出牌這些關鍵位置,

其次我們要確認螢屏截圖獲取的各個區域是否正確,如果有問題需要進行區域位置坐標調整,

# 坐標
self.MyHandCardsPos = (414, 804, 1041, 59)  # 我的截圖區域
self.LPlayedCardsPos = (530, 470, 380, 160)  # 左邊截圖區域
self.RPlayedCardsPos = (1010, 470, 380, 160)  # 右邊截圖區域
self.LandlordFlagPos = [(1320, 300, 110, 140), (320, 720, 110, 140), (500, 300, 110, 140)]  # 地主標志截圖區域(右-我-左)
self.ThreeLandlordCardsPos = (817, 36, 287, 136)      # 地主底牌截圖區域,resize成349x168

在這里插入圖片描述

3. 運行測驗

當所有環境配置完成,各區域坐標位置確認無誤之后,下面我們就可以直接運行程式,測驗效果啦~

首先我們運行AI出牌器程式,打開歡樂斗地主游戲界面,進入游戲,當玩家就位,手牌分發完畢,地主身份確認之后,我們就可以點擊畫面中開始按鈕,讓AI來幫助我們斗地主了,

下面可以一起來看看這款AI出牌器的實驗效果喔,看看AI是如何帶領農民打倒地主,取得勝利的!

<iframe id="0Jpaddqp-1627864534814" src="https://live.csdn.net/v/embed/174210" allowfullscreen="true" data-mediaembed="csdn"></iframe>

今天我們就到這里,明天繼續努力!
在這里插入圖片描述
若本篇內容對您有所幫助,請三連點贊,關注,收藏支持下,

創作不易,白嫖不好,各位的支持和認可,就是我創作的最大動力,我們下篇文章見!

Dragon少年 | 文

如果本篇博客有任何錯誤,請批評指教,不勝感激 !

轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/293075.html

標籤:其他

上一篇:makecode.microbit用Python做個躲磚塊小游戲

下一篇:Parallel ScavengeGC收集器

標籤雲
其他(157675) Python(38076) JavaScript(25376) Java(17977) C(15215) 區塊鏈(8255) C#(7972) AI(7469) 爪哇(7425) MySQL(7132) html(6777) 基礎類(6313) sql(6102) 熊猫(6058) PHP(5869) 数组(5741) R(5409) Linux(5327) 反应(5209) 腳本語言(PerlPython)(5129) 非技術區(4971) Android(4554) 数据框(4311) css(4259) 节点.js(4032) C語言(3288) json(3245) 列表(3129) 扑(3119) C++語言(3117) 安卓(2998) 打字稿(2995) VBA(2789) Java相關(2746) 疑難問題(2699) 细绳(2522) 單片機工控(2479) iOS(2429) ASP.NET(2402) MongoDB(2323) 麻木的(2285) 正则表达式(2254) 字典(2211) 循环(2198) 迅速(2185) 擅长(2169) 镖(2155) 功能(1967) .NET技术(1958) Web開發(1951) python-3.x(1918) HtmlCss(1915) 弹簧靴(1913) C++(1909) xml(1889) PostgreSQL(1872) .NETCore(1853) 谷歌表格(1846) Unity3D(1843) for循环(1842)

熱門瀏覽
  • 網閘典型架構簡述

    網閘架構一般分為兩種:三主機的三系統架構網閘和雙主機的2+1架構網閘。 三主機架構分別為內端機、外端機和仲裁機。三機無論從軟體和硬體上均各自獨立。首先從硬體上來看,三機都用各自獨立的主板、記憶體及存盤設備。從軟體上來看,三機有各自獨立的作業系統。這樣能達到完全的三機獨立。對于“2+1”系統,“2”分為 ......

    uj5u.com 2020-09-10 02:00:44 more
  • 如何從xshell上傳檔案到centos linux虛擬機里

    如何從xshell上傳檔案到centos linux虛擬機里及:虛擬機CentOs下執行 yum -y install lrzsz命令,出現錯誤:鏡像無法找到軟體包 前言 一、安裝lrzsz步驟 二、上傳檔案 三、遇到的問題及解決方案 總結 前言 提示:其實很簡單,往虛擬機上安裝一個上傳檔案的工具 ......

    uj5u.com 2020-09-10 02:00:47 more
  • 一、SQLMAP入門

    一、SQLMAP入門 1、判斷是否存在注入 sqlmap.py -u 網址/id=1 id=1不可缺少。當注入點后面的引數大于兩個時。需要加雙引號, sqlmap.py -u "網址/id=1&uid=1" 2、判斷文本中的請求是否存在注入 從文本中加載http請求,SQLMAP可以從一個文本檔案中 ......

    uj5u.com 2020-09-10 02:00:50 more
  • Metasploit 簡單使用教程

    metasploit 簡單使用教程 浩先生, 2020-08-28 16:18:25 分類專欄: kail 網路安全 linux 文章標簽: linux資訊安全 編輯 著作權 metasploit 使用教程 前言 一、Metasploit是什么? 二、準備作業 三、具體步驟 前言 Msfconsole ......

    uj5u.com 2020-09-10 02:00:53 more
  • 游戲逆向之驅動層與用戶層通訊

    驅動層代碼: #pragma once #include <ntifs.h> #define add_code CTL_CODE(FILE_DEVICE_UNKNOWN,0x800,METHOD_BUFFERED,FILE_ANY_ACCESS) /* 更多游戲逆向視頻www.yxfzedu.com ......

    uj5u.com 2020-09-10 02:00:56 more
  • 北斗電力時鐘(北斗授時服務器)讓網路資料更精準

    北斗電力時鐘(北斗授時服務器)讓網路資料更精準 北斗電力時鐘(北斗授時服務器)讓網路資料更精準 京準電子科技官微——ahjzsz 近幾年,資訊技術的得了快速發展,互聯網在逐漸普及,其在人們生活和生產中都得到了廣泛應用,并且取得了不錯的應用效果。計算機網路資訊在電力系統中的應用,一方面使電力系統的運行 ......

    uj5u.com 2020-09-10 02:01:03 more
  • 【CTF】CTFHub 技能樹 彩蛋 writeup

    ?碎碎念 CTFHub:https://www.ctfhub.com/ 筆者入門CTF時時剛開始刷的是bugku的舊平臺,后來才有了CTFHub。 感覺不論是網頁UI設計,還是題目質量,賽事跟蹤,工具軟體都做得很不錯。 而且因為獨到的金幣制度的確讓人有一種想去刷題賺金幣的感覺。 個人還是非常喜歡這個 ......

    uj5u.com 2020-09-10 02:04:05 more
  • 02windows基礎操作

    我學到了一下幾點 Windows系統目錄結構與滲透的作用 常見Windows的服務詳解 Windows埠詳解 常用的Windows注冊表詳解 hacker DOS命令詳解(net user / type /md /rd/ dir /cd /net use copy、批處理 等) 利用dos命令制作 ......

    uj5u.com 2020-09-10 02:04:18 more
  • 03.Linux基礎操作

    我學到了以下幾點 01Linux系統介紹02系統安裝,密碼啊破解03Linux常用命令04LAMP 01LINUX windows: win03 8 12 16 19 配置不繁瑣 Linux:redhat,centos(紅帽社區版),Ubuntu server,suse unix:金融機構,證券,銀 ......

    uj5u.com 2020-09-10 02:04:30 more
  • 05HTML

    01HTML介紹 02頭部標簽講解03基礎標簽講解04表單標簽講解 HTML前段語言 js1.了解代碼2.根據代碼 懂得挖掘漏洞 (POST注入/XSS漏洞上傳)3.黑帽seo 白帽seo 客戶網站被黑帽植入劫持代碼如何處理4.熟悉html表單 <html><head><title>TDK標題,描述 ......

    uj5u.com 2020-09-10 02:04:36 more
最新发布
  • 2023年最新微信小程式抓包教程

    01 開門見山 隔一個月發一篇文章,不過分。 首先回顧一下《微信系結手機號資料庫被脫庫事件》,我也是第一時間得知了這個訊息,然后跟蹤了整件事情的經過。下面是這起事件的相關截圖以及近日流出的一萬條資料樣本: 個人認為這件事也沒什么,還不如關注一下之前45億快遞資料查詢渠道疑似在近日復活的訊息。 訊息是 ......

    uj5u.com 2023-04-20 08:48:24 more
  • web3 產品介紹:metamask 錢包 使用最多的瀏覽器插件錢包

    Metamask錢包是一種基于區塊鏈技術的數字貨幣錢包,它允許用戶在安全、便捷的環境下管理自己的加密資產。Metamask錢包是以太坊生態系統中最流行的錢包之一,它具有易于使用、安全性高和功能強大等優點。 本文將詳細介紹Metamask錢包的功能和使用方法。 一、 Metamask錢包的功能 數字資 ......

    uj5u.com 2023-04-20 08:47:46 more
  • vulnhub_Earth

    前言 靶機地址->>>vulnhub_Earth 攻擊機ip:192.168.20.121 靶機ip:192.168.20.122 參考文章 https://www.cnblogs.com/Jing-X/archive/2022/04/03/16097695.html https://www.cnb ......

    uj5u.com 2023-04-20 07:46:20 more
  • 從4k到42k,軟體測驗工程師的漲薪史,給我看哭了

    清明節一過,盲猜大家已經無心上班,在數著日子準備過五一,但一想到銀行卡里的余額……瞬間心情就不美麗了。最近,2023年高校畢業生就業調查顯示,本科畢業月平均起薪為5825元。調查一出,便有很多同學表示自己又被平均了。看著這一資料,不免讓人想到前不久中國青年報的一項調查:近六成大學生認為畢業10年內會 ......

    uj5u.com 2023-04-20 07:44:00 more
  • 最新版本 Stable Diffusion 開源 AI 繪畫工具之中文自動提詞篇

    🎈 標簽生成器 由于輸入正向提示詞 prompt 和反向提示詞 negative prompt 都是使用英文,所以對學習母語的我們非常不友好 使用網址:https://tinygeeker.github.io/p/ai-prompt-generator 這個網址是為了讓大家在使用 AI 繪畫的時候 ......

    uj5u.com 2023-04-20 07:43:36 more
  • 漫談前端自動化測驗演進之路及測驗工具分析

    隨著前端技術的不斷發展和應用程式的日益復雜,前端自動化測驗也在不斷演進。隨著 Web 應用程式變得越來越復雜,自動化測驗的需求也越來越高。如今,自動化測驗已經成為 Web 應用程式開發程序中不可或缺的一部分,它們可以幫助開發人員更快地發現和修復錯誤,提高應用程式的性能和可靠性。 ......

    uj5u.com 2023-04-20 07:43:16 more
  • CANN開發實踐:4個DVPP記憶體問題的典型案例解讀

    摘要:由于DVPP媒體資料處理功能對存放輸入、輸出資料的記憶體有更高的要求(例如,記憶體首地址128位元組對齊),因此需呼叫專用的記憶體申請介面,那么本期就分享幾個關于DVPP記憶體問題的典型案例,并給出原因分析及解決方法。 本文分享自華為云社區《FAQ_DVPP記憶體問題案例》,作者:昇騰CANN。 DVPP ......

    uj5u.com 2023-04-20 07:43:03 more
  • msf學習

    msf學習 以kali自帶的msf為例 一、msf核心模塊與功能 msf模塊都放在/usr/share/metasploit-framework/modules目錄下 1、auxiliary 輔助模塊,輔助滲透(埠掃描、登錄密碼爆破、漏洞驗證等) 2、encoders 編碼器模塊,主要包含各種編碼 ......

    uj5u.com 2023-04-20 07:42:59 more
  • Halcon軟體安裝與界面簡介

    1. 下載Halcon17版本到到本地 2. 雙擊安裝包后 3. 步驟如下 1.2 Halcon軟體安裝 界面分為四大塊 1. Halcon的五個助手 1) 影像采集助手:與相機連接,設定相機引數,采集影像 2) 標定助手:九點標定或是其它的標定,生成標定檔案及內參外參,可以將像素單位轉換為長度單位 ......

    uj5u.com 2023-04-20 07:42:17 more
  • 在MacOS下使用Unity3D開發游戲

    第一次發博客,先發一下我的游戲開發環境吧。 去年2月份買了一臺MacBookPro2021 M1pro(以下簡稱mbp),這一年來一直在用mbp開發游戲。我大致分享一下我的開發工具以及使用體驗。 1、Unity 官網鏈接: https://unity.cn/releases 我一般使用的Apple ......

    uj5u.com 2023-04-20 07:40:19 more