Register | Login
Forum Index > Bugs and Fixes > Masm Plugin in c crash
Author Message
Pages: 1
Emil_halim
Ziron Beta Tester

avatar

(send private message)

Posts: 639
Topics: 104

Location:
Alex, Egypt
[728] Masm Plugin in c crash - posted: 2011-11-18 15:54:50

hi this code of plugin makes ziron.exe it self crashed.
Code:
/****************************************************************************
 *                                                                          *
 *                                                                          *
 ****************************************************************************/

#define WIN32_LEAN_AND_MEAN  /* speed up */
#include <windows.h>

#include "framework.h"
#include "ZIRPLUGIN.h"


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

char* strLoaded = "Masm plugin written with C.";

//////////////////////////////
 
//
// event_Data()
// return false to allow the assembler to process this keyword internally.
// return true to tell the assembler this keyword has been processed.
//
BOOL __stdcall  event_Data(void) 
{
      Ziron_ShowMessage("hellow from plugin written with C.");
      return TRUE;
}

void __stdcall FileEntry(DWORD handle, char* strCode) 
{
     char* addr = strstr(strCode, ".DATA");
     while (*addr != 0)
      {
            *addr = '_';
            addr = strstr(addr, ".DATA");
      }
     
     addr = strstr(strCode, ".CODE");
     while (*addr != 0) 
      {
            *addr = '_';
            addr = strstr(addr, ".CODE");
      }
}

char* __stdcall InitPlugin(void* pGetF)
{
  Ziron_LoadAll(pGetF); //use framework utility function to load all
  //register our keyword
  Ziron_RegisterKeyword("_Data", event_Data);
  return strLoaded;
}

BOOL APIENTRY DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpvReserved)
{
   
    /* Return success */
    return TRUE;
}


when comment Ziron_RegisterKeyword function the crashed take place in the plugin itself.

the test program is
Code:
program WIN32CUI 'Masm Syntax test';

#include 'console.zir';


.DATA 
{

var      DB 0x0f 
vv       Db 1 
ar1      DB ?  
ar2      DB 0 

ml       db 0 , 1 , 100
}

wait_key(nil);
ExitProcess(0);


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

avatar

(send private message)

Posts: 933
Topics: 55

Location:
OverHertz Studio
[729] - posted: 2011-11-18 16:33:17
Unfortunately i won't be able to help debug plug-ins that are written in other languages - since i need to step through the code with ziron assembler to find ziron bugs/errors.

Download Ziron
Get free hosting for Ziron related fan-sites and Ziron projects, contact me in private message.
Pages: 1
create new reply


Quick reply:

Message:



Currently Active Users:
There are currently 10 user(s) online. 0 member(s) and 10 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