GH*master Expert Cheater
  Reputation: 8
  Joined: 10 Jan 2008 Posts: 159
 
  | 
		
			
				 Posted: Wed Jun 12, 2019 12:58 pm    Post subject: executeCodeLocal "BitBlt" not working | 
				       | 
			 
			
				
  | 
			 
			
				Issue about call blit
 
 	  | Code: | 	 		    local width = 300
 
  local height = 100  
 
  local addressLocal = getAddress("BitBlt", true)
 
  print(string.format('%08X',addressLocal))
 
  local SRCCOPY = 0xCC0020
 
  executeCodeLocal(addressLocal, 
 
  canvasFrmShadowMemoryView.Handle,
 
  0, 0, width, height, 
 
  canvasMainMemoryView.Handle, 0,0, SRCCOPY) | 	  
 
 
I think I need to show all the code.
 
 	  | Code: | 	 		  local mvForm2 = getMemoryViewForm()
 
 
local mi = createMenuItem(mvForm2.Menu)
 
mi.Caption = 'GH Tools'
 
mvForm2.Menu.Items.add(mi)
 
 
local mi2 = createMenuItem(mi)
 
mi2.Caption = 'MV Scanner'
 
mi.add(mi2)
 
 
mi3HBmethod = createMenuItem(mi2)
 
mi3HBmethod.Caption = 'HB method'
 
mi2.add(mi3HBmethod)
 
mi3HBmethod.OnClick = function()
 
  if not CheckPreloadActions() then
 
    return
 
  end
 
  mi3HBmethod.Enabled = false
 
  mi4DBVMmethod.Enabled = false
 
  mi5Stop.Enabled = true
 
  mi3HBmethod.Checked = true
 
end
 
 
mi4DBVMmethod = createMenuItem(mi2)
 
mi4DBVMmethod.Caption = 'DBVM method'
 
mi2.add(mi4DBVMmethod)
 
mi4DBVMmethod.OnClick = function()
 
  if not CheckPreloadActions() then
 
    return
 
  end
 
  mi3HBmethod.Enabled = false
 
  mi4DBVMmethod.Enabled = false
 
  mi5Stop.Enabled = true
 
  mi4DBVMmethod.Checked = true
 
end
 
 
mi5Stop = createMenuItem(mi2)
 
mi5Stop.Caption = 'Stop'
 
mi2.add(mi5Stop)
 
mi5Stop.OnClick = function()
 
  mi3HBmethod.Enabled = true
 
  mi4DBVMmethod.Enabled = true
 
  mi5Stop.Enabled = false
 
  mi4DBVMmethod.Checked = false
 
  mi3HBmethod.Checked = false
 
  mi5Stop.Enabled = false
 
end
 
mi5Stop.Enabled = false
 
 
function CheckPreloadActions()
 
  local mainMemoryView = getMemoryViewForm().HexadecimalView
 
  if mainMemoryView.DisplayType ~= dtByte then
 
    showMessage("Set display type: view bytes")
 
    return false
 
  end
 
  return true
 
end
 
----------------------------------------------------------------------
 
 
 
mainMemoryView = getMemoryViewForm().HexadecimalView
 
--mainMemoryView.OnAddressChange = function(hexadecimalview, address)
 
 --  print("new address " .. address)
 
--end
 
--mainMemoryView.OnCharacterRender = function(sender, address, text2)
 
--   if text2 ~= nil then
 
--    print('text:'..text2)
 
--   end
 
--end
 
--[[
 
mainMemoryView.OnValueRender = function(sender, address, text)
 
getMemoryViewForm().Hide()
 
  print(sender.ClassName)
 
  local listProperties = getPropertyList(sender)
 
  local allowCustomInput = false
 
  local id, name = showSelectionList("Title", "Caption", listProperties, allowCustomInput)
 
  print ('Index: '..id..", Name: "..name)
 
  mainMemoryView.OnValueRender= function () end
 
end
 
--]]
 
 
 
local topAddress = mainMemoryView.Address -- top Address
 
--print(topAddress)
 
 
--print('..'..UDF1.CELabel1.Color)
 
 
frmMemoryViewForm = getMemoryViewForm()
 
mainMemoryView = getMemoryViewForm().HexadecimalView
 
isShowMainMemoryView = false
 
canvasMainMemoryView = mainMemoryView.Canvas
 
 
frmMemoryViewForm.DoubleBuffered = true
 
mainMemoryView.DoubleBuffered = true
 
 
if frmShadowMemoryView == nil then
 
   clNone = 536870911
 
   clRed = 255
 
   frmShadowMemoryView = createForm(false)
 
   frmShadowMemoryView.DoubleBuffered = true
 
 
   canvasFrmShadowMemoryView = frmShadowMemoryView.Canvas
 
   canvasFrmShadowMemoryView.Brush.Color = clRed
 
   canvasFrmShadowMemoryView.Brush.Style = 'bsClear'
 
   canvasFrmShadowMemoryView.Pen.Color = clNone --0x00FF0000
 
   canvasFrmShadowMemoryView.Pen.Width = 1   
 
end
 
 
 
 
--mainMemoryView.OnPaint = function()  
 
      
 
function OnTickTimerDrawer()
 
  if frmMemoryViewForm.Visible then
 
    frmShadowMemoryView.Show()
 
  else
 
    frmShadowMemoryView.Hide()
 
    return
 
  end  
 
  
 
  frmShadowMemoryView.Height = mainMemoryView.Height
 
  frmShadowMemoryView.Width = mainMemoryView.Width
 
 
 
  --canvasFrmShadowMemoryView.copyRect(0, 0, width, height, canvasMainMemoryView, 0,0, width,height)
 
  local width = 300
 
  local height = 100  
 
  local addressLocal = getAddress("BitBlt", true)
 
  --print(string.format('%08X',addressLocal))
 
  local SRCCOPY = 0xCC0020
 
  executeCodeLocal(addressLocal, 
 
  canvasFrmShadowMemoryView.Handle,
 
  0, 0, width, height, 
 
  canvasMainMemoryView.Handle, 0,0, SRCCOPY)
 
  
 
  --hdcWin = GetDC(hwnd); 
 
  --ReleaseDC(hwnd, hdcWin); 
 
  
 
  -- BitBlt(MemDC,0,0,1024,768,ScreenDC,0,0,SRCCOPY);
 
   
 
  local startPointX = 10
 
  local startPointY= 0
 
  local widthCell = 30
 
  local heightCell = 20
 
  local space = 20
 
 
  for x = 0, 16 do
 
    for y = 0, 5 do
 
      local x1 = startPointX + x*widthCell
 
      local y1 = startPointY+ y*heightCell
 
      local x2 = x1 + widthCell
 
      local y2 = y1 + heightCell
 
      --canvasFrmShadowMemoryView.rect(x1,y1,x2,y2)
 
      --canvasFrmShadowMemoryView.textOut(startPointX + x*widthCell, startPointY+ y*heightCell,'00')
 
    end
 
  end
 
end
 
 
 
if timerOnRenderer == nil then
 
  timerOnRenderer = createTimer()
 
  timerOnRenderer.Interval = 100
 
  timerOnRenderer.Enabled = true
 
  timerOnRenderer.OnTimer = OnTickTimerDrawer  
 
end
 
 
 
 
function StartHWMode()
 
  --todo...
 
end
 
 
function StartDBVMMode()
 
  --todo..
 
end | 	  
 | 
			 
		  |