access violation in FileEntry
hi
when trying to get each line from code buffer in FileEntry function i got access violation.
here is the FileEntry code
function H_GetNextLine(char* strbuf; pointer dest)
{
global int32 incr;
uses esi edi;
eax = xor;
ecx = incr;
esi = strbuf;
add esi, ecx
edi = dest;
while(char[esi] != 0)
{
if (word[esi] == "\r\n")
{
eax += 2;
break;
}
bl = char[Esi];
char[edi] = bl;
eax++;
esi++;
edi++;
}
char[edi] = 0;
add ecx, eax
incr = ecx;
}
procedure FileEntry(DWord handle; char* strCode) {
eax = strOffset(strCode, '.DATA');
while (char[eax] <> 0) {
char[eax] = "_";
eax = strOffset(eax, '.DATA');
}
eax = strOffset(strCode, '.CODE');
while (char[eax] <> 0) {
char[eax] = "_";
eax = strOffset(eax, '.CODE');
}
char* tmp[1024];
push edi
edi = H_GetNextLine(strCode,tmp);
while(edi > 0)
{
edi = H_GetNextLine(strCode,tmp);
}
pop edi
}
http://www.freewebs.com/ogremagic/index.htm