PDA

View Full Version : Free Plugin : Memory Plugin



AMSWaves
07-29-2009, 07:56 AM
Hi All,
Im back, in this long period im working on some plugin & Program and now im back, for today i create memory plugin And im work on OpenGL Plugin for AMS.

this plugin very very useful for advanced Programmers and less useful for beginners.

usages :

1) all body know call a functions in dll can be in 2 way by value and by refrence and some dll just use second way for calling or returning (Like GetWindowTextA in user32.dll or ...) with this plugin u can call a dll with refrence. :) (See help file and second attachment)

2) with this plugin you can create Plugin :huh, With this & useful tool from reteset (http://indigorose.com/forums/showthread.php?t=27283) you can create powerful Plugin for Example with this i create Clipboard plugin see third attachment. but if you create a plugin with this plugin you MUST write a THANKS to the author of this plugin for create this.:);) (this is something like a copyright)

3) if you create a dll that have a string parameter use memory instead of string, use it better.

4) with this u can create relevance between two or more application that you want create.

5) for beginners this can handle (store) any thing on memory (number or string) but be aware after close application all memory poped, be carful.

With these plugins AMS come powerful.
First Attachment is Setup file.

Enjoy.:)


Please Reply:yes

Tomasin
07-30-2009, 04:34 AM
hi

thanks for the plugin :yes

with this its possible create one ramcleaner?

works in systems 64 bits?

thanks

AMSWaves
07-30-2009, 09:10 AM
hi

thanks for the plugin :yes


hi Tomasin, thanks for reply




with this its possible create one ramcleaner?


no this plugin created for your application, with this plugin you just can free and clean size of ram that your application before allocated.




works in systems 64 bits?


i dont know i must install a 64 bit os for my plugins, my plugins created for 32 bit os maybe my plugins in 64 bit os maybe plugins want some optimizing in functions and variable ..., but maybe work.

ShadowUK
07-30-2009, 12:53 PM
The plugin worked fine on Windows 7 x64.

reteset
08-01-2009, 05:20 PM
Great Job , thank you for this good tool
i was trying this , but it always crashes

what is wrong in this function



function GetPluginNameFromLMD(strPath)

memSz = Memory.Allocate(1024);
memPn = Memory.Allocate(8);
Memory.PutInt(memSz, 0);
Memory.PutString(memPn, "", -1);


DLL.CallFunction(strPath, "irPlg_GetPluginName", memPn..","..memSz, DLL_RETURN_TYPE_INTEGER, DLL_CALL_STDCALL);
memPn = Memory.ReAllocate(memPn, memSz);

nlegth = Memory.GetInt(memSz);
DLL.CallFunction(strPath, "irPlg_GetPluginName", memPn..","..nlegth, DLL_RETURN_TYPE_INTEGER, DLL_CALL_STDCALL);

local strPluginName = Memory.GetString(memPn, -1);
Memory.Free(memSz);
Memory.Free(memPn);
return strPluginName;
end

this will call the function below ( you know)

int irPlg_GetPluginName(char* szBuffer, int* pnBufferSize)
{

int nLength = lstrlen(szObjectName);
if(*pnBufferSize < nLength)
{
*pnBufferSize = nLength;
return -1;
} else
{
memset(szBuffer,0,*pnBufferSize);
lstrcpy(szBuffer,szObjectName);
return nLength;
}
}

in first call of this funtion , it returns the buffer size with pnBufferSize
and in second call of this function i use pnBufferSize as the buffer size and i'll get szBuffer as plugin name ,
but it fails always even if i tried different variations



thanks

AMSWaves
08-01-2009, 06:24 PM
Great Job , thank you for this good tool
i was trying this , but it always crashes

what is wrong in this function



function GetPluginNameFromLMD(strPath)

memSz = Memory.Allocate(1024);
memPn = Memory.Allocate(8);
Memory.PutInt(memSz, 0);
Memory.PutString(memPn, "", -1);


DLL.CallFunction(strPath, "irPlg_GetPluginName", memPn..","..memSz, DLL_RETURN_TYPE_INTEGER, DLL_CALL_STDCALL);
memPn = Memory.ReAllocate(memPn, memSz);

nlegth = Memory.GetInt(memSz);
DLL.CallFunction(strPath, "irPlg_GetPluginName", memPn..","..nlegth, DLL_RETURN_TYPE_INTEGER, DLL_CALL_STDCALL);

local strPluginName = Memory.GetString(memPn, -1);
Memory.Free(memSz);
Memory.Free(memPn);
return strPluginName;
end

this will call the function below ( you know)

int irPlg_GetPluginName(char* szBuffer, int* pnBufferSize)
{

int nLength = lstrlen(szObjectName);
if(*pnBufferSize < nLength)
{
*pnBufferSize = nLength;
return -1;
} else
{
memset(szBuffer,0,*pnBufferSize);
lstrcpy(szBuffer,szObjectName);
return nLength;
}
}

in first call of this funtion , it returns the buffer size with pnBufferSize
and in second call of this function i use pnBufferSize as the buffer size and i'll get szBuffer as plugin name ,
but it fails always even if i tried different variations



thanks

hi my brother, i felt good to see you in this thread :):):), i think nobody love this plugin but this is very powerful, you know.
i think we must use this plugin more to all body know what is this.



use this function i change and improve it with comment see it :

function GetPluginNameFromLMD(strPath)

memPn = Memory.Allocate(1024); -- memory for store plugin name
memSz = Memory.Allocate(8); -- memory for store memPn size
Memory.PutInt(memSz, 1024); -- Size of memPn
--Memory.PutString(memPn, "", -1); all memory have null value dont need this line


ret = tonumber(DLL.CallFunction(strPath, "irPlg_GetPluginName", memPn..","..memSz, DLL_RETURN_TYPE_INTEGER, DLL_CALL_STDCALL))

if ret == -1 then -- size of memPn is not enough so dll fill the require size in memSz
require_size = Memory.GetInt(memSz) -- get the require size that dll filled it
memPn = Memory.ReAllocate(memPn, require_size); -- reallocate memPn with require size
DLL.CallFunction(strPath, "irPlg_GetPluginName", memPn..","..memSz, DLL_RETURN_TYPE_INTEGER, DLL_CALL_STDCALL);
end

local strPluginName = Memory.GetString(memPn, -1); -- get the plugin name
Memory.Free(memSz); -- release memory on ram of memSz
Memory.Free(memPn); -- release memory on ram of memPn
return strPluginName; -- return :)
end

if u see bug please post it, your post really create me happy for this plugin.:):):):yes

thanks.

AMSWaves
08-01-2009, 07:35 PM
this is better call irPlg_GetPluginName with DLL_CALL_CDECL instead of DLL_CALL_STDCALL because these are c function, so with DLL_CALL_CDECL dll return correct value (-1 for not enough memory size chek it with irPlg_GetPluginActionXML because this want big memory.)

so correction code is :

function GetPluginNameFromLMD(strPath)

memPn = Memory.Allocate(1024); -- memory for store plugin name
memSz = Memory.Allocate(8); -- memory for store memPn size
Memory.PutInt(memSz, 1024); -- Size of memPn
--Memory.PutString(memPn, "", -1); all memory have null value dont need this line


--ret = tonumber(DLL.CallFunction(strPath, "irPlg_GetPluginActionXML", memPn..","..memSz, DLL_RETURN_TYPE_INTEGER, DLL_CALL_CDECL))
ret = tonumber(DLL.CallFunction(strPath, "irPlg_GetPluginName", memPn..","..memSz, DLL_RETURN_TYPE_INTEGER, DLL_CALL_CDECL))

if ret == -1 then -- size of memPn is not enough so dll fill the require size in memSz
require_size = Memory.GetInt(memSz) -- get the require size that dll filled it
memPn = Memory.ReAllocate(memPn, require_size); -- reallocate memPn with require size
--ret = tonumber(DLL.CallFunction(strPath, "irPlg_GetPluginActionXML", memPn..","..memSz, DLL_RETURN_TYPE_INTEGER, DLL_CALL_CDECL))
DLL.CallFunction(strPath, "irPlg_GetPluginName", memPn..","..memSz, DLL_RETURN_TYPE_INTEGER, DLL_CALL_CDECL);
end

