PDA

View Full Version : Oops... you're walking over your memory



Sixes
04-17-2003, 07:22 AM
That'll teach you to use literals :)

Also my compiler complains unless winsock32.h is included before stdio.h.


*** /cygdrive/c/Program Files/MySEQ/myseqserverc/myseqserverc.cpp Thu Apr 17 02:31:00 2003
--- myseqserverc.cpp Thu Apr 17 15:20:34 2003
***************
*** 1,10 ****
// myseqserverc.cpp : Defines the entry point for the console application.
//

#include <stdio.h>
#include <stdlib.h>
//#include <winsock.h>
- #include <winsock2.h>
#include <windows.h>
#include <time.h>
#include <sys/types.h>
--- 1,10 ----
// myseqserverc.cpp : Defines the entry point for the console application.
//

+ #include <winsock2.h>
#include <stdio.h>
#include <stdlib.h>
//#include <winsock.h>
#include <windows.h>
#include <time.h>
#include <sys/types.h>
***************
*** 390,396 ****
}

if (si.pNext != 0) {
! ReadProcessMemory(eqprocess, addr, &si, 364, &tmp);

}
else {
--- 390,396 ----
}

if (si.pNext != 0) {
! ReadProcessMemory(eqprocess, addr, &si, sizeof(si)-4, &tmp);

}
else {

user387
04-17-2003, 07:47 AM
line 385 contains the same error... :)

Sixes
04-17-2003, 09:01 AM
Think we may be working off different sources. I'm using 1.5b.

MrDoh
04-18-2003, 12:47 PM
I'm not really a programer, but I'm trying to learn more and more, and I don't understand this post.

Could someone point a little better at whats wrong, and what was changed to make it right, and mabe explain just a little more. Maybe something I can learn now so I avoid the problem in the future.

Thanks,
Mr. Doh

cavemanbob
04-19-2003, 12:06 PM
I'll switch the winsock2.h, never seen that one before.

The 364 is already fixed, I hate it when stuff like that slips through...

Oh and it was wrong because if the data structure size changes, that ReadMemoryProcess will be at best reading not enough data and at worst reading too much.