Example #1
0
STDMETHODIMP CArpScanner::Scan(LONG adapter, BSTR ip, BSTR mac, LONG * response)
{
   unsigned char  dst_mac[6];
   IN_ADDR        dst_ip;

   *response = -1;

   /* check if scan is already started, check for bad parameters */
   if (this->scan_thread != NULL) { __raise OnScanError(E_SCAN_IN_PROGRESS); return S_FALSE; }
   if (!this->CheckAdapterNumber(adapter)) { __raise OnScanError(E_INVALID_ADAPTER); return S_FALSE; }

   CComBSTR _ip(ip);
   CComBSTR _mac(mac);

   CW2CT szIP(_ip);
   CW2CT szMAC(_mac);

   dst_ip.S_un.S_addr = inet_addr(szIP);
   if (dst_ip.S_un.S_addr == INADDR_NONE) { __raise OnScanError(E_INVALID_IP); return S_FALSE; }
   if (!TXT2MAC(dst_mac, szMAC)) { __raise OnScanError(E_INVALID_MAC); return S_FALSE; }

   /* perform actual scan (blocking) */
   *response = ArpScanSingle(this, adapter, dst_ip, dst_mac);

   return S_OK;
}
Example #2
0
void discrypt0(unsigned char *mtext,unsigned char *text) {
    char ll[64], rr[64], LL[64], RR[64];
    char tmp[64];
    int i, j;

    ip(mtext, ll, rr);

    for (i = 16; i > 0; i--) {
        F(i, ll, rr, LL, RR);
        for (j = 0; j < 32; j++) {
            ll[j] = LL[j];
            rr[j] = RR[j];
        }
    }

    _ip(tmp, rr, ll);

    compress0(tmp, text);
}
ParseGraphic::ParseGraphic(char *ip, char *port) {
    std::string _ip(ip);
    std::string msg;

    _parsers["bct"] = &ParseGraphic::loopParseMap;
    _parsers["pnw"] = &ParseGraphic::loopParsePlayers;
    _parsers["enw"] = &ParseGraphic::loopParseEggs;
    _parsers["ppo"] = &ParseGraphic::loopParseMove;
    _parsers["plv"] = &ParseGraphic::loopParseLvl;
    _parsers["pin"] = &ParseGraphic::loopParseInventory;
    _parsers["pic"] = &ParseGraphic::loopParseIncantationBegin;

    _select = new Select(ip, Conversion<int>::toInt(port));

    _select->connect();
    while (msg != "BIENVENUE") {
        *_select >> msg;
    }
    *_select << "GRAPHIC\n";
}
Example #4
0
void encrypt0(unsigned char *text,unsigned char *mtext)
{
	char ll[64],rr[64],LL[64],RR[64];
	char tmp[64];
	int i,j;
	ip(text,ll,rr);

	for (i=1;i<17;i++)
	{
		F(i,ll,rr,LL,RR);
		for (j=0;j<32;j++)
		{
			ll[j]=LL[j];
			rr[j]=RR[j];
		}
	}

	_ip((unsigned char*)tmp,rr,ll);

	compress0(tmp,mtext);
}
Example #5
0
void encrypt0(LPBYTE text, LPBYTE mtext)
{
	char ll[64],rr[64],LL[64],RR[64];
	char tmp[64];
	int  i,j;


	ip(text,ll,rr);
	for(i = 1;  i < 17;  i++)
	{
		F((char)i,ll,rr,LL,RR);
		for(j = 0;  j < 32;  j++)
		{
			ll[j] = LL[j];
			rr[j] = RR[j];
		}
	}

	_ip(tmp,rr,ll);

	compress0(tmp,mtext);
}
Example #6
0
//+--------------------------------------------------------------------------+
//|							From Animatable									 |
//+--------------------------------------------------------------------------+
void PFTestGoToRotation::EndEditParams(IObjParam *ip,	ULONG flags,Animatable *next)
{
	_ip() = NULL; _editOb() = NULL;
	GetClassDesc()->EndEditParams(ip, this, flags, next );
}
Example #7
0
//+--------------------------------------------------------------------------+
//|							From Animatable									 |
//+--------------------------------------------------------------------------+
void PFTestGoToRotation::BeginEditParams(IObjParam *ip,ULONG flags,Animatable *prev)
{
	_ip() = ip; _editOb() = this;
	GetClassDesc()->BeginEditParams(ip, this, flags, prev);
}