Bvural41 1
Bvural41
ShadowFon 1
ShadowFon
mavzermete 1
mavzermete
YazilimMühendisi 1
YazilimMühendisi
Fethi Polat 1
Fethi Polat
InfernoShade 1
InfernoShade
Hikaye Ekle

Python Auto Patcher V2

  • Konuyu başlatan Konuyu başlatan Koray'
  • Başlangıç tarihi Başlangıç tarihi
  • Cevaplar Cevaplar 26
  • Görüntüleme Görüntüleme 4K

HERAKLES Otomatik Avlı kalıcı sunucu. 19 Haziran'da açılıyor. Atius & Wizard güvencesiyle hemen kayıt ol, ön kayıt ödülleri aktif. HEMEN TIKLA!

Sade ve hoş :)
 
Hayat Hiç Beklemediğin Bir Anda Tam Arkandan Bir Hamle Yapar Ve Tüm Dünyan Alt Üst Olur O Zaman Ayakta Kalabiliyorsan Sen Kendinin Kahramanısındır
 
Arkadaşlar bazı kişiler encryptli introPatch.py dosyasının içeriğini merak etmiş olabilir diye paylaşıyorum, Pashe37 gibi python coder arkadaşlar geliştirsin diye:

import ui
import wndMgr
import dbg
import urllib
import patcherSettings
import os
import sha
import string
import dbg
import thread
import app

fileName = ""
fileHash = ""
fileSize = ""
actualFile = 0
fullyDownLoaded = 0.000000
fullFiles = 0.000000
allFiles = 0

class PatcherDialog(ui.ScriptWindow):

def __init__(self):
ui.ScriptWindow.__init__(self)
self.CreateDialog()

def __del__(self):
ui.ScriptWindow.__del__(self)

def Destroy(self):
self.Hide()
return TRUE

def CreateDialog(self):
self.Board = ui.Board()
self.Board.SetSize(293, 160)
self.Board.SetCenterPosition()
self.Board.SetTop()
self.Board.AddFlag("float")

self.patcherTitle = ui.TextLine()
self.patcherTitle.SetParent(self.Board)
self.patcherTitle.SetDefaultFontName()
self.patcherTitle.SetPosition(95, 10)
self.patcherTitle.SetFeather()
self.patcherTitle.SetText(patcherSettings.patcherTitle)
self.patcherTitle.SetFontColor(0.1, 0.7, 1)

self.GaugeWindow = ui.Window()
self.GaugeWindow.SetParent(self.Board)
self.GaugeWindow.SetPosition(0, 10)
self.GaugeWindow.SetSize(95, 22)

self.actualFile = ui.TextLine()
self.actualFile.SetParent(self.Board)
self.actualFile.SetDefaultFontName()
self.actualFile.SetPosition(20, 40)
self.actualFile.SetFeather()
self.actualFile.SetText("Aktuelle Datei: \"KEINE\"")

self.progressBarActualFile = ui.AniImageBox()
self.progressBarActualFile.SetParent(self.GaugeWindow)
self.progressBarActualFile.AppendImage("pbar.tga")
self.progressBarActualFile.SetPosition(20, 50)
self.progressBarActualFile.SetDelay(6)
self.progressBarActualFile.SetPercentage(0, 100)

self.allFiles = ui.TextLine()
self.allFiles.SetParent(self.Board)
self.allFiles.SetDefaultFontName()
self.allFiles.SetPosition(20, 90)
self.allFiles.SetFeather()
self.allFiles.SetText("Gesamt Fortschritt:")

self.progressBarFull = ui.ExpandedImageBox()
self.progressBarFull.SetParent(self.GaugeWindow)
self.progressBarFull.LoadImage(patcherSettings.progressBar)
self.progressBarFull.SetPosition(20, 100)
self.progressBarFull.SetPercentage(0, 100)

self.copyRight = ui.TextLine()
self.copyRight.SetParent(self.Board)
self.copyRight.SetDefaultFontName()
self.copyRight.SetPosition(20, 135)
self.copyRight.SetFeather()
self.copyRight.SetText("© by CranK™ REV: PPA1")
self.copyRight.SetFontColor(0.1, 0.7, 1)

def GetClientVersion(self):
version = urllib.urlopen(patcherSettings.versionUrl).read()
return version

def SetPercentage(self, curPoint, maxPoint):
curPoint = min(curPoint, maxPoint)
if maxPoint > 0:
self.progressBarActualFile.SetPercentage(curPoint, maxPoint)

def SetPercentageFull(self, percentage):
self.progressBarFull.SetPercentage(100*(percentage / 100), 100)