local strPluginName = Memory.GetString(memPn, -1); -- get the plugin name
Memory.Free(memSz); -- release memory on ram of memSz
Memory.Free(memPn); -- release memory on ram of memPn
return strPluginName; -- return :)
end

Imagine Programming
08-01-2009, 07:42 PM
I'm loving this plugin, memory support for AMS yay !

I must thank you alot AMSWaves, very well done! :yes

Imagine Programming
08-01-2009, 07:48 PM
Here's one to get the plugin's XML

:D

this is mighty!


function GetPluginXMLFromLMD(strPath)
local memPx = Memory.Allocate(1024);
local memSz = Memory.Allocate(8);
Memory.PutInt(memSz, 1024);

local ret = tonumber(DLL.CallFunction(strPath, "irPlg_GetPluginActionXML", memPx..","..memSz, DLL_RETURN_TYPE_INTEGER, DLL_CALL_CDECL))

if ret == -1 then
local require_size = Memory.GetInt(memSz)
memPx = Memory.ReAllocate(memPx, require_size);
DLL.CallFunction(strPath, "irPlg_GetPluginActionXML", memPx..","..memSz, DLL_RETURN_TYPE_INTEGER, DLL_CALL_CDECL);
end

local strPluginXML = Memory.GetString(memPx, -1);
Memory.Free(memSz);
Memory.Free(memPx);
return strPluginXML;
end

reteset
08-02-2009, 12:32 PM
Thank You , It works Perfect :yes

most of the people can think , this is a useless tool
but they are missing a big thing ;)


this is really a useful plugin , but it requires a bit of high level knowledge

i was trying to make a dialog for Action Plugin Compiler that lists installed actions plugins
like the attahment below , it works well now

thank you very much

MicroByte
08-02-2009, 04:38 PM
Nice Work, This is very powerful and now enables AMS to use even more API as well as many other 3rd party dll's that use memory pointers.

Thanks

Centauri Soldier
08-02-2009, 04:48 PM
This seems like a very powerful plugin but I wouldn't even know where to begin learning how to use it or to what application I would apply it. I know diddly about memory management.

S0mbre
08-02-2009, 11:21 PM
Thank you man for this rockin plugin! now it's time to tweak it with AMS, eh? a lil bit of c++ functionality won't do no harm to it :)

AMSWaves
08-03-2009, 07:23 PM
Hi All,
Thanks Imagine Programming, reteset, MicroByte, Centauri Soldier, S0mbre and all members for your attention.

AMSWaves
08-03-2009, 07:25 PM
Thank You , It works Perfect :yes

most of the people can think , this is a useless tool
but they are missing a big thing ;)


this is really a useful plugin , but it requires a bit of high level knowledge

i was trying to make a dialog for Action Plugin Compiler that lists installed actions plugins
like the attahment below , it works well now

thank you very much

This is pretty Dialog;):D

Good Work.

AMSWaves
08-03-2009, 07:31 PM
This seems like a very powerful plugin but I wouldn't even know where to begin learning how to use it or to what application I would apply it. I know diddly about memory management.

maybe i can say some story from memory management and some help file for work with windows api in tomorrow.

AMSWaves
08-04-2009, 03:00 PM
i create this help to all body know work of memory, sorry for bad writing if you have any problem or any question please feel free to post it, i really love to speak around memory and problems;):).
Thanks.
First :

for fist thing you can create a memory Pointer with:


memptr = Memory.Allocate(256) -- 256 is size of my memory


and you can put on it some value with :


Memory.PutString()
Memory.PutByte()
Memory.PutChar()
Memory.PutDouble()
Memory.PutFloat()
Memory.PutInt()
Memory.PutLong()
Memory.PutInt64()
Memory.PutShort()



and you can get value from memory with :


Memory.GetString()
Memory.GetByte()
Memory.GetChar()
Memory.GetDouble()
Memory.GetFloat()
Memory.GetInt()
Memory.GetLong()
Memory.GetInt64()
Memory.GetShort()



if size of your memory is not enough u can increase or decrease your memory size with :


memptr = Memory.ReAllocate(memptr, 1024) -- old size is 256 bytes and new is 1024 bytes



you can get the size of your memory with :


size_of_memptr = Memory.Size(memptr) -- before Memory.ReAllocate size is 256 and after is 1024



you fill all memory byte with null value (this is some times needed for password buffer) with :


Memory.Zero(memptr)



and you can copy and move one memory to another memory with :


Memory.Move()
Memory.Copy()



Compare two memories and get size in string and byte mode is possible with :


Memory.Compare()
Memory.CompareString()
Memory.Size()
Memory.SizeString()



you can append one string in the end of your memory with :


Memory.CopyString()



and at the end you must free, release or kill memory on ram with :


Memory.Free()




Second :

for Second thing you must know memory pointer is like a variable :



a = 10 -- create a number varialbe in AMS
Dialog.Message("value in Variable a", a)





a = Memory.Allocate(256) -- create a memory pointer (like varialbe a ) in Memory Plugin
Memory.PutInt(a, 10)

Dialog.Message("memory Pointer a", a)
Dialog.Message("value in memory Pointer a", Memory.GetInt(a, 10))


these two code dont have any difference, in second code 'a' is a pointer of block of memory in ram
that you can put in it everything with Memory.Put*** Functions.


Third :

in c++ when you create a pointer value you allude to a number that stored in memory for examp 9754654
this number is start of your memory block in ram.



ptr *pointer -- create pointer as Memory Pointer like pointer = Memory.Allocate(some size)
int a = 10 -- a = 10

pointer = &a -- this is not possible in AMS because AMS variable dont have Pointer but you can
-- fill Pointer memory with Memory.PutInt(pointer, a).

Cout << *pointer -- Debug value of Pointer (10) like Memory.GetInt(pointer)
Cout << pointer -- Debug number of pointer (ex : 9754654) like Debug.Print(pointer)



Fourth :

Memory.Allocate() return a number like 9754654, this number mean start of your memory block so you
can walk on it for examp :




mem = Memory.Allocate(1024)
txt = "AMSWaves"

Memory.PutString(mem, txt, -1)

Dialog.Message("Print value in memory", Memory.GetString(mem, -1))

Memory.Free(mem)





mem = Memory.Allocate(1024)
txt = "AMSWaves"

for i = 0, String.Length(txt)-1 do
t = String.Mid(txt, i+1, 1) -- one by one char from txt
Memory.PutByte(mem + i, String.Asc(t))
end

Dialog.Message("Print value in memory", Memory.GetString(mem, -1))

Memory.Free(mem)



these two Code dont have any difference, in first code we put 'AMSWaves' with Memory.PutString()
in memory and in second code we put 'AMSWaves' with walking in memory (mem + i) and put one byte
one byte on that pointer

see better Work of Second Code, if we think mem is 9754654 for examp so we have :


mem + 0 = 9754654 -- first byte of pointer 'A'
mem + 1 = 9754655 -- second byte of pointer 'M'
mem + 2 = 9754656 -- third byte of pointer 'S'
mem + 3 = 9754657 -- fourth byte of pointer 'W'
mem + 4 = 9754658 -- 5th byte of pointer 'a'
mem + 5 = 9754659 -- 6th byte of pointer 'v'
mem + 6 = 9754660 -- 7th byte of pointer 'e'
mem + 7 = 9754661 -- 8th byte of pointer 's'


walk on memory is a good method for encrypting decripting & compressing uncompressing data,
for copy a file on memory and use it (one byte one byte), for download a file on memory and
then use it and everything you can think with memory possible, we just want know what we want do
with memory.


5th :
memory pointer have a refrence so you can send it to a dll and dll work on it then u get the value.
So you can call more API as well as many other 3rd party dll's.

For examp these api work with refrence :


