Questions tagged [c++]

C++ is a statically typed, free-form, multi-paradigm, compiled, general-purpose programming language. It is considered an intermediate level language.

Filter by
Sorted by
Tagged with
1
vote
1answer
192 views

How do I map the std::_Ios_Openmode passed to basic_fstream to an actual value?

I am working on some ARM disassembly. A file is being operated on: 0000e550 sub r3, r11, #0x2d0 0000e554 mov r0, r3 ; /tmp/MAC 0000e558 ldr r1, = 0x9a60c ; 0xec04 (sub_e3a8 + 0x85c) ...
6
votes
1answer
3k views

How to recover the exception info from .gcc_except_table and .eh_handle sections?

For C++ program with try catch defined, when using g++ to compile it into assembly code (test is on x86 32bit Linux, g++ 4.6.3) g++ -S cppexcept.cc A specified section called .gcc_except_table is ...
7
votes
2answers
3k views

How to recover information stored in .ctors section?

Test is on x86, 32-bit Linux. I am using g++ 4.6.3 and objdump 2.22 Here is a simple C++ code I am working on: #include <iostream> using namespace std; main() { cout << "Hello ...
-1
votes
2answers
753 views

Add Section to pe file function error [closed]

I'm having some strange errors with the following function which adds a section to a pe executable. When I run the program I get the success message, when I proceed to try to open the executable in ...
7
votes
0answers
813 views

Red Alert 2 Windows 8 DirectDraw compatibility

The game Red Alert 2 runs on Windows 8, but as soon as I inject a DLL (via ddraw.dll or an extra DLL) it stops drawing buttons on the main menu. With the DLL it still work fine in windowed mode and it ...
1
vote
0answers
91 views

VLAs in C++ - seemingly nonsential compiler code [duplicate]

I've been wondering, why all the hassle with variable length arrays (such as int x[n])? Theoretically, it's just another local variable, so it's merely a matter of subtracting the appropriate value ...
4
votes
2answers
1k views

Import functions from executable

I've injected a DLL into an existing game. I can import functions and variables like this: typedef const wchar_t* (__fastcall *get_string_t)(const char*, int, const char*, int); get_string_t ...
1
vote
2answers
203 views

Reassembler toolchain

I'm looking for tools to: Disassemble a function from a x86 Windows executable into an asm file. Edit the file. Assemble the file again into an object file that can then be linked into a DLL. Inject ...
1
vote
1answer
916 views

Using a DLL proxy fails due to an unknown error

I'm using a dll proxy with the code described here, but having tons of trouble. First, I use VS2012 on Windows 7 and the target is on Windows XP. So I needed to: Install VCRedist on the target ...
2
votes
2answers
794 views

How to programmatically identify binary calling convention?

I have a problem where I'm instrumenting stripped binaries; I don't know the start of main(). But there's always an init(), and init() calls libc_start_main(), which receives a pointer to main. If I ...
5
votes
1answer
6k views

Get section's names and headers for a file using C++

I'm implementing a software for performing some PE classification. Among the features values I'm gathering from each PE are, the ammount of sections, the name of sections, image section headers. I ...
1
vote
2answers
332 views

Does MSVCXXX.dll means that the PE file is compiled by Microsoft Visual C?

While viewing the PE headers and imported functions of some programs designed with visual C. I found that they all include one of these functions: MSVCRT.DLL MSVCR80.DLL MSVCR90.DLL MSVCR100D.DLL ...
8
votes
1answer
7k views

How to find the location of the vtable?

Actually, I am trying to learn a little about vtable overflows. So, my learning documents state the following: The main point to realize is that whenever we declare a C++ class with virtual ...
4
votes
1answer
999 views

Why did the program entry point become 'sub esp, 1C'?

I compiled the following C++ code with MinGW and opened it in OllyDbg 2.01. And the program stops at the following lines: CPU Disasm Address Hex dump Command ...
3
votes
1answer
1k views

Interacting with command line programs in Hopper disassembler (Mac OS 10.9)

To test the debugging capabilities of Hopper, I wrote a simple C++ command line application, and tried to run it on the remote debugging server (with gdb). However, I learned after I failed to be able ...
0
votes
2answers
450 views

Questions about reversing object oriented code(initializing vtables in ctors)

