-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
100 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
Imports System.IO | ||
|
||
Partial Public Class BuildData | ||
Public Function WriteChecksum() As Boolean | ||
'ConnectKey | ||
Dim mapstream As New FileStream(pjData.SaveMapName, FileMode.Open) | ||
Dim br As New BinaryReader(mapstream) | ||
Dim bw As New BinaryWriter(mapstream) | ||
|
||
|
||
Dim buffer As Byte() | ||
|
||
|
||
br.ReadUInt32() '이름 | ||
br.ReadUInt32() '헤더길이 | ||
Dim fileSize As UInteger = br.ReadUInt32() 'mpq길이 | ||
|
||
|
||
mapstream.Position = 0 | ||
buffer = br.ReadBytes(fileSize) | ||
|
||
|
||
Dim crc32 As New CRC32 | ||
Dim checksumv As UInteger = crc32.GetCRC32(Buffer) | ||
|
||
|
||
'MsgBox(mapstream.Position & "," & mapstream.Length) | ||
Dim checkstring As String = AESModule.EncryptString128Bit(checksumv, ConnectKey) | ||
MsgBox(checkstring & "," & ConnectKey) | ||
|
||
bw.Write(checkstring) | ||
|
||
|
||
br.Close() | ||
bw.Close() | ||
mapstream.Close() | ||
|
||
|
||
Return True | ||
End Function | ||
End Class |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters