Valhalla Legends Forums Archive | Battle.net Bot Development | [MBNCSUtil] LoginProof

AuthorMessageTime
Homerlan
I am currently developing a C# bot using MBNCSUtil library.

Unfortunately, I'm stuck in calling LoginProof method. Actually, my problem is exactly the one described in this topic. I got a "nullReferenceException" when calling this method with valid arguments and after "LoginAccount" method call as stated in the documentation.

Here's a simplified overview of how I proceed ("A", "B" and "salt" are byte[] typed and read from the previous received packets):
[code]_nls = new NLS(_username, _password);
                       
byte[] A = new byte[33 + _username.Length];
_nls.LoginAccount(A, 0, A.Length);
_nls.LoginProof(M1, 0, 20, salt, B); // nullReferenceException here[/code]

If I rebuild and use the library according to the change suggested by MyndFyre in the previously quoted topic, I get the problem about "k" in "CalculateM1" (same as the one also described in the quoted topic).

So, I'd like to know where is my mistake in these methods calls or find a way to bypass this to make it work :D

Thanks in advance for your help ;)

PS: I used different versions of MBNCSUtil (1.3.X and the two last Beta versions).
October 19, 2007, 10:38 PM
Myndfyr
The problem is with MBNCSUtil itself.  You can download the code from the old documentation page located here to recompile it.  The problem can be fixed in one of two places:

The better place to do it is in the BigInteger class, in overloaded operator==.  Correct code is in the current beta of MBNCSUtil; you can see it here, line 722.  The alternative place to fix it is within the NLS class - do a search for "== null".  Any instances of BigInteger compared to null will generate this exception.  Replace these comparisons with object.ReferenceEquals(instanceName, null).

The preferred method is the former one - correct the operator==.  Or, use a newer version of MBNCSUtil.
October 20, 2007, 1:51 AM
Homerlan
Thanks for your reply ;)

Indeed, the correction is in the latest Beta versions (I was still including Reference of the 1.3.x version instead of Beta version actually ;D).

So, my problem changed: in this code from CalculateM1:
[code]byte[] even_hash = s_sha.ComputeHash(even_s);
byte[] odds_hash = s_sha.ComputeHash(odds_s);
byte[] local_k = new byte[bytes_s.Length];
           
for (int i = 0; i < k.Length; i++)[/code]
Here, an exception is raised, "k" variable is "null". I just checked every occurrence of this variable in NLS class and I can't find any initializations of it.
Any ideas ? ???
October 20, 2007, 9:51 AM
Myndfyr
Which version of 1.3 are you using?  I believe there were 1.3.0.6, 1.3.1.7, 1.3.1.8.  Each of these contains fixes for issues found later.

I believe I've corrected this issue once (I'd hate to see that I had regression), but I need to know which version specifically you're using.

The QFE number is incremented at every release - that's the last number in the version string.  The build number (the third item) is increased whenever a major fix or change is made (the current beta was incremented to 3 because it implemented lockdown since the original beta; the build was increased to 1 each when I implemented ver-IX86-x.dll checking).  The minor version is changed when I add new features and classes.  The major version is now changed because of major architectural changes.

So as you might imagine, the small version numbers are very important in this case.
October 20, 2007, 8:26 PM
Homerlan
Sorry for not being enough clear: for my last post (about raised exception on "k"), I was using 2.0.3.16 BETA 1 which seems to be the newest.
Should I use another one ?
October 20, 2007, 9:16 PM
Myndfyr
Ahh, now I see what you're saying.

I don't have time to correct this right now.  I have, however, set the timeline for the next release to be 10/28 - over the next week, I'll be updating the code in Subversion.  If you correct it, you're welcome to submit a .patch - I'd welcome the help - or, you can simply wait on it.  At the moment, I don't have time to determine the right way to solve it.
October 21, 2007, 2:53 AM
leax
i had the same problem back then, if u want a work around for now, just get the NLS class from JavaOP which is open sourced, compile it in J# into a dll and use that for the fix, its basically fix the calculateM1 function
October 21, 2007, 6:39 AM
Homerlan
[quote author=MyndFyre[vL] link=topic=17122.msg174046#msg174046 date=1192935233]
Ahh, now I see what you're saying.

I don't have time to correct this right now.  I have, however, set the timeline for the next release to be 10/28 - over the next week, I'll be updating the code in Subversion.  If you correct it, you're welcome to submit a .patch - I'd welcome the help - or, you can simply wait on it.  At the moment, I don't have time to determine the right way to solve it.
[/quote]
Okay, take your time :)

By the way, I basically tried to initialize "k" variable with a byte[40] (then filled with the two hashes of 20 bytes long) and I got a "Wrong password" error from Battle.net. So, there might be something else than this single initialization but I think you know it better than I do ^^

Thanks Leax for the tip, I'm gonna try to see with JavaOp NLS class :)
October 21, 2007, 9:53 AM
iNsaNe
I've had the exact same problems as you Homerlan. You're better off just using bnls
October 22, 2007, 2:14 AM
Myndfyr
[quote author=iNsaNe link=topic=17122.msg174066#msg174066 date=1193019290]
I've had the exact same problems as you Homerlan.
[/quote]

Ever consider using the "Send Comments" link?  Can't fix problems if I'm not aware of them....
October 22, 2007, 6:14 AM
iNsaNe
I was the one who made you aware of this error in the first place... this was a few months ago
October 22, 2007, 6:44 AM
leax
previous post on this topic link is at https://davnit.net/bnet/vL/index.php?topic=16670.msg171064#msg171064  if ur still interested
October 23, 2007, 3:21 AM

Search