CreateFileA ---> kernel32.dll
ReadFile ---> kernel32.dll
WriteFile ---> kernel32.dll
ReadFile ---> kernel32.dll
GetWindowTextA ---> user32.dll
.
.
.
.

and very very much api that u can use in AMS.
u can use 3rd party dll's that uses pointer memory or refrence.

for see api help u can go to my site and download Platform SDK (~385 MB) or windows help(~5.4 MB)
Platform SDK is very usefull for api programming but windows help is limited and old.

Address :
http://www.amswaves.com/PSDK/

Note :
some variable name have type, if you see below type in the help api you must know that are pointer


following are Pointers (Memory adresses to Variables)
************************************************** ***************

LPBOOL Pointer to a BOOL.
LPBYTE Pointer to a BYTE.
LPCOLORREF Pointer to a COLORREF value.
LPCSTR Pointer to a constant String.
LPCTSTR An LPCWSTR if UNICODE is defined, an LPCSTR otherwise.
LPCVOID Pointer to a constant of any type.
LPCWSTR Pointer to a constant string of 16-bit Unicode characters.
LPDWORD Pointer to a DWORD.
LPHANDLE Pointer to a HANDLE.
LPINT Pointer to an INT.
LPLONG Pointer to a LONG.
LPSTR Pointer to a string
LPTSTR An LPWSTR if UNICODE is defined, an LPSTR otherwise.
LPVOID Pointer to any type.
LPWORD Pointer to a WORD.
LPWSTR Pointer to a string of 16-bit Unicode characters.
PBOOL Pointer to a BOOL.
PBOOLEAN Pointer to a BOOL.
PBYTE Pointer to a BYTE.
PCHAR Pointer to a CHAR.
PCSTR Pointer to a string
PCTSTR A PCWSTR if UNICODE is defined, a PCSTR otherwise.
PCWCH Pointer to a constant WCHAR.
PCWSTR Pointer to a constant string of 16-bit Unicode characters.
PDWORD Pointer to a DWORD.
PFLOAT Pointer to a FLOAT.
PHANDLE Pointer to a HANDLE.
PHKEY Pointer to an HKEY.
PINT Pointer to an INT.
PLCID Pointer to an LCID.
PLONG Pointer to a LONG.
PLUID Pointer to a LUID.
POINTER_32 32-bit pointer.
POINTER_64 64-bit pointer. On a 64-bit system, this is a native pointer. On a 32-bit system, this is a sign-extended 32-bit pointer.
PSHORT Pointer to a SHORT.
PSTR Pointer to a string
PTBYTE Pointer to a TBYTE.
PTCHAR Pointer to a TCHAR.
PTSTR A PWSTR if UNICODE is defined, a PSTR otherwise.
PUCHAR Pointer to a UCHAR.
PUINT Pointer to a UINT.
PULONG Pointer to a ULONG.
PUSHORT Pointer to a USHORT.
PVOID Pointer to any type.
PWCHAR Pointer to a WCHAR.
PWORD Pointer to a WORD.
PWSTR Pointer to a string of 16-bit Unicode characters.

************************************************** ***************


you must know for now memory plugin not support Unicode, in future.

Centauri Soldier
08-04-2009, 05:26 PM
WOW! Thank you very much, that was quite detailed. I can see how it would be beneficial to set aside memory for instances such as databases and the like. I imagine one would be able to help prevent stack overflows with such a tool.

Imagine Programming
08-04-2009, 08:22 PM
Nice work AMSWaves, great tutorial.

AMSWaves
08-05-2009, 09:21 AM
Thanks good to see this tutorial have benefit.:):):)

AMSWaves
08-10-2009, 02:58 PM
Hi all,
in last week i post a example Downlaod File To Memory on Example section but now see that not exist:wow

This Example show power of memory plugin, with this example you see how you can download a file from internet to your memory and then use it, you can download files on memory then use it as text or create a file of it and then use it and then kill memory so user can not see your downloaded files (For Security reason).
Use and Enjoy.

AMSWaves
08-13-2009, 11:21 AM
Hi All, in these days that im absent im work on Memory Plugin and some security way that Post it on future, i find bad bogs on GetIn64 & PutInt64 And GetString & PutString and fixed it, and now plugin support unicode and utf8 and ascii (see help file).

So Changes is :


Bug Fix in Memory.GetString() and Memory.PutString()
Memory.GetString() and Memory.PutString() now support Ascii, Unicode And UTF8
Bug Fix in Memory.GetInt64() and Memory.PutInt64(), these funcs now use string instead of number


Some Info On Bug Fix in Memory.GetInt64() and Memory.PutInt64(), these funcs now use string instead of number for programmer and developer :

AMS & Lua number variable really cant handle big numbers (Int64) for examp :


int64_number = 9876974526712182279
Dialog.Message("", int64_number) -- Print 9.8769745267122e+018 :wow

so every body want handle big numbers use string instead of number variable

Enjoy:yes

AMSWaves
08-25-2009, 05:36 PM
Hi all
New Version Released v 1.0.2.0
this version just have a minor bug fix on Memory.PutString() and Memory.GetString() but for those that want work with ut8 and unicode this version is very important.

Enjoy!

Imagine Programming
08-25-2009, 06:21 PM
Hi all
New Version Released v 1.0.2.0
this version just have a minor bug fix on Memory.PutString() and Memory.GetString() but for those that want work with ut8 and unicode this version is very important.

Enjoy!

Thanks AMSWaves, much appreciated.

kjh
08-28-2009, 08:16 AM
Hi AMSWaves
Thanks for the great Memory-plugin

I have tried to get your sample (Download File To Memory.apz) to work but it seems that an update is needed.
The Memory.PutString mode parameter is missing in the function DownloadToMemory().

I have tried all Memory.PutString mode's and different download destinations but the function keeps returning size==-1.

Question:
Can I use the agent string in the sample or do I have to change it to my own values?

-- Memory.PutString(agent, "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.1) Gecko/20090715 Firefox/3.5.2", -1,"Ascii")

I'm running XP SP3 if that is relevant?

Thanks in advance

AMSWaves
08-28-2009, 03:38 PM
Hi AMSWaves
Thanks for the great Memory-plugin

I have tried to get your sample (Download File To Memory.apz) to work but it seems that an update is needed.
The Memory.PutString mode parameter is missing in the function DownloadToMemory().

I have tried all Memory.PutString mode's and different download destinations but the function keeps returning size==-1.


