Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8693949
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T00:39:55+00:00 2026-06-13T00:39:55+00:00

I just tried the following code snippet for shellcode testing purposes:- #include<iostream> using namespace

  • 0

I just tried the following code snippet for shellcode testing purposes:-

#include<iostream>

using namespace std;

char sc[] = ""; #i've removed the shellcode
int main() {
    int (*func)();
    func = (int(*)())sc;
    (int)(*func)();
}

I get a build error on compilation :-

------ Build started: Project: shellcoderunner, Configuration: Debug Win32 ------
Build started 10/15/2011 12:51:16 PM.
InitializeBuildStatus:
  Touching "Debug\shellcoderunner.unsuccessfulbuild".
ClCompile:
  blah.cpp
c:\users\reverser\documents\visual studio 2010\projects\shellcoderunner\shellcoderunner\blah.cpp(7): error C2440: 'type cast' : cannot convert from 'char [149]' to 'int (__cdecl *)(void)'
          There is no context in which this conversion is possible

Build FAILED.

Time Elapsed 00:00:01.99
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Something obvious that I’m doing wrong?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T00:39:56+00:00Added an answer on June 13, 2026 at 12:39 am

    To execute a shellcode in your C/C++ program with VS, the simplest way is embedding an Assembly code like this example below:

    char* buffer="blah blah blah";
    int main() {
        __asm{
            lea eax, buffer
            call    eax
        }
    }
    

    Hope this help!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I just tried disassembling some shellcode using disasm and I found the following statement
I've just tried the following code snippet in a groovy console import org.yaml.snakeyaml.Yaml o
I just tried the following code, but the result seems a little strange. It
I tried to use the following code snippet in the PreRender event to change
I was surprised when I just tried the following PHP code: function foo() {
The following code: #include <boost/variant.hpp> #include <iostream> #include <string> struct A { A() {
Just to experiment assembly in C++, I tried the following, which is causing the
I tried to use dat.GUI in the following three.js example . I just did
I was using the following code to retrieve HTML snippets from a database table
The following snippet of code works most of the time, except in certain windows.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.