MCPcopy Create free account
hub / github.com/ajkhoury/ReClassEx / OnMouseHover

Method OnMouseHover

ReClass/CClassView.cpp:915–1091  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

913}
914
915void CClassView::OnMouseHover( UINT nFlags, CPoint point )
916{
917 if (m_Selected.size( ) > 1)
918 {
919 CString msg;
920 DWORD size = 0;
921 for (UINT i = 0; i < m_Selected.size( ); i++)
922 size += m_Selected[i].Object->GetMemorySize( );
923 msg.Format( _T( "%i selected, %d bytes" ), m_Selected.size( ), size );
924 m_ToolTip.EnableWindow( FALSE );
925 m_ToolTip.SetWindowText( msg );
926 m_ToolTip.SetWindowPos( NULL, point.x + 16, point.y + 16, msg.GetLength( ) * g_FontWidth + 8, g_FontHeight + 6, SWP_NOZORDER );
927 m_ToolTip.ShowWindow( SW_SHOW );
928 }
929 else
930 {
931 BYTE data[16];
932 for (UINT i = 0; i < m_Hotspots.size( ); i++)
933 {
934 if (m_Hotspots[i].Rect.PtInRect( point ))
935 {
936 if (m_Hotspots[i].Type == HS_SELECT)
937 {
938 CNodeBase* pNode = (CNodeBase*)m_Hotspots[i].Object;
939 NodeType nodeType = pNode->GetType( );
940 if (nodeType == nt_functionptr)
941 {
942 if (m_Hotspots[i].Object->IsLevelOpen( m_Hotspots[i].Level ) == FALSE)
943 {
944 ULONG_PTR StartAddress = 0;
945 UCHAR Code[1024] = { 0xCC }; // set max function size to 1024] bytes
946 UIntPtr EndCode = (UIntPtr)(Code + 1024);
947 int textHeight = 0;
948 int longestLine = 0;
949 CStringA strDisassembly;
950
951 if (ReClassReadMemory( (LPVOID)m_Hotspots[i].Address, &StartAddress, sizeof( ULONG_PTR ) ) == TRUE && StartAddress != 0)
952 {
953 // Read in process bytes
954 if (ReClassReadMemory( (LPVOID)StartAddress, (LPVOID)Code, 1024 ) == TRUE)
955 {
956 DISASM MyDisasm;
957 BOOL Error = FALSE;
958
959 ZeroMemory( &MyDisasm, sizeof( DISASM ) );
960 MyDisasm.EIP = (UIntPtr)Code;
961 MyDisasm.VirtualAddr = (UInt64)StartAddress;
962 #ifdef _WIN64
963 MyDisasm.Archi = 64;
964 #else
965 MyDisasm.Archi = 0;
966 #endif
967 MyDisasm.Options = MasmSyntax | PrefixedNumeral | ShowSegmentRegs;
968
969 // Get assembly lines
970 while (Error == FALSE)
971 {
972 int disasmLen = 0;

Callers

nothing calls this directly

Calls 7

ReClassReadMemoryFunction · 0.85
DisasmClass · 0.85
GetLengthMethod · 0.80
GetTypeMethod · 0.80
IsLevelOpenMethod · 0.80
sizeMethod · 0.45
GetMemorySizeMethod · 0.45

Tested by

no test coverage detected