hi kjh and thanks.
i test it with new version of plugin good worked just want some changes in (mode's that you said) download this again and test it.




Can I use the agent string in the sample or do I have to change it to my own values?

-- Memory.PutString(agent, "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.1) Gecko/20090715 Firefox/3.5.2", -1,"Ascii")

I'm running XP SP3 if that is relevant?

Thanks in advance

you can change it to anything you want i just write it for example (i copy it from latest firefox 3.5.2) but you must know windows sent this agent to site that you connected to it for download so is better write it a real agent name but any way anything you want.

rexzooly
10-01-2009, 01:22 PM
hi kjh and thanks.
i test it with new version of plugin good worked just want some changes in (mode's that you said) download this again and test it.




you can change it to anything you want i just write it for example (i copy it from latest firefox 3.5.2) but you must know windows sent this agent to site that you connected to it for download so is better write it a real agent name but any way anything you want.

Cant download Picture file your demo just keeps saying this on windows 7.

AMSWaves
10-01-2009, 08:19 PM
realy i dont know, i use InternetOpenA api in wininet.dll, maybe on win7 this api want some change, also not worked on win Vista ?

jassing
10-01-2009, 08:42 PM
Cant download Picture file your demo just keeps saying this on windows 7.

does the same thing for me on Winxp sp3....even changed to an image on a local intranet server...

AMSWaves
10-04-2009, 12:41 PM
Hi All this is a new version of Memory Plugin.
in this new version you can create a structure like Clike programming langs and use it in many api that want structure but create Structure is beta and for now not support Strings and want some changes still, So please test it with any structure you know and say any bugs.

Changes :

New Methods For Support Sructures!
New Functions are .CreateStructure, .SetStructureData, .GetStructureData, .FreeStructure .


thanks for your testing and suggest.

Best Regards,
AMSWaves.

RizlaUK
10-04-2009, 02:15 PM
shocking, structures in AMS, i'll drop everything and test this right now

nice work :yes

RizlaUK
10-04-2009, 02:30 PM
works with RECT :yes


-- create RECT Structure that have 4 long or int fields
local Struct = Memory.CreateStructure("int, int, int, int")

DLL.CallFunction("user32.dll", "GetWindowRect", Application.GetWndHandle()..",".. Struct, DLL_RETURN_TYPE_LONG, DLL_CALL_STDCALL);

local rc={}

rc.left = Memory.GetStructureData(Struct, 1)
rc.top = Memory.GetStructureData(Struct, 2)
rc.right = Memory.GetStructureData(Struct, 3)
rc.bottom = Memory.GetStructureData(Struct, 4)

strText="Left:"..rc.left.."\r\n"
strText=strText.."Top:"..rc.top.."\r\n"
strText=strText.."Right:"..rc.right.."\r\n"
strText=strText.."Bottom:"..rc.bottom.."\r\n"

result = Dialog.Message("Notice", strText, MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);

Memory.FreeStructure(Struct)

RizlaUK
10-06-2009, 04:03 PM
man, this structure system is amazing, do you guys have any idea how much this opens AMS up, you wouldn't beleave the things im doing here!

johnraus
10-06-2009, 04:21 PM
man, this structure system is amazing, do you guys have any idea how much this opens AMS up, you wouldn't beleave the things im doing here!

could you giv us an example .... seeing is better than believing ;)

RizlaUK
10-06-2009, 05:23 PM
sure, in a few days i will post a mega example of what this plugin can do, but im showing no code now as it will give the game away, lets just say, iv achieved my goals in AMS ;)

DaSoulRed
10-08-2009, 09:27 AM
That post sounds Cool...

keep your effort... i will have new goals... u will see... new Puzzles will arrive...

Enjoy... :)

Bytes for Now

DaSoulRed
10-09-2009, 09:12 AM
That post sounds Cool...

keep your effort... i will have new goals... u will see... new Puzzles will arrive...

Enjoy... :)

Bytes for Now

keep your effort... "YOU" will have new goals... u will see... new Puzzles will arrive...

Enjoy... :) <-- I MEAN YOU WILL

AMSWaves
10-09-2009, 05:15 PM
Hi All.
thanks RizlaUk and all body that know the power of Memory plugin, i decide to improve this plugin so improve structures methods and add new methods for creating array (but just support One Dimension array).
i think all body know about arrays array is something like Lua tables but array can used in some apis, so i think now all body can work with all apis in windows.

Changes :

New Methods For Support Arrays!
New Functions are .CreateArray, .SetArrayData, .GetArrayData, .FreeArray.
Structures Methods improved and have some changed
Now Structures Methods support multi fields (like int[12] instead of int, int, ...)


Enjoy and post your thought and suggest:yes
AMSWaves.

RizlaUK
10-10-2009, 06:22 AM
super work, i have not had time to test it yet, i'll send some arrays to API layer, i might be able to get shell file operation's working with this now.

johnraus
10-16-2009, 05:00 PM
As I can see all over, this memory plugin of yours , can do miracles :wow

Do you know of a place, beyond this forum, with samples about calling DLL's of of te windows API, or a good book to start with ?
(when I google I find a lot of C code samples, but this is beyond my understanding ...:eek:)

Scriptonite
10-17-2009, 12:08 AM
Wow, this is fantastic. Thanks for the plugin. :yes

RizlaUK
10-17-2009, 03:09 AM
@johnraus

most API code you will find will be C++ based, try searching VB6 examples as these also use lots of API

PureBasic has its own API layer which is how i learnt (what i know so far) of the windows API, MSDN is the best place to start

as for a good book, if you find one send me a link, lol

jassing
11-17-2009, 02:36 PM
I'm trying to use the plugin to call a dll that is expecting a structure by reference.. however, the result is that all elements are zero.

What am I doing wrong?


struct = Memory.CreateStructure("double, int, int, int, int, int, int, int, int, int, int, double, double, double") -- instead of "short, byte, string" we use "short, byte, int"
Dialog.Message("Test,Size", Memory.Size( struct ))

Application.SetLastError(0);

nDLL = DLL.CallFunction(_SystemFolder.."\\psapi.dll", "GetPerformanceInfo", struct..","..Memory.Size(struct), DLL_RETURN_TYPE_INTEGER, DLL_CALL_STDCALL);
Dialog.Message("Test, result", nDLL.."\r\n"..Application.GetLastError());

cData = ""
for x=1,14 do
cData = cData.."\r\n"..Memory.GetStructureData(struct, x, 0);
end
Dialog.Message('test, end', cData);

Memory.FreeStructure(struct) -- free all allocated memory of our structure

The 1st two dialogs make it look like it's going to work; but the final dialog showing the results is all zero's....

MicroByte
11-18-2009, 04:30 AM
remove the optional argument in the loop


for x=1,14 do
cData = cData.."\r\n"..Memory.GetStructureData(struct, x, 0);
end

AMSWaves
11-18-2009, 07:54 AM
I'm trying to use the plugin to call a dll that is expecting a structure by reference.. however, the result is that all elements are zero.

What am I doing wrong?


struct = Memory.CreateStructure("double, int, int, int, int, int, int, int, int, int, int, double, double, double") -- instead of "short, byte, string" we use "short, byte, int"
Dialog.Message("Test,Size", Memory.Size( struct ))

Application.SetLastError(0);

nDLL = DLL.CallFunction(_SystemFolder.."\\psapi.dll", "GetPerformanceInfo", struct..","..Memory.Size(struct), DLL_RETURN_TYPE_INTEGER, DLL_CALL_STDCALL);
Dialog.Message("Test, result", nDLL.."\r\n"..Application.GetLastError());

cData = ""
for x=1,14 do
cData = cData.."\r\n"..Memory.GetStructureData(struct, x, 0);
end
Dialog.Message('test, end', cData);

Memory.FreeStructure(struct) -- free all allocated memory of our structure

The 1st two dialogs make it look like it's going to work; but the final dialog showing the results is all zero's....

use this code :


struct = Memory.CreateStructure("int, int, int, int, int, int, int, int, int, int, int, int, int, int") -- instead of "short, byte, string" we use "short, byte, int"
Dialog.Message("Test,Size", Memory.Size( struct ))
Memory.SetStructureData(struct, 1, 0, Memory.Size(struct))

Application.SetLastError(0);

nDLL = DLL.CallFunction(_SystemFolder.."\\psapi.dll", "GetPerformanceInfo", struct..","..Memory.Size(struct), DLL_RETURN_TYPE_LONG, DLL_CALL_STDCALL);
Dialog.Message("Test, result", nDLL.."\r\n"..Application.GetLastError());

cData = ""
for x=1,14 do
cData = cData.."\r\n"..Memory.GetStructureData(struct, x, 0);
end
Dialog.Message('test, end', cData);

Memory.FreeStructure(struct) -- free all allocated memory of our structure

jassing
11-18-2009, 09:18 AM
Thank you AMSWaves & MicroByte!

1) Wonderwhy the optional parameter makes a difference
2) Looks like Microbytes solution is the "proper" one; as the results look accurate. Need to investigate more.

Actually, neither appears to produce truely valid results... but this definately gives me something to go on..

Thank you.
-josh

jassing
11-18-2009, 10:02 AM
Well; I can't find it now; but I thought I had a reference to what types the memory plugin "knew" about...

Here's the WIP in case someone wants to take a stab at it -- the results should match (closely) with taskmanager's "performance" tab.


