Skip to content
Low-level programming · Higher-level thinking
Login Register
Forum / Source Help

assignment detecting

A community discussion post from the original code:zIRON forum.

Replies

Emil_halim member
Posts
639
Threads
104
Location
Alex, Egypt

there is still something unclear here.

If i get your code well , you just extract the entire source code in strSource buffer inside

the FileEntry function.

then from where can i navigate that source code and start execute it and manipulate it ?

http://www.freewebs.com/ogremagic/index.htm

Colin admin
Posts
928
Threads
49
Location
Bulgaria

what so much is not clear, i've already told you executing line by line is not possible for what you want, so using this method you can manipulate the source:

function FileEntry(DWord handle; char* code) {
  uses edi;
  m_strFill(strSource, 1, 0); //set first character as null so we can re-use for strAppend
  
  //your usual code here
  char tmp[2048];
 
  edi = strGetLine(code, @tmp);
  while(edi <> 0) {
    Ziron_ShowMessage(@tmp);

    //do some changes to line @tmp (which will be emitted to strSource
    
    emitLine(@tmp);
    edi = strGetLine(edi, @tmp);
  }  
  
  //update the internal buffer, so Ziron can handle this file with updates
  Ziron_SetFileBuffer(handle, strSource, strLen(strSource));
}
Emil_halim member
Posts
639
Threads
104
Location
Alex, Egypt

I have tested it and found that , the function emitLine casues access violation in plugin.

I think strAppend or strlcpy has some problem , see post #[1095].

http://www.freewebs.com/ogremagic/index.htm

Colin admin
Posts
928
Threads
49
Location
Bulgaria

bare in mind the function emitLine i just wrote without any testing and so on, but you can try disable mmx and sse to see if it works

just after program declaration:

program WIN....etc

#sse off;
#mmx off;
Emil_halim member
Posts
639
Threads
104
Location
Alex, Egypt

i know that , you just give an idea and did not test the code.

still crash after disable the MMX & SSE.

BTW , does strAppend test the length of destination buffer , and test the amount of bytes ,

not the entire length of buffer , against the length of appended string?

http://www.freewebs.com/ogremagic/index.htm

Emil_halim member
Posts
639
Threads
104
Location
Alex, Egypt

ok , so where coude be the problem here?

http://www.freewebs.com/ogremagic/index.htm

Colin admin
Posts
928
Threads
49
Location
Bulgaria

OK just an update for you, i've almost fixed the problem, first issue was add var, value had a small bug, but now i search for source problem.