magic/rare DWORD decoding in Classic
#24
Hi jarulf,

I just tried to use the PRNG and it always returned zero ... might it have something to do with

Quote:#pragma warning( disable : 4035 ) // avoids warning for not returning any value
__declspec( naked ) unsigned int __fastcall d2rnd(struct seeddata *ptseed, unsigned int x)
{
__asm
{
push edi;
push esi;
push ebx;
mov edi,edx;
mov esi,ecx;   // no check on pointer!!
test edi,edi;   // check if x>0
jg OK;
xor eax,eax;&nbsp;&nbsp; // return 0 if x <= 0
jmp END;
OK:

You declare x as an unsigned int but test for a negative number ?? Also, i really don't know how to read assembly but why is eax being accessed when nothing has been pushed into it?

--T

edit: Also, would you know how the 32 bit hireling ID works? Apparently, setting this to a random number and correctly setting the other parameters like experience, table index and so on will result in the first mercenary in hireling.txt being chosen with the experience you set.
Reply


Messages In This Thread
magic/rare DWORD decoding in Classic - by ldw - 02-23-2003, 12:37 PM
magic/rare DWORD decoding in Classic - by Jarulf - 02-24-2003, 09:21 AM
magic/rare DWORD decoding in Classic - by Jarulf - 02-28-2003, 09:15 AM
magic/rare DWORD decoding in Classic - by FoxBat - 03-13-2003, 04:33 PM
magic/rare DWORD decoding in Classic - by Ruvanal - 03-13-2003, 09:44 PM
magic/rare DWORD decoding in Classic - by aurikan - 03-28-2003, 02:42 AM
magic/rare DWORD decoding in Classic - by Jarulf - 03-28-2003, 09:21 AM
magic/rare DWORD decoding in Classic - by Jarulf - 03-30-2003, 08:00 PM
magic/rare DWORD decoding in Classic - by Jarulf - 04-08-2003, 09:08 PM
magic/rare DWORD decoding in Classic - by hakai_no_tenshi - 04-18-2003, 04:54 AM
magic/rare DWORD decoding in Classic - by Jarulf - 04-18-2003, 08:46 AM
magic/rare DWORD decoding in Classic - by Jarulf - 04-18-2003, 06:20 PM
magic/rare DWORD decoding in Classic - by Jarulf - 04-21-2003, 07:56 AM
magic/rare DWORD decoding in Classic - by Jarulf - 03-19-2005, 12:27 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)