I was reversing some C++ code and encountered following function. sub_106C0A0 proc near var_10= dword ptr -10h var_C= dword ptr -0Ch var_4= dword ptr -4 push 0FFFFFFFFh push offset ...
4
votes
6answers
8k views

How to match disassembled instructions back to C/C++ source?

Basically here's what I want to know, if you have a disassembled instruction say: jz 0x8048e1a And, you also have the source code. How do you go about figuring out what this instruction relates to ...
4
votes
3answers
1k views

compiled binary - what do disassembled instructions correspond to in C/C++ source (Linux GCC)

sorry about the messy title! Basically here's what I want to know. This might sound a bit silly but, if you have a disassembled instruction say: jz 0x8048e1a and you also have the source code, how ...
0
votes
1answer
248 views

C++/C++11/C++0x in application to Reverse-engineering [closed]

Is there any libraries for Reverse engineering/exploitation for the C++11/C++/C programming language ? I am currently learning C based languages and would like to know if there are any libraries for ...
2
votes
1answer
1k views

Custom UI buttons

I just started using IDA and OllyDbg, although I am experienced developer but before this I was reverse engineering only Java and .Net code which is much more easy task comparing of what I need to do ...
7
votes
2answers
15k views

What is a non-virtual thunk?

In real code I have encountered some "non-virtual thunk" functions: ; `non-virtual thunk to'QTextCodecPlugin::create(QString const&) EXPORT _ZThn8_N16QTextCodecPlugin6createERK7QString ...
4
votes
1answer
5k views

How can a format string vulnerability be used to write a specific string into memory?

I think I understand how a format string vulnerability works, but what I have seen so far it can only be used to increase the value of an integer. Can format string vulnerability also be used to ...
4
votes
2answers
4k views

Where the pointer to virtual function table is located?

I used to think that the pointer to the Virtual Function Table (VFT, also Virtual Method Table, VMT) is the very first 32-bit word of the object binary representation. But now I see a VFT whose index ...
3
votes
3answers
1k views

Insert logging into existing binary code, ARM

I want to add logging to some function(s) in the shared (.so) library. (ARM, Android, a mix of Arm and Thumb modes; C++, some functions are virtual and therefore nameless, invoked via VFT.) Does ...
3
votes
2answers
4k views

What is operator new(unsigned int)?

In the disassembler output (ARM) I see: BLX _Znwj where BLX is ARM procedure call and _Znwj is demangled as $ c++filt _Znwj operator new(unsigned int) What does that operator new do? Is it ...
1
vote
0answers
391 views

Calling Lua by C/C++ in compiled applications

So, currently I've been reverse engineering an application, that allows Lua coding. Because for some special purposes, I need to call Lua directly by C/C++ coding. However, as this application is ...
6
votes
1answer
2k views

Why two virtual destructors?

The beginning of the virtual function table (VFT, also virtual method table, VMT) disasembled by IDA goes as: _ZTV13QSystemLocale DCD 0, _ZTI13QSystemLocale, _ZN13QSystemLocaleD2Ev+1, ...
5
votes
2answers
954 views

What is stored in typeinfo (GNU C++, Android NDK, ARM)

IDA annotates some items as: typeinfo for _classname_. What is that typeinfo, is it the same as type_info? What information may be extracted from it? (e.g. I'd like to know the object size or virtual ...
2
votes
2answers
500 views

What is stored in the virtual function table? (Android NDK, GNU C++)

I see that the virtual method table (VMT, a.k.a. VFT) contains some odd values, e.g.: obj:0x123c1a8 [704] vmt:0x611f77f8 data: 0123c1a8 f8 77 1f 61 00 96 23 01 00 00 00 00 c4 e0 b4 5c 00 00 00 00 00 ...
7
votes
1answer
253 views

Disassemble communication protocol for an old device

I have an old device connected to personal computer via specific PCI card. Device is handled with C++ control application, which is not able to run on new versions of Windows. Manufacturer of that ...
5
votes
1answer
4k views

Find the C++ STL functions in a binary

I have a binary file (actually, an operating system for an ARM embedded device which also contains some high-level apps (hard coded in the user interface)). I know some parts of the operating system ...
3
votes
2answers
563 views

How to compile c, cpp and python code as “Released/Final” version?

I want to know if there are ways to compile C, C++ and Python code in order to not be able to reverse engineering it over Linux or not? I have heard there are some ways over Windows to do it, but I ...
2
votes
2answers
1k views

Reversing simple hello world in C++ [closed]

Can someone explain me why a simple C++ application - #include <iostream> int main() { std::cout << "Hello world!"; return 0; } compiled with MSVC 2012 looks very weird in IDA / ...
3
votes
2answers
957 views

Forcing a call to an object instance method

I've instrumented an application using Frida.RE. I can hook the constructor of a C++ class of my interest, let's call this MyClass::MyClass(). I want to call the non-static MyClass::SomeMethod() on ...
1
vote
1answer
1k views

Why is mhook failing to hook my function?

So I'm exploring mhook 2.3 and have build a sample executable specifically for this purpose. I have an injector that injects a dll containing mhook into the target process. This all works ...
1
vote
2answers
4k views

How to find how global variables defined in binary

In Visual Studio I have written simple code, int pranit = 2; int& sumit = pranit; int main(int argc, char** argv) { sumit++; return sumit; } I used OllyDbg to Disassamble, but I am not ...
9
votes
9answers
6k views

Is it “theoretically” possible/impossible to reverse any binary?

I know that reverse engineering from binary to source code (e.g. C++) is generally considered hard or impossible but has any computer scientist actually proven "mathematically" that it's impossible or ...
-2
votes
1answer
2k views

How can I locate exported functions of an EXE or DLL? [closed]

I am trying to do some experimenting with certain system files (DLLs, EXEs) in Windows and would like to know how I can get information about the functions that they contain. I want to be able to call ...
9
votes
1answer
974 views

What does this memory pattern pointing from the thread-local storage mean?

An application I am currently looking add is using Threads and accessing something via the thread-local storage. It is compiled with Visual C++ (probably 6.0). First question would be, where can I ...
10
votes
1answer
528 views

Are those code snippets and file paths in a C++ binary some sort of standard debug information?

This C++ binary has code snippets and paths to sourcecode files everywhere, which is probably some sort of debug info. Is this something standard? (Is this RTTI) If so, how is this called? Are there ...
10
votes
1answer
5k views

Dll injection and GetProcAddress with the winapi

So i just read a little bit about how one would go about for injecting a dll into a running program on Wikipedia (the CreateRemoteThread idea). I followed the steps described and eventually got it ...
5
votes
1answer
344 views

How to find event functions called by UI components in a C++/DirectX program

I have a program written in C++ with DirectX (as far as I know). The user interface has menus with buttons and other UI components. To automate a process I would like to find the function called by an ...
7
votes
1answer
4k views

BYTE3, does it mean the third or fourth byte of an int? IDB file that's already supplied

I've got a program that i'm trying to debug a little bit by trying to make sense of a function or two, there's already some info that i've downloaded via a idb file and it's helped me get somewhere. ...
9
votes
1answer
3k views

Filling C++ interface method names in the disassembly in IDA

I have a C++ header with interfaces (classes with all methods pure virtual). I also have a binary which returns pointers to these interfaces. I debugged while running and received the virtual table ...
8
votes
3answers
4k views

Hook end/middle of function

How could I hook anywhere but the beginning of a function? I'm trying to add features to a third party executable, and I need it to execute it's code completely, then pass its data onto my function. I ...
4
votes
1answer
3k views

How to reverse command line arguments?

I am working on a console windows executable. So far what I figured out is that the executable checks number of command line arguments. Afterwards, it branches out depending on the number of arguments ...
6
votes
2answers
979 views

Making Visual C++ harder to reverse engineer

This is similar in nature to this question and this question; I'm interested in what compiler settings to enabled/disable to make a Visual C++ harder to reverse engineer. Here's a few compiler flags ...
5
votes
3answers
1k views

Determining if a variable is local or an argument passed to a function

How can you determine if a variable is a local variable of the function or an argument passed to the function?
8
votes
1answer
3k views

Encrypting text in binary files

Text strings are usually easily read in a binary file using any editor that supports ASCII encoding of hexadecimal values. These text snippets can be easily studied and altered by a reverse engineer. ...
28
votes
1answer
8k views

What kinds of steps can I take to make my C++ application harder to reverse engineer?

If I am building a C++ application and I want to make it more difficult to reverse engineer, what steps can I take to do this? Does the choice of compiler affect this? What about compiler flags, ...

1
3 4 5
6
7