int _init(unsigned int a0, unsigned int a1, unsigned int a2, unsigned int a3, unsigned int a4, unsigned int a5, unsigned long long v1, unsigned long long a6, unsigned long long a7, unsigned long long a8, unsigned long long a9, unsigned long a10)
{
    char v0;  // [bp+0x0]

    return;
    if (false)
    {
        0(a0, a1, a2, a3, a4, a5, *((long long *)&v0), v1, a6, a7, a8, a9);
        return;
    }
}

long long sub_401020()
{
    void* v0;  // [bp-0x8]

    v0 = 0;
    goto *((long long *)4210704);
}

extern unsigned long long __libc_csu_fini;
extern unsigned long long __libc_csu_init;
extern unsigned long long main;

long long _start()
{
    unsigned long v0;  // [bp+0x0], Other Possible Types: unsigned long long
    unsigned long v1;  // [bp+0x8]
    unsigned long long v2;  // rsi
    unsigned long v3;  // rax
    unsigned long long v4;  // rdx

    v2 = v0;
    v0 = v3;
    __libc_start_main(&main, v2, &v1, &__libc_csu_init, &__libc_csu_fini, v4); /* do not return */
}

// No decompilation output for function sub_4010ee

extern char stdout;

int deregister_tm_clones()
{
    return;
    if (false)
    {
        return;
    }
}

long long register_tm_clones()
{
    return 0;
    if (false)
    {
        return 0;
    }
}

extern unsigned long long __dso_handle;
extern char completed.7393;

long long __do_global_dtors_aux()
{
    unsigned long v0;  // [bp-0x8]
    unsigned long v2;  // rax

    if (completed.7393 == 0)
    {
        v0 = stack_base + 0;
        completed.7393 = 1;
        return deregister_tm_clones();
        if (false)
        {
            *((long long *)4210680)(__dso_handle);
            completed.7393 = 1;
            return deregister_tm_clones();
        }
    }
    else
    {
        return v2;
    }
}

long long frame_dummy()
{
    return register_tm_clones();
}

int dramatic(unsigned int a0)
{
    unsigned int v0;  // [bp-0xc]

    for (v0 = 0; v0 < a0; v0 += 1)
    {
        sleep(0x1);
        putchar(0x2e);
    }
    putchar(0xa);
    return;
}

int compute()
{
    unsigned long long v0;  // [bp-0x58]
    unsigned long long v1;  // [bp-0x50]
    unsigned long long v2;  // [bp-0x48]
    unsigned long long v3;  // [bp-0x40]
    unsigned long long v4;  // [bp-0x38]
    unsigned long long v5;  // [bp-0x30]
    unsigned long long v6;  // [bp-0x28]
    unsigned long long v7;  // [bp-0x20]
    unsigned int v8;  // [bp-0x18]
    unsigned short v9;  // [bp-0x14]

    v2 = 8316213806999365716;
    v3 = 2340008645668859424;
    v4 = 2334397743343431545;
    v5 = 7597404485453182565;
    v6 = 7594793484668659566;
    v7 = 7595448454050116967;
    v8 = 1970217075;
    v9 = 116;
    v0 = strlen(&v2);
    v1 = malloc(0x14);
    SHA1(&v2, v0, v1, v0);
    return v1;
}

extern unsigned long long stdout;

int main(unsigned int a0, unsigned long a1)
{
    unsigned long v0;  // [bp-0x28]
    unsigned int v1;  // [bp-0x1c]
    unsigned int v2;  // [bp-0x14]
    char *v3;  // [bp-0x10]

    v1 = a0;
    v0 = a1;
    setbuf(stdout, NULL);
    printf("Performing intense computation");
    dramatic(0x3);
    v3 = compute();
    printf("FLAG-");
    raise(0xb);
    for (v2 = 0; v2 <= 19; v2 += 1)
    {
        printf("%02x", v3[v2]);
    }
    putchar(0xa);
    return 0;
}

long long __libc_csu_init(unsigned int a0, unsigned long long a1, unsigned long long a2, unsigned int a3, unsigned int a4, unsigned int a5)
{
    char v0;  // [bp-0x30]
    char v1;  // [bp-0x28]
    char v2;  // [bp-0x8]
    unsigned long long v6;  // rdi
    void* v9;  // rbx
    unsigned long long v10;  // rax

    if (false)
    {
        return _init(v6, a1, a2, a3, a4, a5, *((long long *)&v0), *((long long *)&v1), v6, a1, a2, *((long long *)&v2));
    }
    v9 = 0;
    while (true)
    {
        v10 = *((long long *)(4210120 + rbx<8> * 8))(v6, a1, a2);
        v9 += 1;
        if (v9 == 1)
        {
            break;
        }
    }
    return v10;
}

long long __libc_csu_fini()
{
    unsigned long v1;  // rax

    return v1;
}

long long _fini()
{
    unsigned long v1;  // rax

    return v1;
}

 

C++ Online Compiler

Write, Run & Share C++ code online using OneCompiler's C++ online compiler for free. It's one of the robust, feature-rich online compilers for C++ language, running on the latest version 17. Getting started with the OneCompiler's C++ compiler is simple and pretty fast. The editor shows sample boilerplate code when you choose language as C++ and start coding!

Read inputs from stdin

OneCompiler's C++ online compiler supports stdin and users can give inputs to programs using the STDIN textbox under the I/O tab. Following is a sample program which takes name as input and print your name with hello.

#include <iostream>
#include <string>
using namespace std;

int main() 
{
    string name;
    cout << "Enter name:";
    getline (cin, name);
    cout << "Hello " << name;
    return 0;
}

About C++

C++ is a widely used middle-level programming language.

  • Supports different platforms like Windows, various Linux flavours, MacOS etc
  • C++ supports OOPS concepts like Inheritance, Polymorphism, Encapsulation and Abstraction.
  • Case-sensitive
  • C++ is a compiler based language
  • C++ supports structured programming language
  • C++ provides alot of inbuilt functions and also supports dynamic memory allocation.
  • Like C, C++ also allows you to play with memory using Pointers.

Syntax help

Loops

1. If-Else:

When ever you want to perform a set of operations based on a condition If-Else is used.

if(conditional-expression) {
   //code
}
else {
   //code
}

You can also use if-else for nested Ifs and If-Else-If ladder when multiple conditions are to be performed on a single variable.

2. Switch:

Switch is an alternative to If-Else-If ladder.

switch(conditional-expression){    
case value1:    
 // code    
 break;  // optional  
case value2:    
 // code    
 break;  // optional  
......    
    
default:     
 code to be executed when all the above cases are not matched;    
} 

3. For:

For loop is used to iterate a set of statements based on a condition.

for(Initialization; Condition; Increment/decrement){  
  //code  
} 

4. While:

While is also used to iterate a set of statements based on a condition. Usually while is preferred when number of iterations are not known in advance.

while (condition) {  
// code 
}  

5. Do-While:

Do-while is also used to iterate a set of statements based on a condition. It is mostly used when you need to execute the statements atleast once.

do {  
 // code 
} while (condition); 

Functions

Function is a sub-routine which contains set of statements. Usually functions are written when multiple calls are required to same set of statements which increases re-usuability and modularity. Function gets run only when it is called.

How to declare a Function:

return_type function_name(parameters);

How to call a Function:

function_name (parameters)

How to define a Function:

return_type function_name(parameters) {  
 // code
}