def Show(self):
self.Board.Show()
self.GaugeWindow.Show()
self.progressBarActualFile.Show()
self.patcherTitle.SetOutline()
self.patcherTitle.Show()
self.actualFile.SetOutline()
self.actualFile.Show()
self.allFiles.SetOutline()
self.allFiles.Show()
self.progressBarFull.Show()
self.copyRight.SetOutline()
self.copyRight.Show()
self.LoadPatchList()

def CheckFile(self, fileName, fileHash, fileSize):
if os.path.exists(fileName):
f = open(fileName, 'rb')
data = f.read()
f.close()
sha1 = sha.new()
sha1.update(data)
hash = self.hexstr(sha1.digest())
if fileHash.find(hash) != -1:
if int(fileSize) == len(data):
return "actual"
else:
return "outdated"
else:
return "outdated"
else:
return "outdated"

def hexstr(self, s):
h = string.hexdigits
r = ''
for c in s:
i = ord(c)
r = r + h[(i >> 4) & 0xF] + h[i & 0xF]
return r

def LoadPatchList(self):
global fileName
global fileSize
global fileHash
global fullFiles
#global allFiles
global actualFile, allFiles
patchListWeb = urllib.urlopen(patcherSettings.patchListUrl).read()
patchList = patchListWeb.split("\n")

for i in xrange(len(patchList)):
if patchList.split("|")[0] != "":
fileName += patchList.split("|")[0] + "|"

if patchList.split("|")[1] != "":
fileHash += patchList.split("|")[1] + "|"

if patchList.split("|")[2] != "":
fileSize += patchList.split("|")[2] + "|"

fullFiles += float(patchList.split("|")[2])

allFiles = len(patchList)# - 1
thread.start_new_thread(self.Download, ())

#while self.Board.IsShow():
# if actualFile == allFiles + 1:
# app.Exit()

def BatchFile(self, copyFileName, pasteFileName):
batchFile = open("patcher.bat", 'a')
batchFile.write("if exist \"%s\" ( del \"%s\" )\n" % (pasteFileName, pasteFileName))
batchFile.write("move \"%s\" \"%s\"\n" % (copyFileName, pasteFileName))
batchFile.close()

def ExitApp(self):
app.Exit()

def Download(self):
global fileName
global fileSize
global fileHash
global fullFiles
global allFiles
global fullyDownLoaded
global actualFile
open("patcher.bat", "w").write("")
while actualFile <= allFiles:
if actualFile == allFiles:
actualFile += 1
batchFile = open("patcher.bat", 'a')
batchFile.write("start %s\n" % (patcherSettings.binName))
batchFile.write("del patcher.bat\n")
batchFile.close()
os.system("patcher.bat")
os._exit(0)

if actualFile == 0:
batchFile1 = open("patcher.bat", 'a')
batchFile1.write("timeout 2\n")
batchFile1.close()

if len(fileName.split("|")[actualFile]) > 0:
if actualFile <= allFiles:
if self.CheckFile(fileName.split("|")[actualFile], fileHash.split("|")[actualFile], fileSize.split("|")[actualFile]).find("outdated") != -1:
url = (patcherSettings.patchFolderUrl + fileName.split("|")[actualFile]).replace(" ", "%20")
if fileName.split("|")[actualFile] != "":
self.actualFile.SetText("Aktuelle Datei: \"%s\"" % (fileName.split("|")[actualFile]))
else:
self.actualFile.SetText("Patchvorgang abgeschlossen")
u = urllib.urlopen(url)
f = open(fileName.split("|")[actualFile] + ".temp", 'wb')
meta = u.info()
file_size = int(meta.getheaders("Content-Length")[0])
file_size_dl = 0
block_sz = 8192
while file_size_dl <= file_size:
buffer = u.read(block_sz)
if not buffer:
break

file_size_dl += len(buffer)
self.SetPercentage(file_size_dl, file_size)
fullyDownLoaded += float(len(buffer))
self.SetPercentageFull((fullyDownLoaded / fullFiles)*100)
f.write(buffer)

f.close()
self.actualFile.SetText("\"%s\" wurde Fertig geladen" % (fileName.split("|")[actualFile]))
if len(fileName.split("|")[actualFile]) > 0:
self.BatchFile(os.getcwd() + "\\" + fileName.split("|")[actualFile].replace("/", "\\") + ".temp", os.getcwd() + "\\" + fileName.split("|")[actualFile].replace("/", "\\"))
actualFile += 1
else:
self.actualFile.SetText("\"%s\" ist aktuell" % (fileName.split("|")[actualFile]))
fullyDownLoaded += float(fileSize.split("|")[actualFile])
self.SetPercentageFull((fullyDownLoaded / fullFiles)*100)
actualFile += 1
else:
thread.exit()

def Close(self):
self.Destroy()
 
guzel olmus.
 

Şu an konuyu görüntüleyenler (Toplam : 0, Üye: 0, Misafir: 0)

Geri
Üst