--[[
DWORD cb;
SIZE_T CommitTotal;
SIZE_T CommitLimit;
SIZE_T CommitPeak;
SIZE_T PhysicalTotal;
SIZE_T PhysicalAvailable;
SIZE_T SystemCache;
SIZE_T KernelTotal;
SIZE_T KernelPaged;
SIZE_T KernelNonpaged;
SIZE_T PageSize;
DWORD HandleCount;
DWORD ProcessCount;
DWORD ThreadCount;
--]]
tElements={"cb","CommitTotal","CommitLimit","CommitPeak","PhysicalTotal","PhysicalAvailable","SystemCache","KernelTotal","KernelPaged","KernelNonpaged","PageSize","HandleCount","ProcessCount","ThreadCount"};

--struct = Memory.CreateStructure("double, double, double, double, double, double, double, double, double, double, double, double, double, double")
--struct = Memory.CreateStructure("double, int, int, int, int, int, int, int, int, int, int, double, double, double")
struct = Memory.CreateStructure("int, int, int, int, int, int, int, int, int, int, int, int, int, int")
--struct = Memory.CreateStructure("dword, int, int, int, int, int, int, int, int, int, int, dword, dword, dword")

cSize = "Memory Size: "..Memory.Size( struct )
Memory.SetStructureData(struct, 1, 0, Memory.Size(struct))

Application.SetLastError(0);

nDLL = DLL.CallFunction(_SystemFolder.."\\psapi.dll", "GetPerformanceInfo", struct..","..Memory.Size(struct), DLL_RETURN_TYPE_LONG, DLL_CALL_STDCALL);
cResult = "DLL Call Result: "..nDLL.." "..Application.GetLastError();

cData = ""
for x=1,14 do
cData = cData.."\r\n"..tElements[x].."="..Memory.GetStructureData(struct, x);
end
Memory.FreeStructure(struct) -- free all allocated memory of our structure

Dialog.Message("Results", cSize.."\r\n"..cResult.."\r\n".. cData);

MicroByte
11-18-2009, 01:56 PM
its returning the correct values, just in pages, use the "PageSize" eleament in conjunction with "KernelNonpaged, KernelPaged and KernelTotal" to get the size in bytes.

MicroByte
11-18-2009, 02:55 PM
but for the last hour iv been tiring to figure out how to go about it, with no success

jassing
11-18-2009, 09:09 PM
So, um, you go back on "it is returning the right value"?

yea; I can change int / double and get different results... none seem to fit it correctly...

Totally at a loss.
Thanks for trying tho.

reteset
11-19-2009, 01:32 PM
you need to use long instead of SIZE_T
and use a simple math Value*4

something like this


local ntmp = Memory.GetStructureData(struct, x, 0, "");
ntmp=ntmp*4;

i attached a full example

jassing
11-19-2009, 03:21 PM
AWESOME! Thank you VERY much.

jassing
12-03-2009, 01:27 PM
I have been using the plugin with great success on a number of things. However, one has me stumped.

In C, VFP, VB, VBA, I can get the dll call to work; but using the memory plugin, the string returned is truncated.
the string is roughly 100 bytes long -- i have allocated 4096 bytes; and even asked for Memory.GetString() to give me all 4096; but the string is truncated about 78 characters.

Any ideas?

Worm
12-04-2009, 07:51 AM
Is it possible the string has a null in it? AMS considers the very first null in a string to be the end of the string. (I think)

jassing
12-04-2009, 07:58 AM
Is it possible the string has a null in it? AMS considers the very first null in a string to be the end of the string. (I think)
I had thougth about that; but string.byte() should still work.
Either way; I checked in C & vfp and there were no nulls.

jassing
12-05-2009, 10:37 PM
Worm, you're right...

However, it appears misplaced.

As near as I can tell, it's the Memory Plugin's fault....

