Emil_halim
member
Posts
639
Threads
104
Location
Alex, Egypt
Post #1080
2012-05-12 21:44:03 UTC
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
Post #1082
2012-05-12 22:44:10 UTC
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
Post #1101
2012-05-14 20:38:39 UTC
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
Post #1102
2012-05-14 21:48:21 UTC
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
Post #1103
2012-05-14 22:01:28 UTC
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
Colin
admin
Posts
928
Threads
49
Location
Bulgaria
Post #1104
2012-05-14 23:48:28 UTC
I'm pretty sure strAppend is fine, see this post: http://www.codeziron.com/forum.php?page=topic&id=63#post345
i've double checked and there is no problems.
Emil_halim
member
Posts
639
Threads
104
Location
Alex, Egypt
Post #1106
2012-05-15 18:59:22 UTC
ok , so where coude be the problem here?
http://www.freewebs.com/ogremagic/index.htm
Colin
admin
Posts
928
Threads
49
Location
Bulgaria
Post #1108
2012-05-15 20:08:36 UTC
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.