Jump to content
View in the app

A better way to browse. Learn more.

Tuts 4 You

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Decrypt File Into Memory

Featured Replies

Posted

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 :unsure:

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

  • 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 :rolleyes:

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

Edited by Ziggy

  • 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 :wub::D

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/to
Dim c As Integer, retval As Long ' counter variable & return value
Dim hMem As Long, pMem As Long ' handle and pointer to memory block' Initialize the source array s()'s data
For c = 0 To 255
s© = 2 * c ' each element equals double its index
Next 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 it
pMem = 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 it
CopyMemory 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 resources
x = GlobalUnlock(hMem)
' Free the memory block (de-allocate it)
x = GlobalFree(hMem)' Verify that t() = s(), which it should
For c = 0 To 255
If s© <> t© Then Debug.Print "Copy attempt failed."
End If

I'm no VB'er but it looks ok to me.

Z

Ziggy the Asm Guru! :thumbsup:

@Matrix

if the file is too big , then you can use Global Alloc [like Ziggy said] and

read first block from file to Buffer,

decrypt

write decrypted block to file

read next block from file to Buffer,

decrypt

write next block to file

.... continue until last

PS* Assuming that you will need to save a decrypted file since you have encrypted it

Edited by starzboy

i think what he wanted is to Execute a crypted file on memory , dude see P0ke crypter if you in delphi.

  • 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 :unsure: ?

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.