lua (IR's use of it too) handles null's.

If I use LUA LLFIO to read file (to a string) that contains a binary zero (Null) character, then use something like Dialog.Message() to displa that string; it will as you expect, display only up to that binary zero. ie:

josh [0]is there.

Would only display "josh "

However, if we return to LUA LL functions, string.byte() to examine each of the bytes of the string, the zero is there; as is "is there."

Now, if we write a dll to return that string; Memory.GetString() works; but you can only get "josh " not the full string, no matter how you askfor it... you can request 20 characters, you still will only get "josh " and the rest are nulls...

"josh [0][0][0][0][0][0][0][0][0][0][0][0][0][0][0]"

The issue appears to be with the memory plugin's handling of the string, not lua... :(

AMSWaves
12-11-2009, 09:08 PM
hi all,
i think memory plugin want some more love, im going to update memory plugin and add some new powerful method that maybe when you see say waw amazing but if any body have any issue and have any suggest and have any bug please post it for improve it.

Thanks,
AMSWaves.

AMSWaves
12-16-2009, 09:29 AM
Hi All,
New version Released (1.3.2.0).
In this new version i add some new methods for work with binaries and some other methods and some changes on GetString and PutString for compatiblity.
but in this version amazing is Subclass, in this version you can create a object and then create its subclass (on click, on dblclick, on show, on leave) In AMS and use it, so u can create any object plugin with this new version and u can create any action plugin with this version like my Timer Plugin and All of these possible in Memory Plugin and it still go up.


ChangeLog:

New Methods For Create SubClass into your main funcion of program or object or ...!
New Methods For do BitWises operand!.
New Methods For do Arithmetic shift!.
New Functions are .CreateWindowSubClass, .FreeWindowSubClass, .BitAND, .BitOR, .BitXOR, .BitNOT, .ShiftRight, .ShiftLeft.
Change some lines in .GetString and .PutString for more compatible with old version of Memory Plugin(thanks MicroByte)


eNjoy and post your thought

Best Regards,
AMSWaves.

jassing
12-16-2009, 10:51 AM
Great work! thank you.

MicroByte
12-16-2009, 01:10 PM
super stuff :yes, thanks, i'll check it out right now

jassing
02-04-2010, 02:45 PM
I'm getting a crash with the memory plugin
Line works fine on other os's.

line generating the error:

local nByteValue = Memory.GetChar( MemoryBuffer + nOffSet);

[ this is from the code you gave me, slightly modified: ]


function Memory.GetString2(MemoryBuffer, nLength)
local cMemoryString="";
local nOffSet;
if not type(nLength)=="number" or nLength == -1 then
nLength = Memory.Size(MemoryBuffer) - 1
end

for nOffSet = 0, nLength do
local nByteValue = Memory.GetChar(MemoryBuffer + nOffSet);
cMemoryString = cMemoryString .. string.char( nByteValue )
end
return cMemoryString
end

RizlaUK
02-04-2010, 03:11 PM
its a error in the loop, you are not checking "nLength" for a nil value

this works for me (Win7)


function Memory.GetString2(MemoryBuffer, nLength)
local cMemoryString="";
local nOffSet;
if type(nLength)=="nil" or nLength == -1 then
nLength = Memory.Size(MemoryBuffer) - 1
end

for nOffSet = 0, nLength do
local nByteValue = Memory.GetChar(MemoryBuffer + nOffSet);
cMemoryString = cMemoryString .. string.char( nByteValue )
end
return cMemoryString
end



_Buffer = Memory.Allocate(1024);
Memory.PutString(_Buffer, "I'M In Your Memory", -1, "Ascii");

Dialog.Message("Notice", Memory.GetString2(_Buffer, -1));
Dialog.Message("Notice", Memory.GetString2(_Buffer, 15));
Dialog.Message("Notice", Memory.GetString2(_Buffer));


Edit: use "not" to check boolean values, type returns a string so "not" will assume its true as it contains a value

EG


if type(nLength)=="nil" or nLength == -1 then

is the same as


if not nLength or nLength == -1 then

jassing
02-04-2010, 03:24 PM
I surely do check it..

type(nLength)=="number"

if it's nil; that won't be true.

The error is not there; and it successfully goes thru several iterrations.

RizlaUK
02-04-2010, 03:59 PM
OK, i tried the function with no nLength arg and it threw an error in the loop, so the nil value was getting into the loop, see below


--arg=-1
arg=nil
if not type(arg) == "number" or arg == -1 then
Dialog.Message("Notice", "if the value is nil or -1, you should see this dialog");
end


but anyway,if that is not causing the error, how long is the string and does it contain and non ansci chars,

i cant get it to crash, even with a real long string, my only guess is maybe the memory buffer is getting corrupted somewhere or you are reading to much memory (over reading/writing a memory buffer will crash the whole app)

what code calls this function ?

jassing
02-04-2010, 04:10 PM
--arg=-1
arg=nil
if not type(arg) == "number" or arg == -1 then
Dialog.Message("Notice", "if the value is nil or -1, you should see this dialog");
end

I ran that code, and no notice popped up for me...



but anyway,if that is not causing the error, how long is the string and does it contain and non ansci chars,
Not sure on the length; typically it's about 30-50 bytes.
Yes, it has non asci chars, which is why we're using a function to 'trick' it rather than using built in memory getstring.
This same code works fine on winxp.



what code calls this function ?

A program that's been in use for some time that is for debugging purposes, it calls an external API (DLL) and gets back an array of bytes (aka: string, with non asci chars)

RizlaUK
02-04-2010, 04:49 PM
I ran that code, and no notice popped up for me...

exactly, because "not" is detecting the value from "type" and reporting true

ok, i just added some non ansci chars to the mix, and same results, no crashes (win7 Home Premium)

you got a funny little bug there, doesent seem to want to show itsself to me

jassing
02-04-2010, 05:22 PM
I think we were talking apples & oranges.

The result, tho, is the crash only happens on win7. Hopefully someone with source code ability can help...

tavria2
02-20-2010, 01:05 AM
Please Help.

App Crash. :huh

I create Subclass for a few objects:

Memory.CreateWindowSubClass(hWnd1, 1, "test");
Memory.CreateWindowSubClass(hWnd2, 2, "test");

When try to free memory, there is an error: "Memory can't be read".

Memory.FreeWindowSubClass(1);
Memory.FreeWindowSubClass(2);

If to free memory of only one Subclass, an error is not present.

p.s. OS: WinXP

RizlaUK
02-22-2010, 02:33 PM
without seeing more code its hard to say its why crashing, try changing the callback function names and have separate callbacks for each object

sub-classing can be very temperamental

tavria2
02-22-2010, 03:06 PM
Mouse right click on Input1 and Listbox1 - BEEP

WM_RBUTTONDOWN = 516;

function CallBack(hWnd, uMsg, wParam, lParam)
if uMsg == WM_RBUTTONDOWN then
DLL.CallFunction("kernel32.dll", "Beep", "800,100", DLL_RETURN_TYPE_LONG, DLL_CALL_STDCALL)
end
end

hWnd1 = Input.GetProperties("Input1").WindowHandle;
hWnd2 = ListBox.GetProperties("ListBox1").WindowHandle;
Memory.CreateWindowSubClass(hWnd1, 1, "CallBack");
Memory.CreateWindowSubClass(hWnd2, 2, "CallBack");

On Close

Memory.FreeWindowSubClass(1);
Memory.FreeWindowSubClass(2); -- this line causes an error

Centauri Soldier
02-26-2010, 11:51 PM
Any chance you're gonna release the source code for this plugin, AMSWaves? :eek:
This would be a fantastic plugin creation resource. :D

RizlaUK
03-12-2010, 05:06 AM
This would be a fantastic plugin creation resource.

no, no, no

This IS a fantastic plugin creation resource.

Centauri Soldier
03-27-2010, 01:35 AM
After doing this...

Crypto.Base64EncodeToFile("J:\\AutoPlay 7.0\\TextToSpeech.v.1.0.0.1\\CD_Root\\AutoPlay\\Do cs\\TextToSpeech.dll", "AutoPlay\\Docs\\Base64DLL.txt", 100);


and then trying to load it like this...

My_Base64_Dll = TextFile.ReadToString("AutoPlay\\Docs\\Base64DLL.txt");
result = Memory.OpenLibrary(0, My_Base64_Dll);

I get this error.

And yes, I'm wrapping sside's TextToSpeech.dll into a plugin. :p

Imagine Programming
03-27-2010, 03:08 AM
I believe that error is coming from SSides dll, right?

Anyhow, am I wrong here or does Memory now load Base64 encrypted dll aswell?

Sakuya
03-27-2010, 03:19 AM
Anyhow, am I wrong here or does Memory now load Base64 encrypted dll aswell?

I was going to ask this too..

Centauri Soldier
03-27-2010, 03:29 AM
Well, it could be that I'm loading it from encrypted Base64. Is there an unencypted version of Base64? Does anyone have ideas how I'd fix this?

Oh, here's something anomalous. Not sure where the error lies, in the dll or the Memory plugin but I thought I'd bring it up.

A certain DLL call requires a standard call using a return type of string. If I use the Memory plugin to make that call (as opposed to DLL.CallFunction()) then I have to change the return type to long or the program crashes...very odd.

Sakuya
03-27-2010, 04:22 AM
Well, it could be that I'm loading it from encrypted Base64. Is there an unencypted version of Base64? Does anyone have ideas how I'd fix this?

Oh, here's something anomalous. Not sure where the error lies, in the dll or the Memory plugin but I thought I'd bring it up.

A certain DLL call requires a standard call using a return type of string. If I use the Memory plugin to make that call (as opposed to DLL.CallFunction()) then I have to change the return type to long or the program crashes...very odd.

Base64 isn't an encryption method. It's an encoding method.

You just have to decode the Base64, or just don't encode it at all.

Imagine Programming
03-27-2010, 04:49 AM
Base64 isn't an encryption method. It's an encoding method.

You just have to decode the Base64, or just don't encode it at all.

I'm not sure if I understand, does it or does it not load Base64 encoded strings?
Cuz that would be messed up lol

Centauri Soldier
03-27-2010, 05:06 AM
It does decode it. I just tried it on a different dll. Something must be wrong with sside's dll like you said.

Imagine Programming
03-27-2010, 05:34 AM
It does decode it. I just tried it on a different dll. Something must be wrong with sside's dll like you said.

Yes, my point was, I posted a while back that I was going to work on a plugin
allowing users to Open, call and close a library and also from a base64 encoded
string... Seems someone has been 'idea scavaging' lol :p

I'm not saying anything anymore.

Anyhow, there might be an error in calling the DLL inside the AMSWMemory plugin,
or SSide tried to prevent dll's from being included (which is possible, Un4Seen has
also embeded protection in their BASSMOD etc dll's.) but it could be anything really.

Centauri Soldier
03-27-2010, 05:42 AM
Well, that's too bad. I'll have to include sside's dll and have it written to HD at run-time.

AMSWaves
03-27-2010, 06:00 AM
i think .nets librarys cant loaded from memory, load it from HD and you see it works, but anyway this error that you post is not regular.

AMSWaves
03-27-2010, 06:31 AM
Yes, my point was, I posted a while back that I was going to work on a plugin
allowing users to Open, call and close a library and also from a base64 encoded
string... Seems someone has been 'idea scavaging' lol :p

I'm not saying anything anymore.


no no no my best friend, i never create your idea or something like stealing, from last year that i create Memory plugin my dream was create a powerful CallFunction method but anytime some trouble in programming make me unsuccessful to achieve my dream.


for base64 string, i think very well about pass dlls to my plugin and no byte of it not missing, my brain go to base64 is the best method but maybe i change it in next version.
i have many dreams about My Memory Plugin that still not achieved like calling COMs, Callbacks, ....
my mean is you are my friend if you unhappy from me im so sorry and please say me.

Imagine Programming
03-27-2010, 01:16 PM
no no no my best friend, i never create your idea or something like stealing, from last year that i create Memory plugin my dream was create a powerful CallFunction method but anytime some trouble in programming make me unsuccessful to achieve my dream.


for base64 string, i think very well about pass dlls to my plugin and no byte of it not missing, my brain go to base64 is the best method but maybe i change it in next version.
i have many dreams about My Memory Plugin that still not achieved like calling COMs, Callbacks, ....
my mean is you are my friend if you unhappy from me im so sorry and please say me.

Well, it would have been nice to have known... Because I started the project lol:p
I already had most functions ready for an advanced library plugin, but with this
in the memory plugin all that work is useless...

Still mate, I'm glad it's available, I'm just p*ssed that I wrote that code and now
I can throw it away hehe :p


Well, that's too bad. I'll have to include sside's dll and have it written to HD at run-time.

That would be the best solution, I think AMSWaves is right, .net libraries can't be
loaded from memory, when I tried that in PB the whole application crashed (not
even showing the C++ error you saw, but simply crashing on all .net dll's)

AMSWaves
04-02-2010, 03:04 PM
Hi All,
new version released with new bug fixes and new features.
this new version is very very imagine because have some methods for creating OLE Object on AMS. with this new methods now AMS can create more object from OCXs, that before it is not possible.
these methods cant handle events for now (if this methods is good maybe i try to add this on future) for now these methods are BETA so beaware and use it.
new .RunProgram function for run a program from memory.
new Subclass System that worked better, faster, smaller and less memory licking.

Changes :

New Methods For Creating COM Object(OLE Control) Beta!
New Function For Run Program From Memory With Parameters!
New Functions are .RunProgram, .CreateObject, .SetObjectProperty, .CallObjectFunction, .GetObjectProperty, .ReleaseObject.
Fixed Subclass System(routine of Subclass system rewrited from first for better working)


I create some example to create objects with OCX (see Attachment).
please test new version and post any info about COM or any Bugs.

Best Regards,
AMSWaves.

Sakuya
04-02-2010, 03:28 PM
AMS = now revolutionized.

RizlaUK
04-02-2010, 05:45 PM
wow, this really rocks big time.....

if you can get the event sink working this will be excellent

heres an example with Angle GIF, shows how to display animated gif's in AMS :yes

AMSWaves
04-02-2010, 06:14 PM
yea rizla thanks for examp, for event sink i must work more, until now all jobs get me crash but i know it is possible.

LucasTheDuck
04-06-2010, 04:15 PM
oh my god, thats great!

you rocks man!

now tabs, common controls, all of functions of this objects, everithing... great work bro!

Nice

Centauri Soldier
04-06-2010, 11:06 PM
Holy Hel*! Nice work, AMSWaves! Thank you for sharing. :yes :)

Benjamin
04-07-2010, 09:48 AM
AMSWaves, thank you very much dude for the hard work done! I love you :o

AMSWaves
04-07-2010, 02:45 PM
Thank you, your welcome.

RizlaUK
04-07-2010, 02:51 PM
hey, hows the event sink coming on

any progress ?

LucasTheDuck
04-08-2010, 01:22 PM
Very clever and nice, tons of ocx avalible with awesome functions, all of luacom needs.

For example, tabs, never used here, or other objects now can be added easily.

Some test that i've made:

Syntax editor (like scintilla, have multilang support)
http://img204.imageshack.us/img204/5829/syntax.th.png (http://img204.imageshack.us/i/syntax.png/)

Office outlook inbox (can show any folder)
http://img688.imageshack.us/img688/6489/outlook.th.png (http://img688.imageshack.us/i/outlook.png/)

Hex editor
http://img717.imageshack.us/img717/7223/hexp.th.png (http://img717.imageshack.us/i/hexp.png/)

Calendar (can display calendars like office 2007)
http://img708.imageshack.us/img708/6010/calendare.th.png (http://img708.imageshack.us/i/calendare.png/)

I have one question... I triyed Flash player and there is a method called flashvars and allowscriptaccess, I think that we can use AS3 flash files with this, wath do you think?

AMSWaves
04-08-2010, 08:33 PM
hey, hows the event sink coming on

any progress ?

Hi RizlaUK, no there is no progress for now but i think this must be possible.
until last day i didnt have any plan for updating this plugin so i decided to say this is the last version of Memory Plugin (because i think with this plugin im going to lost my friends, friends that thinks i stole their idea and friends that thinks i must create this plugin Commercial and so on) but last night one of my friends say every time complete your jobs, so yea this project still alive, this week i work on it.

AMSWaves.

AMSWaves
04-08-2010, 08:50 PM
Very clever and nice, tons of ocx avalible with awesome functions, all of luacom needs.

For example, tabs, never used here, or other objects now can be added easily.

Some test that i've made:

Syntax editor (like scintilla, have multilang support)
http://img204.imageshack.us/img204/5829/syntax.th.png (http://img204.imageshack.us/i/syntax.png/)

Office outlook inbox (can show any folder)
http://img688.imageshack.us/img688/6489/outlook.th.png (http://img688.imageshack.us/i/outlook.png/)

Hex editor
http://img717.imageshack.us/img717/7223/hexp.th.png (http://img717.imageshack.us/i/hexp.png/)

Calendar (can display calendars like office 2007)
http://img708.imageshack.us/img708/6010/calendare.th.png (http://img708.imageshack.us/i/calendare.png/)

I have one question... I triyed Flash player and there is a method called flashvars and allowscriptaccess, I think that we can use AS3 flash files with this, wath do you think?

yea you find the power of memory plugin;), i dont see these functions (flashvars and allowscriptaccess) in Flash10b.ocx, where is this function ?
and another thing if this is possible please share some of your works with us, but anyway good luck.

