Welcome, Guest. Please login or register.

Author Topic: Executing c command in c  (Read 10379 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline nyteschayde

  • VIP / Donor - Lifetime Member
  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 643
    • Show all replies
    • http://www.nyteshade.com
Re: Executing c command in c
« on: June 03, 2017, 04:44:49 AM »
Somewhat related, I am curious if anybody knows how power packer and similar crunchers work. From what I understand, they compress an executable and attach the compressed binary to program that decompresses and then *executes* the decompressed contents.

There are clearly several things happening here, but ultimately, the code from the cruncher needs to kick off the uncompressed binary. Since the compressed executable contents are attached to the decompressor binary, it would make sense that the binary needs to read itself and extract some code to memory.

My question is how does one execute arbitrary binary from within one's program.
Senior MTS Software Engineer with PayPal
Amigas: A1200T 060/603e PPC • A1200T 060 • A4000D 040 • A3000 (x2) • A2000 Vamp/V2 • A1200 (x4) • A1000 (x3) • A600 Vamp/V1 • A500