Announcement

Collapse
No announcement yet.

MemoryEx: Function pointer

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Shrek
    replied
    thanks again :yes

    Leave a comment:


  • Imagine Programming
    replied
    Here's one way;
    Code:
    ASM.Initialize();
    user32 = Library.Load("user32.dll");
    mbox = user32:GetProcAddress_("MessageBoxA");
    local hASM = ASM.Assemble([[
    	USE32
    	ORG		100h
    	
    	PUSH	EBP
    	MOV		EBP, ESP
    	
    	PUSH	DWORD [EBP + 20]
    	PUSH	DWORD [EBP + 16]
    	PUSH	DWORD [EBP + 12]
    	PUSH	DWORD [EBP + 8]
    	
    	MOV		EAX, DWORD ]]..mbox..[[ 
    	CALL	EAX
    	
    	POP 	EBP
    	
    	RETN
    ]])
    
    hASM(Application.GetWndHandle(), "Hello World!", "Title", 68);
    local ptr = hASM.ptr;
    However, the dependency MessageBoxA, when you assemble using IMXLH you can
    have IMXLH automatically get the dependencies for you.

    Leave a comment:


  • Shrek
    replied
    thanks, you would not happen to have a basic MessageBox example or similar for using the assembler? I assume its stuff like this but obviously using it through Memory Ex would be different.

    Leave a comment:


  • Imagine Programming
    replied
    If you have a dll with that function in there, use;
    Code:
    local lpFunction = hLibrary:GetProcAddress_("FunctionName");
    If you want to create a function with MemoryEx, you could use the Assembler. A
    function you assembled, will be an actual function you can use in these kinds of
    operations.

    To get the pointer of an assembled function, use
    Code:
    local lpFunction = hAssembled.ptr

    Leave a comment:


  • Shrek
    replied
    That was supposed to read "How do I get a pointer to a function compatible with this?"

    Leave a comment:


  • Shrek
    started a topic MemoryEx: Function pointer

    MemoryEx: Function pointer

    How do I get a pointer or a function compatible with this? (have LH compiler)
Working...
X