Imagine Programming
04-09-2010, 01:22 AM
... friends that thinks i stole their idea ...

What happend, happend. Why stop the development on a brilliant plugin now? :)
I admit I was a bit p!ssed off when I saw these functionallities appear in this
plugin, because I already wrote the procedures for it, but what can we do
about it now?

Just continue the plugin mate, it's one of the most brilliant plugins around :yes

Benjamin
04-09-2010, 02:14 AM
I have one question... I triyed Flash player and there is a method called flashvars and allowscriptaccess, I think that we can use AS3 flash files with this, wath do you think?

Maybe we have to somehow use the COM-interface IShockwaveFlash with methods: ReadyState (); TotalFrames (); Playing (); Playing (); Quality (); ScaleMode(); AlignMode (); BackgroundColor (); BackgroundColor (); Loop (); Movie (); FrameNum (); SetZoomRect (); Zoom (); etc.

IShockwaveFlash::put_Movie("the local path of .swf file");
IShockwaveFlash::Play();
IShockwaveFlash::Release();

Benjamin
04-09-2010, 03:49 AM
And some info about ActiveX: http://search.cpan.org/~mdootson/Wx-ActiveX-0.15/lib/Wx/ActiveX/Flash.pm

AMSWaves
05-09-2010, 02:12 PM
Hi all
im going to update my Plugin for AMS 8 and AMS 7.5 for supporting Event handler for COM Objects (Event Sink) and some bug fixes so if any body know any bug or any improvements please post here.
(in some day this update comes)

AMSWaves.

RizlaUK
05-09-2010, 02:56 PM
?? you got the event sink working ??

with event sink i can make great use of this :yes:yes

AMSWaves
05-09-2010, 05:12 PM
?? you got the event sink working ??

with event sink i can make great use of this :yes:yes

yea event sink working now, it is in the test procedure.;);)

Benjamin
05-10-2010, 09:31 AM
Holala! Great news! :wow

AMSWaves
05-10-2010, 10:22 AM
Hi All,
new version released, in this version many bug fixes, i try to rewrite all plugin from first (7542 line codes) for better memory using and faster speed.
i decide release it to all body so all body can test it, so all body know anything about COM programming and event sink helps me to improve COM objects because this new version maybe have some bad bug.
ChangeLog :

Fixed Bad Memory Licking in Memory.FreeStructure().
Fixed Bad return data for int64 in Memory.GetArrayData().
Fixed Bad return data for double in Memory.CallObjectFunction() and Memory.GetObjectProperty().
Fixed some issue for prevent from crashing program in COM Object's functions.
Now plugin can handle Event Sink for Objects.(Event Handler)
New Function is .GetObjectEventParam.
* Now Plugin sepretely writed for AMS V >= 8 and AMS V <= 7.5 .
Plugin rewrited from first for better memory using and faster speed (Specially in subclass, array and Function librarys).
Added DLL_RETURN_VOID value in Memory.OpenFunction() for calling functions without any return.


