I've tried both ways.Quote:
If you can't call the DLL. Add the functions to your C# code.
Code:static long holdrand = 1L; void srand(unsigned int seed) { holdrand = (long) seed; } int rand() { return (((holdrand = holdrand * 214013L + 2531011L) >> 16) & 0x7fff); }
using the dll as an added reference you CAN do msvcrt.msvcrt.srand/rand. It's how it works in immune's source and the way I did it with my last test source.
It causes the same problem if I use a dll import + function for it as well. Hell, I don't even have to call ANY of the functions and the error happens... no clue why :S
here's a copy of the VERY basic test bed I was using (it has nothing added or finished so not like nubs are gonna use it to get very far lol)
[Only registered and activated users can see links. Click Here To Register...]
<edit>
sorry, re-read what you said and yes.. I can call them (either via dllimport or referencing the dll...) but the problem is that I'm getting the error OUTSIDE of when I'm actively invoking them (it has nothing to do with rand or srand... I'm guessing it's hybrid's dll using memcpy)
<edit x2>
yes... memcpy seems to be part of hybrids socket system (checked the 5018 version of it as easy reference)
Very strange... it only seems to be happening now even though I haven't really changed much.