Register | Login
Forum Index > Requests and Feedback > data section.
Author Message
Pages: 1 2 3 4 5 6 7 8 9 10 11
Emil_halim
Ziron Beta Tester

avatar

(send private message)

Posts: 639
Topics: 104

Location:
Alex, Egypt
[620] - posted: 2011-11-11 21:53:25
as i said before, the main file handle might not be 0


is that makes Ziron_ShowMessage does not show any thind at all?

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

avatar

(send private message)

Posts: 933
Topics: 55

Location:
OverHertz Studio
[621] - posted: 2011-11-11 21:54:24
well since your showmessage is inside the if block, if there is no string to show, then nothing will be shown.

Download Ziron
Get free hosting for Ziron related fan-sites and Ziron projects, contact me in private message.
Emil_halim
Ziron Beta Tester

avatar

(send private message)

Posts: 639
Topics: 104

Location:
Alex, Egypt
[622] - posted: 2011-11-11 21:57:05
ok , this also does not change any thing
Code:
function FileEntry(DWord handle; char* strCode)
{   
   //preprocess the main file
   if (handle == 0)
    {       
      esi = strCode;
      esi = strOffset(esi, '.DATA');
      while (char[esi] != 0)
       {
           char[esi] = "_";
           esi = strOffset(esi, '.DATA');
       }
    }
}


http://www.freewebs.com/ogremagic/index.htm
Emil_halim
Ziron Beta Tester

avatar

(send private message)

Posts: 639
Topics: 104

Location:
Alex, Egypt
[623] - posted: 2011-11-11 22:00:20

ok , ok , if i remember well , you said that if (handle == 0) return main file?

http://www.freewebs.com/ogremagic/index.htm
Emil_halim
Ziron Beta Tester

avatar

(send private message)

Posts: 639
Topics: 104

Location:
Alex, Egypt
[624] - posted: 2011-11-11 22:02:19

this is post #[283]

http://http://www.codeziron.com/forum.php?page=topic&id=60

Code:
function FileEntry(DWord handle; char* strCode) {
  const maxLen = 512;
  
  //create a buffer
  char myBuffer[maxLen];
  
  if (handle == 0) {
    strlcpy(@myBuffer, 'program WIN32CUI \'test\'; #include \'console.zir\'; print(\'hello world!\r\n\'); wait_key(nil); ExitProcess(0);', 104);
  
    //set the buffer
    Ziron_SetFileBuffer(handle, @myBuffer, 104);
  }  
}


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

avatar

(send private message)

Posts: 933
Topics: 55

Location:
OverHertz Studio
[625] - posted: 2011-11-11 22:07:53
in that post, it was sample, that i knew would work, but 0 may not always be the main file, however it is best not to just process the main file, but all since some people may split their projects into many files, anyways i've just found another bug relating to this that is causing a problem... i will fix upload then post sample.

Download Ziron
Get free hosting for Ziron related fan-sites and Ziron projects, contact me in private message.
Admin
Site Admin

avatar

(send private message)

Posts: 933
Topics: 55

Location:
OverHertz Studio
[626] - posted: 2011-11-11 22:10:59
ok i've updated the beta package with the fix, and here is test code for you:

Code:
procedure FileEntry(DWord handle; char* strCode) {
  eax = strOffset(strCode, '.DATA');
  while (char[eax] <> 0) {
    char[eax] = "_";
    eax = strOffset(eax, '.DATA');
  }
}


this code will definitely work.

Download Ziron
Get free hosting for Ziron related fan-sites and Ziron projects, contact me in private message.
Emil_halim
Ziron Beta Tester

avatar

(send private message)

Posts: 639
Topics: 104

Location:
Alex, Egypt
[627] - posted: 2011-11-11 22:20:21

oh , no i got access violation with testprog

Code:
//******************************************************//
//                                                      //
//                                                      //
//                 Masm plugin                          //
//               By  Emil Halim                         //
//                 11/11/2011                           //
//                                                      //
//******************************************************//

plugins off;

program WIN32DLL 'Masm PLUGIN';

#include 'zirplug/framework.zir';
#include 'strings.zir'
#include 'smm32.zir';

//////////////////////////////

const strLoaded = 'Masm plugin has loaded!';

//////////////////////////////


//
// event_Data()
// return false to allow the assembler to process this keyword internally.
// return true to tell the assembler this keyword has been processed.
//
function event_Data() {
  uses edi;
  char buf[2048];
  char var[255];
  char str1[255];
  boolean Flg = true;  
  
  if(Flg)
   {
            
      return true;
   }
  else
   {   
      return false;                           // let Ziron handle the line  
   }  
}

function FileEntry(DWord handle; char* strCode)
{   
   eax = strOffset(strCode, '.DATA');
   while (char[eax] <> 0) {
      char[eax] = "_";
      eax = strOffset(eax, '.DATA');
   }
}

function InitPlugin(pointer pGetF) {
  Ziron_LoadAll(pGetF); //use framework utility function to load all

  //register our keyword
  Ziron_RegisterKeyword('_Data', @event_Data);
  
  return strLoaded;
}

entry function DLLMain(DWord iDLL; DWord iReason; Pointer iResult) {
  if (iReason == DLL_PROCESS_ATTACH) {
    return true;
  }

  return false;
}

exports InitPlugin, FileEntry;


http://www.freewebs.com/ogremagic/index.htm
Pages: 1 2 3 4 5 6 7 8 9 10 11
create new reply


Quick reply:

Message:



Currently Active Users:
There are currently 14 user(s) online. 0 member(s) and 14 guest(s)
Most users ever online was 1046, January 28, 2022, 2:08 pm.


Statistics:
Threads: 225 | Posts: 1848 | Members: 51 | Active Members: 51
Welcome to our newest member, yecate
const Copyright = '2011-2024 © OverHertz Ltd. All rights reserved.';
Web development by OverHertz Ltd