Please Reply and test it.
Best Regards,
AMSWaves.

Sakuya
05-10-2010, 10:36 AM
Thanks man, I'm finally going to try and get some Codejock controls working now.

jassing
05-10-2010, 10:42 AM
just some minor issues -

http://jassing.com/temp/snap61.png

AMSWaves
05-10-2010, 10:52 AM
and i forget to say, this setup contain AMSWMemory for AMS 8 and older version.

Benjamin
05-10-2010, 10:53 AM
just some minor issues -


No bug here. AMS 8.0.0.18. What you version use?


AMSWaves,

Thanks for release. I try it) Great work!

RizlaUK
05-10-2010, 11:03 AM
Thanks man, I'm finally going to try and get some Codejock controls working now.

yup, me to, iv got active dj studio as well, i could not get the events to work with luacom, maybe this is my answer



No bug here.

me either, all works fine (both AMS 7.5 ans 8)

@AMSWaves......great job :yes

i'll post some examples as i make them

AMSWaves
05-10-2010, 11:21 AM
just some minor issues -

http://jassing.com/temp/snap61.png

install it again i think it is not installed well.

AMSWaves
05-10-2010, 11:28 AM
@Sakuya, jassing, Benjamin, RizlaUK, and all body
your welcome;).

and if anybody can create example (like RizlaUK said) and post here is very good so i can see it have bug or not in Event sink routine.

sim
05-10-2010, 11:38 AM
@Sakuya, jassing, Benjamin, RizlaUK, and all body
your welcome;).

and if anybody can create example (like RizlaUK said) and post here is very good so i can see it have bug or not in Event sink routine.

Once again i don't know how to use your plugin but i seen it do so many great things so well done man.

Dermot
05-10-2010, 11:45 AM
Thanks man, I'm finally going to try and get some Codejock controls working now.
The problem with most codejock controls like the calendar is, they have multiple interfaces (objects) and there is no way I can see to access them with this plugin. LuaCom can.

For example, the calendar control has an EventChangedEx event which returns a pointer to a calendar event, or appointment named "pEvent". pEvent has it's own properties and methods.

For example I can do this with Luacom


function obj_Events:EventChangedEx(pEvent)
local sDate = pEvent:getStartTime()
local eDate = pEvent:getEndTime()
local id = pEvent:getId()
end

I can't see anyway of doing this with this plugin. The codejock calendar control has over 100 of these secondary interfaces with their own properties and methods.

This plugin works great for simple controls with single interfaces. You did a great job on the event sink. I think you should do like 1UP did with their activex control container and make it so you can link the activex container object to Luacom so that you can access the control fully using luacom. You can try 1UP in AMS 8 and you will see how they link it to Luacom. Works really well. Of course you can't put an activex control on an AMS window using 1UP, only 1UP windows.

AMSWaves
05-10-2010, 12:16 PM
Once again i don't know how to use your plugin but i seen it do so many great things so well done man.

thanks sim, work with this plugin is very easy, i try to create this plugin as easy as possible. just read its help file and if have any question post here.

AMSWaves
05-10-2010, 12:21 PM
The problem with most codejock controls like the calendar is, they have multiple interfaces (objects) and there is no way I can see to access them with this plugin. LuaCom can.

For example, the calendar control has an EventChangedEx event which returns a pointer to a calendar event, or appointment named "pEvent". pEvent has it's own properties and methods.

For example I can do this with Luacom


function obj_Events:EventChangedEx(pEvent)
local sDate = pEvent:getStartTime()
local eDate = pEvent:getEndTime()
local id = pEvent:getId()
end

I can't see anyway of doing this with this plugin. The codejock calendar control has over 100 of these secondary interfaces with their own properties and methods.

This plugin works great for simple controls with single interfaces. You did a great job on the event sink. I think you should do like 1UP did with their activex control container and make it so you can link the activex container object to Luacom so that you can access the control fully using luacom. You can try 1UP in AMS 8 and you will see how they link it to Luacom. Works really well. Of course you can't put an activex control on an AMS window using 1UP, only 1UP windows.

thanks for info i write this plugin with my info about COMs so all body must help me to improve this plugin, please if you can create a example about codejock calendar (or any object if it payware) that have many interfaces with luacom so i can see how it works then maybe can improve my plugin.

Imagine Programming
05-18-2010, 05:17 PM
AMSWaves, ahum.... THANKYOU! :yes hehe :p

hi1sin
07-25-2010, 08:48 AM
read / write process memory is possible ?

also

AMS DLL.Call function call kernel32.dll ReadProcessMemory function is possible?

RizlaUK
07-25-2010, 10:55 AM
Hacker Alert!!

if you can provide a valid reason why you would want to read/write to another applications memory addresses then i may consider helping, but it all sounds very suspect to me!!

hi1sin
07-25-2010, 11:12 AM
oh man!

I get game integer,

i trying made game trainer

i use Cheat engine and i pass cheat engine tutorial, but i need read application offset

http://img341.imageshack.us/img341/7932/readmemory.png

kjh
09-02-2010, 02:59 PM
Hi AMSWaves
By accident i discovered that it is possible to use the memory plugin in an easy way.
Sample code:

Memory.TblTest={"Bananas","Apples"}
Dialog.Message(type(Memory.TblTest),Table.Concat(M emory.TblTest, ";", 1, TABLE_ALL))
-- returns a normal concated string "Bananas;Apples"

Memory.TblTest=nil
Dialog.Message("",type(Memory.TblTest))
-- returns "nil"

I find this way to use the Memory plugin very useful (and easy), but before I go on with testing the question is:
is the allocated memory actually freed by setting the used variabel to 'nil'.?

I hope you will find the time for an answer, thanks in advance.

Sakuya
09-02-2010, 03:32 PM
Hi AMSWaves
By accident i discovered that it is possible to use the memory plugin in an easy way.
Sample code:

Memory.TblTest={"Bananas","Apples"}
Dialog.Message(type(Memory.TblTest),Table.Concat(M emory.TblTest, ";", 1, TABLE_ALL))
-- returns a normal concated string "Bananas;Apples"

Memory.TblTest=nil
Dialog.Message("",type(Memory.TblTest))
-- returns "nil"

I find this way to use the Memory plugin very useful (and easy), but before I go on with testing the question is:
is the allocated memory actually freed by setting the used variabel to 'nil'.?

I hope you will find the time for an answer, thanks in advance.

You can do that with anything..


Application.ExampleTable = {"stuff", "more stuff", "even more stuff"};
Dialog.Message("Example", "Entries in table: "..#Application.ExampleTable);

Application.ExampleTable = nil;
collectgarbage(); -- forcefully invoke garbage collection to free memory.
Dialog.Message("Example", "Type: "..type(Application.ExampleTable));

kjh
09-02-2010, 04:18 PM
Thank you.

RizlaUK
09-03-2010, 08:41 AM
is the allocated memory actually freed by setting the used variabel to 'nil'.?

NO, the memory address will no longer be available to the application but it will still exists in the systems memory (this is called a *Memory Leak*)

you need to free the allocated memory buffer before setting the variable to nil to avoid leaks :yes

EDIT:

huh?, in your code, you are not allocating memory, you are simply using a lua table ??

kjh
09-03-2010, 06:59 PM
I am just declaring a lua-table, e.g. Memory.MyTable={} or a Memory.StringVar="Something" and it works.
Maybe the plugin itself has a lua-table structure whitch handles the different functions, and makes this possible?

But the question is still if there will be a memory leak, if not its an easy way to handle variabels for use in dialogex and so on

Thanks for your reply.

analogscott
11-03-2010, 03:04 PM
I've looked through these threads on the AutoIt plug, but seem to be the only one having this issue.

When i run AutoIt_Example.am7 and compile it, i get On Preload, Line 40:attempt to call field 'OpenLibrary' (a nil value)

I haven't changed the default layout of the accompaning files, anybody have an idea? (i'm running AMS7.5, Windows 7 Ult x64)