Pedro250 Posted July 13, 2011 Share Posted July 13, 2011 (edited) ... Edited April 24, 2012 by Pedro250 Link to comment Share on other sites More sharing options...
Kaphotics Posted July 13, 2011 Share Posted July 13, 2011 ccitt-16, I don't know any coding languages so that's the most I can help. Link to comment Share on other sites More sharing options...
evandixon Posted July 14, 2011 Share Posted July 14, 2011 @Pedro250: Just curious, what language are you planning on writing your editor in? Link to comment Share on other sites More sharing options...
Pedro250 Posted July 14, 2011 Author Share Posted July 14, 2011 in Visual.NET (Using Visual Basic 2008). The base code (the open and reading/write parts) is already done, it uses a code similar to the one of my evolution editor. I just need a checksum fix code and its done. Link to comment Share on other sites More sharing options...
Pedro250 Posted July 15, 2011 Author Share Posted July 15, 2011 Hi again, In the Project Wikia there is a method of Checksum calculation, but don't know what language is it wrote, maybe someone can help me converting it to .net language? Thanks The link is http://www.projectpokemon.org/wiki/Pok%C3%A9mon_NDS_Save_File_Checksum Link to comment Share on other sites More sharing options...
evandixon Posted July 15, 2011 Share Posted July 15, 2011 (edited) Hi again,In the Project Wikia there is a method of Checksum calculation, but don't know what language is it wrote, maybe someone can help me converting it to .net language? Thanks The link is http://www.projectpokemon.org/wiki/Pok%C3%A9mon_NDS_Save_File_Checksum It looks like C or C++. It might be similar enough to C#, but I'm not sure... Edited July 16, 2011 by evandixon typo Link to comment Share on other sites More sharing options...
Kyogre1 Posted July 15, 2011 Share Posted July 15, 2011 Umm, if you know how to code, the programming language of example code shouldn't matter. :confused: It's C# by the way. Link to comment Share on other sites More sharing options...
codemonkey85 Posted July 16, 2011 Share Posted July 16, 2011 I'm not 100% sure, but I believe the checksum calculation for Black & White is different than the Gen IV games. So I don't think that page is going to help... At any rate, here is the code I've been using for DPPt & HGSS: Private Function GetSeeds() As Integer seeds = New Integer(&H100 - 1) {} Dim v0 As Integer = 0 Dim v1 As Integer Dim v2 As Integer Dim result As Integer Do v1 = v0 << 8 v2 = 0 Do If (CType(v1 >> 8, [byte]) And &H80) <> 0 Then v1 = (2 * v1) Xor &H1021 Else v1 *= 2 End If v2 += 1 Loop While v2 < 8 result = CUShort(v1) seeds(v0) = result v0 += 1 Loop While v0 <= &HFF Return result End Function Public Sub FixBlockChecksum(ByVal Block As mDPGeneralBlock) Block.Footer.Checksum = SaveBlockChecksums(Block) End Sub Public Sub FixBlockChecksum(ByVal Block As mDPStorageBlock) Block.Footer.Checksum = SaveBlockChecksums(Block) End Sub Public Sub FixBlockChecksum(ByVal Block As mDPHallOfFameBlock) Block.Footer.mChecksum = SaveBlockChecksums(Block) End Sub Private Function SaveBlockChecksums(ByVal Block As mDPGeneralBlock) As UShort GetSeeds() Dim Data() As Byte = RawSerialize(Block) Dim v2 As Integer = &HFFFF Dim i As Integer Dim v4 As Integer = Block.Footer.Size - &H14 Dim v6 As Byte i = 0 Do While v4 > 0 v4 -= 1 v6 = CType(Data(i) Xor CType(v2 >> 8, [byte]), [byte]) v2 = (v2 << 8) Xor seeds(v6) i += 1 Loop Return CUShort(v2) End Function Private Function SaveBlockChecksums(ByVal Block As mDPStorageBlock) As UShort GetSeeds() Dim Data() As Byte = RawSerialize(Block) Dim v2 As Integer = &HFFFF Dim i As Integer Dim v4 As Integer = Block.Footer.Size - &H14 Dim v6 As Byte i = 0 Do While v4 > 0 v4 -= 1 v6 = CType(Data(i) Xor CType(v2 >> 8, [byte]), [byte]) v2 = (v2 << 8) Xor seeds(v6) i += 1 Loop Return CUShort(v2) End Function Private Function SaveBlockChecksums(ByVal Block As mDPHallOfFameBlock) As UShort GetSeeds() Dim Data() As Byte = RawSerialize(Block) Dim v2 As Integer = &HFFFF Dim i As Integer Dim v4 As Integer = Block.Footer.Size - &H18 Dim v6 As Byte i = 0 Do While v4 > 0 v4 -= 1 v6 = CType(Data(i) Xor CType(v2 >> 8, [byte]), [byte]) v2 = (v2 << 8) Xor seeds(v6) i += 1 Loop Return CUShort(v2) End Function FYI, RawSerialize just turns a data structure into a byte array. I'm not sure how you're working with your data, but I'm guessing you're already using it as a byte array. Link to comment Share on other sites More sharing options...
Pedro250 Posted July 16, 2011 Author Share Posted July 16, 2011 I'm not 100% sure, but I believe the checksum calculation for Black & White is different than the Gen IV games. So I don't think that page is going to help...At any rate, here is the code I've been using for DPPt & HGSS: Private Function GetSeeds() As Integer seeds = New Integer(&H100 - 1) {} Dim v0 As Integer = 0 Dim v1 As Integer Dim v2 As Integer Dim result As Integer Do v1 = v0 << 8 v2 = 0 Do If (CType(v1 >> 8, [byte]) And &H80) <> 0 Then v1 = (2 * v1) Xor &H1021 Else v1 *= 2 End If v2 += 1 Loop While v2 < 8 result = CUShort(v1) seeds(v0) = result v0 += 1 Loop While v0 <= &HFF Return result End Function Public Sub FixBlockChecksum(ByVal Block As mDPGeneralBlock) Block.Footer.Checksum = SaveBlockChecksums(Block) End Sub Public Sub FixBlockChecksum(ByVal Block As mDPStorageBlock) Block.Footer.Checksum = SaveBlockChecksums(Block) End Sub Public Sub FixBlockChecksum(ByVal Block As mDPHallOfFameBlock) Block.Footer.mChecksum = SaveBlockChecksums(Block) End Sub Private Function SaveBlockChecksums(ByVal Block As mDPGeneralBlock) As UShort GetSeeds() Dim Data() As Byte = RawSerialize(Block) Dim v2 As Integer = &HFFFF Dim i As Integer Dim v4 As Integer = Block.Footer.Size - &H14 Dim v6 As Byte i = 0 Do While v4 > 0 v4 -= 1 v6 = CType(Data(i) Xor CType(v2 >> 8, [byte]), [byte]) v2 = (v2 << 8) Xor seeds(v6) i += 1 Loop Return CUShort(v2) End Function Private Function SaveBlockChecksums(ByVal Block As mDPStorageBlock) As UShort GetSeeds() Dim Data() As Byte = RawSerialize(Block) Dim v2 As Integer = &HFFFF Dim i As Integer Dim v4 As Integer = Block.Footer.Size - &H14 Dim v6 As Byte i = 0 Do While v4 > 0 v4 -= 1 v6 = CType(Data(i) Xor CType(v2 >> 8, [byte]), [byte]) v2 = (v2 << 8) Xor seeds(v6) i += 1 Loop Return CUShort(v2) End Function Private Function SaveBlockChecksums(ByVal Block As mDPHallOfFameBlock) As UShort GetSeeds() Dim Data() As Byte = RawSerialize(Block) Dim v2 As Integer = &HFFFF Dim i As Integer Dim v4 As Integer = Block.Footer.Size - &H18 Dim v6 As Byte i = 0 Do While v4 > 0 v4 -= 1 v6 = CType(Data(i) Xor CType(v2 >> 8, [byte]), [byte]) v2 = (v2 << 8) Xor seeds(v6) i += 1 Loop Return CUShort(v2) End Function FYI, RawSerialize just turns a data structure into a byte array. I'm not sure how you're working with your data, but I'm guessing you're already using it as a byte array. Thanks a lote, i will check on this. I am hex editing the data, but i am thinking in change the data management , hex editing brings a lot of problems, so it's ok. Thanks again Link to comment Share on other sites More sharing options...
Codr Posted July 16, 2011 Share Posted July 16, 2011 Instead of asking for someone else to do the work for you, why don't you try to understand it yourself and ask questions specific to what you don't understand? If you don't understand ANY of it, you probably shouldn't be trying to do it anyway. Link to comment Share on other sites More sharing options...
Pedro250 Posted July 16, 2011 Author Share Posted July 16, 2011 Instead of asking for someone else to do the work for you, why don't you try to understand it yourself and ask questions specific to what you don't understand? If you don't understand ANY of it, you probably shouldn't be trying to do it anyway. Codr, not trying to start a fight or anything but i made both 4º gen and 5º gen evolution editor (along with allot more non-pokemon related programs), i know how to do this things I am more directed to ROM editing, not SAVE editing OK? Everyone starts some way, you start your way, i star mine. If you don't want to help, don't criticize, if you want to help, just help. Thanks Link to comment Share on other sites More sharing options...
Codr Posted July 16, 2011 Share Posted July 16, 2011 if you want to help, just help. How does someone do that without doing all the work for you? You're not giving someone a starting point. You're not asking questions. You just want it done, which is equivalent to begging. Since you obviously misinterpreted my last post, let me make it clear that the post wasn't made in an attempt to elicit negative emotions from you. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now