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

scan the entire source file

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

Emil_halim member
Posts
639
Threads
104
Location
Alex, Egypt

scan the entire source file

Hi

i need Little example that shoing me how to scan the entire source code and how to make a changes in lt ,also return the changed code to Ziron.

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

Replies

Colin admin
Posts
928
Threads
49
Location
Bulgaria

Grab the latest release.

procedure ZIRON_API onFileEntry(DWord handle; char* pCode; DWord len): boolean;

This event is called on each file that is entered (similar to Ziron 1)

A new function I just added.

function* ZIRON_API ziron_file_setbuffer(DWord filehd; char* buf; DWord len): boolean;

using onFileEntry, you can read the code from pCode buffer, create your own buffer with your new code, and then call ziron_file_setbuffer, with the file handle, a pointer to your new buffer with length, Ziron will update the internal buffer with your new code.

Hope this helps.

Emil_halim member
Posts
639
Threads
104
Location
Alex, Egypt

nice work Mr Colin.

thank you.

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

Emil_halim member
Posts
639
Threads
104
Location
Alex, Egypt

Mr Colin

what is wrong wti this code

function stdcall onFileEntry(DWord handle; char* strCode; DWord len) {
  
     uses edi;
     
     char  line[2048];
     char* ptr;
     dword buf;
      
     buf =  GlobalAlloc(GPTR , 2 * len);
     
     esi = strCode;
     edi = @line;
     while( char[esi] <> 10) 
      {
         char[edi++]=char[esi++];
      }  
     
    
    ziron_log_messageA('', false);
    
    ziron_file_setbuffer(handle, buf, strlen(buf));
    
    GlobalFree(buf);
     
    return true;
}

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

Colin admin
Posts
928
Threads
49
Location
Bulgaria

2 * len

char [edi++]

both are not accepted at current.

Emil_halim member
Posts
639
Threads
104
Location
Alex, Egypt

ok , when they will be okay.

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

Colin admin
Posts
928
Threads
49
Location
Bulgaria

Since 2 * len is classed as a complex expression (would require additional assembly), it is unlikely to be supported, however reg++ I will add on my todo list.

Emil_halim member
Posts
639
Threads
104
Location
Alex, Egypt
Since 2 * len is classed as a complex expression (would require additional assembly), it is unlikely to be supported

why , if you had seen Sphinx C-- , it is suports complex expresion in the same time user can make his low level expresion , alse

it supportes float point expresion.

you may add that as a plugin for complex expresion.

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