Posted October 3, 201014 yr I am having problems converting this coding form C to Delphi./>http://forum.tuts4you.com/index.php?showtopic=16209&view=findpost&p=81108char* szMemDump = (char*)malloc(mbi.RegionSize+1);malloc is ok. But I don't what's with all the "char*".if( memcmp( (void*)(szMemDump+x), (void*)szBytes, strlen( szBytes ) ) == 0 )I just cannot sum both szMemDump and x together?
October 3, 201014 yr 1) C is quite strict on variable types, Delphi usually is more relaxed.var szMemDump : pointer;szMemDump := malloc(mbi.RegionSize+1);2) if memcmp(pointer(dword(szMemDump)+x), szBytes, strlen(szBytes)) = 0 thenAnyway, I would suggest that you do not convert the code literally, instead think what the C code does and write new code using Delphi functions (eg. GetMem instead on malloc, CompareMem instead of memcmp, Length instead of strlen).
Create an account or sign in to comment