Posted September 18, 200717 yr Hi Freind i encrypted a file with AES algorithm and i want decrypt it into Memory via a Program, i don`t want make any temp file . plz help me
September 18, 200717 yr Use the heap. You can grab all the temporary memory you need and decrypt inside the program then release the memory.see reference to the Windows api GlobalAllocZ
September 19, 200717 yr Author Use the heap. You can grab all the temporary memory you need and decrypt inside the program then release the memory.see reference to the Windows api GlobalAlloc Z Hi Friend tanx , may you give me a example from Visual Basic , because i am beginner
September 19, 200717 yr hmmm.. I code in MASM, C and Delphi. I don't have an example using Visual Basic - sorry. Maybe another forum member may have an example. Maybe a Google will find some examples for you.cheersZ Edited September 19, 200717 yr by Ziggy
September 19, 200717 yr Author hmmm.. I code in MASM, C and Delphi. I don't have an example using Visual Basic - sorry. Maybe another forum member may have an example. Maybe a Google will find some examples for you. cheers Z Tnax a lot of my Friend
September 19, 200717 yr Here is what a Google turned up. A nice simple example.' Use a block of memory as an intermediary step to copy' the contents of array s() to array t(). Yes, you could copy them directly,' but this demonstrates a few different memory functions.Dim s(0 To 255) As Integer, t(0 To 255) As Integer ' arrays to copy from/toDim c As Integer, retval As Long ' counter variable & return valueDim hMem As Long, pMem As Long ' handle and pointer to memory block' Initialize the source array s()'s dataFor c = 0 To 255 s© = 2 * c ' each element equals double its indexNext c' Allocate a moveable block of memory (returns a handle) (Integer type = 2 bytes)hMem = GlobalAlloc(GMEM_MOVEABLE Or GMEM_ZEROINIT, 256 * 2)' Lock the memory block, returning a pointer to itpMem = GlobalLock(hMem)' Copy the entire contents of s() to the memory block' Note that pMem is ByVal because we want its contents, not a pointer to itCopyMemory ByVal pMem, s(0), 256 * 2' Copy the contents of the memory block to t() (we could have just copied s() to t())CopyMemory t(0), ByVal pMem, 256 * 2' Unlock the memory block, destroying the pointer and freeing resourcesx = GlobalUnlock(hMem)' Free the memory block (de-allocate it)x = GlobalFree(hMem)' Verify that t() = s(), which it shouldFor c = 0 To 255 If s© <> t© Then Debug.Print "Copy attempt failed."End IfI'm no VB'er but it looks ok to me.Z
September 21, 200717 yr @Matrixif the file is too big , then you can use Global Alloc [like Ziggy said] and read first block from file to Buffer,decryptwrite decrypted block to fileread next block from file to Buffer,decryptwrite next block to file.... continue until lastPS* Assuming that you will need to save a decrypted file since you have encrypted it Edited September 21, 200717 yr by starzboy
September 22, 200717 yr i think what he wanted is to Execute a crypted file on memory , dude see P0ke crypter if you in delphi.
September 22, 200717 yr Author i think what he wanted is to Execute a crypted file on memory , dude see P0ke crypter if you in delphi. yes i want execute a crypted file on memory and use VB , can you help me dear ?
September 23, 200717 yr simply you cant you know why there is no Power in vb meaning POINTERS are not supported in VB try CPP or delphi.
Create an account or sign in to comment