Questions tagged [c]

General purpose programming language that uses the procedural and structured programming paradigm.

Filter by
Sorted by
Tagged with
0 votes
1 answer
90 views

What is the output for this and how?

*(_BYTE *)(Key + Integer_count - 1) + 79 Here : Key = 0x22EC278 (dw 'Âx') or Stack[000015B8]:0019FC2C db 78h ; x Stack[000015B8]:0019FC2D db 0C2h ; Â Stack[000015B8]:0019FC2E db 2Eh ; . Stack[...
1 vote
1 answer
50 views

Why this x64 shellcode doesn't work?(segmentation fault)

I found a simple shellcode on the internet. Then, to test this shellcode, I make the simple ret overwrite code. test.c #include <stdio.h> #include <string.h> char buf[100]; int main(void)...
  • 35
2 votes
1 answer
87 views

Linux Kernel for embedded platform - Available Sources but no configuration

I am trying to recompile the kernel for the Redmi Note 4 (MTK). I have successfully obtained a copy of the stock, pre-compiled kernel, and a variant of sources that seems to coincide quite well with ...
1 vote
0 answers
61 views

Does AnyOne knows how to reverse python file that is encoded into elf binary .cpython-310.so extension? Please Help me Out

Following is the link to the file that I want to reverse. This is the python file that is encoded in cpython or cython and it is now a binary file. Please help me to decode it as it is very important ...
4 votes
1 answer
74 views

Check if libc.so use tcache

I have ARM libc.so (GLIBC), How can I check if that libc.so used tcache, and what is the value of arena_max? Can I check that information offline?
  • 151
3 votes
2 answers
86 views

Reversing rodata

I'm playing with an ELF binary to learn IDA, and I'm not sure how to interpret what I'm seeing.. A function calls this: v1 = MList[2 * result]; When I look at MList, it looks like this: public MList ...
1 vote
0 answers
76 views

Binary Exploitation

I am trying to learn binary exploitation. I can modify the binary behaviour with gdb, but I have not understood how to exploit the binary in C. I've found some references on "Hacking - the art of ...
  • 21
0 votes
1 answer
75 views

What was the original math operation after optimizing compiler?

I'm pretty sure that original code was much simpler: (((x + 16) >> 31) ^ abs(x + 16) & 3) + 4 * ((y + 16) % 4) - ((x + 16) >> 31) Looks like division with remainder... Any ideas what ...
1 vote
0 answers
56 views

How to do a Mifare Classic Replay attack

I'm learning for the university and have to do a Mifare Classic replay attack. I don't really know how to do that and hope some of you can help me at least a bit. The goal is to get the number of ...
user avatar
1 vote
1 answer
48 views

How to interpret this __ctype_b based predicate?

I am getting this simplified function from the decomplication results of Ghidra, and I am having a hard time interpreting what the predicate would evaluate to since I do not have access to __ctype_b ...
2 votes
0 answers
33 views

Data placement in memory

I am playing with buffer overflow attacks in C. I have the following code: int foo(void*, void*); // Calculates the distance (in bytes) between two addresses in memory int main(int argc, char**...
2 votes
0 answers
210 views

How would I crack a software that has Xor encryption

So, before you shout at me to go on google I would just like to say I am new to reverse Engineering. Like I have been doing it for a hour. So, I was doing a bunch of crackmes.one using the search all ...
0 votes
0 answers
174 views

ZTE F680L V6.0 GPON firmware extraction JFFS2 decrypt AES key

Hi guys i have unpacked the firmware ZTE F680L v6.0 with binwalk -Me and have extracted the jffs2 You can find the firmware image here. Inside we have an /etc folder with some db_default_cfg.xml which ...
0 votes
0 answers
592 views

How can i get the address of a function in memory?

I am currently completing a CTF exercise where i must attempt to overwrite a function pointer on the stack through a buffer overflow here is the code: #include <err.h> #include <stdio.h> #...
2 votes
1 answer
760 views

How do I Decompile .Pyd file made with python, cython and pyinstaller 3.6

I created an app in 2018 with python and then used Cython and pyinstaller v 3.6. I am wondering how to decompile it. I have tried uncompyle6 + pyinstxtractor however this only works for python files,...
0 votes
1 answer
276 views

PE FILE section read in C

I need to read PE file. I need to search word in PE file. Search is required to cover only the sections with the “executable” flag. And I need to specify the section where the word found. How can I do ...
1 vote
0 answers
142 views

Finding the main function on Windows compiled executables

For a C/C++ program compiled on Windows using the x86 architecture, what is the best way to find the main function within disassembled code without relying on signatures such as FLIRT? I've found ...
  • 21
0 votes
0 answers
53 views

Is there any available source code which is Windows 64 bit compatible that can disassemble binary code?

I'm writing a program that takes as input a single byte of binary (machine code from code segment) and converts it into assembly. I've done some searching online but have yet to find anything helpful. ...
  • 1
0 votes
0 answers
40 views

Where can I get source code for ASCII graph parser?

My plan is to see source code graph in vim of doxygen. I almost use TUI on Linux. So, Where can I get C, Python based source code for ASCII graph parser?
1 vote
1 answer
120 views

Python or C for a Qt application and security against reverse engineering

I actually have two choices : C or Python to create my application. On my application users will need a key (on start) to access it, the key will be verified with an algorythm on the user's computer. ...
  • 113
2 votes
0 answers
132 views

What hints can x86 disassembly give as to GCC/G++ compiler version and options?

I've taken an interest to disassembling binaries and attempting to recreate 1:1 source code (logic) in C and C++ compiled with GCC. I say "logic" because this question does not pertain to ...
1 vote
1 answer
98 views

C instruction causing an address shift

I am trying to recreate a segment of assembly back into the C code. Below is the progress I've made so far, but I'm getting stumped on a specific section. 00000000000010049 <mysteryFunc>: ...
1 vote
1 answer
134 views

Why is Visual Studio compiling my EXE file with an entry point that is not in the file?

So I am trying to open my test app EXE file in ollydbg to study the assembly, the stack, registers and all that stuff for educational purposes and it gives me this message saying that the entry point ...
0 votes
1 answer
90 views

Crackmes challenge not validating all answers

I am playing with this crackme. The executable takes a numerical input (e.g., 123) and adds all the numbers. The total must be 50. However, I noticed that not all inputs adding up to 50 are validated. ...
1 vote
1 answer
163 views

Custom IDA Decompilation Coloring

Is there a way to customize the coloring of IDA's decompiled code? IDA -> Options -> Colors -> Syntax doesn't seem to affect the coloring of decompilation.
  • 113
2 votes
2 answers
1k views

Understanding a C code including CRT functions, decompiled with Ghidra

I am trying to learn software reverse engineering with Ghidra, though I have never used Visual Studio Compilers or the C runtime (CRT). I have a piece of decompiled C code: <typeName> <...
  • 159
1 vote
2 answers
946 views

Is it possible/feasible to decompile a program written in C++ to C?

I've not seen a lot of material on this. I've seen people attempting to bring a C++ program back to C++ code, and claiming how hard it is, but C code from C++ program? I don't know. If it is possible, ...
0 votes
2 answers
300 views

Reversing an obfuscation through a long linear switch statement

I have a program (ELF, 32 bits) that is probably quite short and simple, but which have been obfuscated with the following construction: i = 0 switch(i): case 0: one small instruction ...
1 vote
1 answer
1k views

How to define "code" variable type in Ghidra

Of all the confusing parts of Ghidra, I'd like to ask about the "code" keyword. A similar question was asked here. However, I am not asking what the keyword is, but how to interpret/define ...
0 votes
0 answers
146 views

What is this CRC32 algorithm (written in C), and how can it be written in Java or Python?

I've been trying to convert this CRC32 algorithm to Java or Python, but I haven't been successful, I believe it's because I'm not familiar enough with c. Note that I believe DAT_804818d0 is the seed, ...
1 vote
2 answers
833 views

is there a tool to decompile old exe to C?

I follow the free software implementation of OpenRCT2 from the beggining (when it was in other repository). And the first commits are a bunch of C files, these files has a lot of asm blocks of code ...
1 vote
0 answers
36 views

Make avaible x64 C++ exceptions on manually mapped module

I am trying to bind Lua on manually mapped module. As you can see clearly on here. They are using C++ or C exceptions on their API and there is no way to avoid them. I wonder to know if there are ...
  • 11
0 votes
2 answers
82 views

Understanding Loop Statements: For & While [closed]

Background Hello! New user. I am working on a personal computer science project that involves research on loop statements such as the for and while loops in C - these loops can apply to other ...
  • 103
1 vote
0 answers
397 views

What is happening with this *param_1?

I am a bit of a starter, so bear with me as I can't find the answer through Google (a common thing in Ghidra work I noticed so far). I have a function that seems to read like it is a Constructor. But ...
2 votes
1 answer
105 views

Useless instructions in a compiled getter

This is the second time I see this kind of function today : .text:00000000000010B0 sub_10B0 proc near ; CODE XREF: sub_1120:loc_1143↓p .text:00000000000010B0 lea ...
2 votes
1 answer
549 views

Is there a way to name a flag for a bit field in Ghidra?

In a line like this: if ((my_variable & 0x80000000) == 0) { Is there a way to label 0x80000000 as e.g. FLAG_HAS_PROPERTY_GREEN, or would I have to rely on comments for that?
  • 155
0 votes
1 answer
59 views

Does psVar[-6] refer to 6*sizeof(psVar) bytes before psVar? Can you avoid the negative index?

In this decompiled code, does psVar8[-6] refer to 6*sizeof(psVar8) == 12 bytes before psVar8? psVar8 = (short *)(&DAT_1412345b4 + named_index * 0x20); do { if (psVar8[-6] == 0) break; // ... } ...
  • 155
0 votes
1 answer
489 views

Translate ASM code x86 32 bits in C

I have a exercise which i can't resolve it, and i need help. If anyone can help me it would be great. I have the next ASM code in x86 32 bits which i need to translate in C language: Dump of assembler ...
  • 1
0 votes
0 answers
125 views

How do I view registers at a specific point of a binary's execution?

I have a binary that I'm attempting to reverse engineer to find a flag. From using ghidra I have found that the flag is stored in the program at a point called "check" and then run through ...
0 votes
1 answer
280 views

ret2libc: problem getting exploit work without pwntools

I am trying to exploit this program test with ret2libc. Only NX is enabled. #include <stdio.h> void vuln() { char buffer[256]; gets(buffer); } int main() { vuln(); return 0; } ...
1 vote
0 answers
229 views

How to hack fan control speed?

So I recently bought a new laptop (Acer Aspire A315-57g) on which I found that the cooling solution wasn't optimal, and I decided that I want more RPMs from my fan. However, I wasn't able to find a ...
  • 425
1 vote
0 answers
153 views

Confusing objdump with data as code

I am trying to confuse objdump to solve the first exercise of chapter 6 in Practical Binary Analysis. Admittedly I am super weak with inline assembler but I made a best-effort attempt and tried to get ...
  • 111
0 votes
1 answer
67 views

string pointer to byte conversion condition

I am trying to understand the following snippet. I understand that the first check would check if it is even if it would be an int, but I don't understand it in this context. Could someone explain to ...
  • 3
2 votes
2 answers
477 views

MIPS assembly to C code

I think I'm really brain-dead and am not really sure what to do next, but I am trying to manually convert assembly code to a C program. It's not really working, but I'm not sure what is wrong. I would ...
2 votes
2 answers
2k views

Using a buffer overflow to call a function

I'm new to reverse engineering C binaries but have been working on an old ctf and thought to ask for explanation of specific assembly commands and how a buffer overflow might force a function to be ...
  • 123
0 votes
0 answers
58 views

How to maintain function ordering in an executable when replacing machine code with C step by step?

I am working on reversing a DOS game consisting of 16-bit MZ EXE files. I was able to determine the exectuables were generated by Microsoft C v 5.10, and loading the signatures from the static ...
0 votes
1 answer
338 views

How to get the input necessary to get to the end

In short, I have a code that gets an input via stdin. Once it has the input string in memory, it verifies its integrity by calling a function for every condition, and exiting the program if those ...
1 vote
0 answers
90 views

How to create an algorithm in C...(or C# or C++, basically in "a programming language")

After a LOT of sending challenges and recording the responses I've 'broken' the "encryption" in my car's immobiliser...the reason for doing it is so I can use the engine and transmission in ...
1 vote
0 answers
107 views

How do I disassemble mips .o object files in ida elf 64bit

So I’m trying to disassemble some object files in mips. I use IDA 7 on windows. These object files are loadable kernel modules. Mipself64 Is What ida auto sets to when they are dropped in. I’d like to ...
1 vote
0 answers
121 views

Trying to call the Exit Shellcode in a c program

#include<stdio.h> #include<stdint.h> char shellcode[] = "\xb8\x3c\x00\x00\x00" "\xbf\x14\x00\x00\x00" "\x0f\x05"; int ...

1
2 3 4 5
7