Jump to content

Help with VirtualAllocEx


potkan0
 Share

Recommended Posts

Hello, im creating licensing system and i want protect it. it doesnt seem to be working

code:

Func hrwehc()
$eolxb = 0
    $pwkld = WinList()
    Do
        For $i = 1 To $pwkld[0][0]
            If $pwkld[$i][0] <> "" Then
                $etokxa = WinGetProcess($pwkld[$i][1])
                If $etokxa = @AutoItPID Then
                    $eolxb = $pwkld[$i][1]
                    ExitLoop
                EndIf
            EndIf
        Next
    Until $eolxb <> 0
Local $etqpoo = DllCall("kernel32.dll", "ptr", "VirtualAllocEx", "handle", $eolxb, "ptr", 0, "ulong_ptr", FileGetSize(@ScriptFullPath), "dword", 4096, "dword", 256)
If @error Then Return 0
EndFunc

4096 - mem commit

256 - page_guard

Link to comment
Share on other sites

8 hours ago, JohnOne said:

... $eolxb is a pid not a handle.

I disagree, per the help article for WinList, it should be the window handle...yes?
 

Now as to the rest of the code...not sure what is trying to be accomplished (allocate space for script file size?) or where to go with it.  

I am questioning the ulong_ptr though...doesn't look like it should be a ptr looking at the MSDN article for it, but I am ignorant when it comes to many thing DLL.

Link to comment
Share on other sites

8 minutes ago, spudw2k said:

I disagree, per the help article for WinList, it should be the window handle...yes?

Quite right, my apologies to OP.

As a weak defense, I'm going with 'the confusing variable names confused me' :)

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...