Skip to content
Low-level programming · Higher-level thinking
Login Register
Forum / Requests and Feedback

get entire line

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

Replies

Emil_halim member
Posts
639
Threads
104
Location
Alex, Egypt

ok got it but have this error

Ziron Compiler 1.1.27.6 Copyright (C) 2011. OverHertz Ltd. All rights reserved. -------------------------------------------- 11/7/2011 8:56:35 PM -------------------------------------------- PlugSys: Emit plugin has loaded! PlugSys: Mov plugin has loaded! -------------------------------------------- [1,14]: Expected hexadecimal or - or number or register or [expression] or procedure address or constant string or variable or local variable or local parameter or constant but found valu in [plugin buffer] Code: mov eax, valu

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

Colin admin
Posts
928
Threads
49
Location
Bulgaria

ok i've fixed 1 other bug, but this still will not solve your problem because what you are trying to do is impossible.. if you return true the assembler will move onto the next keyword from mov which is eax

Colin admin
Posts
928
Threads
49
Location
Bulgaria

look at this

function event_mov() {
	uses edi;
	char buf[2048];
	Dword Len;
       
	//assembler state: on "mov"
	
	len = Ziron_ExtractLine(@buf, 2048);	
	Ziron_ShowMessage(@buf);
	
	eax = Ziron_Execute(@buf,Len);
	if (eax == false) {
		Ziron_FatalError('Error plugin');
		return true;
	}       
	
	//returning true, which means this keyword and its parameters have been handled, we move onto next keyword
	return true;
	
	//assembler will move to eax from the line "mov eax, 10"
}

now if you return false, this will work but it means each mov will have been executed twice, once by your plugin from Ziron_Execute and once by the assembler.

Emil_halim member
Posts
639
Threads
104
Location
Alex, Egypt

i see now,

can i have a function that force Ziron to move to next keyword after i get the entire line

by Ziron_ExtractLine

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

Emil_halim member
Posts
639
Threads
104
Location
Alex, Egypt

sorry ' i am not concentrating well now ,

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

Colin admin
Posts
928
Threads
49
Location
Bulgaria

i could add a function to move to the next line, but then you may have further problems..

take this line for example:

mov eax, 10; callmyFunc(
                         'param1',
                         'param2'
             );

if someone wrote code like this your plugin would execute

mov eax, 10; callmyFunc(

which for one will cause an error, and if your plugin ignored it, then the assembler would move to the param1, and have problems :)

Emil_halim member
Posts
639
Threads
104
Location
Alex, Egypt

ok i have done it

inline procedure Ziron_GotoNextLine()
{
  eax = Ziron_IsNextLineBreak();
  while(!eax)
   {
      Ziron_GetNextToken();
      eax = Ziron_IsNextLineBreak();
   }
}


function event_mov()
{
  uses edi;
  char buf[2048];
  Dword Len;
      
  len = Ziron_ExtractLine(@buf, 2048);  
  Ziron_ShowMessage(@buf);
  
  eax = Ziron_Execute(@buf,Len);
  if (eax == false) {
    Ziron_FatalError('Error plugin');
    return true;
  }       
  
  Ziron_GotoNextLine();
 
  return true;  
}

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

Colin admin
Posts
928
Threads
49
Location
Bulgaria

i think you should still take a look at my previous post, as you may still run into this problem :)