Questions tagged [c]

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

Filter by
Sorted by
Tagged with
0 votes
0 answers
37 views

Why is an empty binary larger than one with a variable?

On my own self-learning R.E. Starting with understanding ELF and hopefully whats going on with every byte. I build 2 simple binaries: 1 with a variable and 1 without. For some reason, the one without ...
4 votes
2 answers
934 views

How to bypass anti debugger? IDA Pro

Im new to reverse engineering and doing a crackme that requires me to make a keygen, yes i know making a keygen isn't a beginner task however im stuborn, i am trying to debug the program to understand ...
0 votes
0 answers
33 views

How to traverse the GCC AST nodes?

I have looked into AST representations here http://icps.u-strasbg.fr/~pop/gcc-ast.html and I would like to know how I can programmatically access this tree/traverse the nodes of my source.c file? ...
0 votes
0 answers
110 views

Prevent GCC compiler from constant folding

I have simple C Code: int main() { int b = 3-1; return 0; } And when I objdump it after compiling with no optimization: 000000000000113d <main>: 113d: f3 0f 1e fa ...
0 votes
1 answer
705 views

How can I convert the following assembly code to pseudo code?

I got the following disassembly code in IDA pro. I really find it hard to convert it into pseudo code. push ebp mov ebp, esp sub esp, 14h mov dword ptr [ebp-14h], 1 mov dword ptr [ebp-10h], 2 mov ...
1 vote
1 answer
360 views

How to run exe program loaded into IDA Pro or Ghidra

I'm new to reverse engineering, just learning. After the exe program is loaded into IDA or Ghidra, how do I run the exe program that loaded into IDA/Ghidra? so I can interact with the exe program? and ...
1 vote
1 answer
164 views

ARM64 Stack Layout - Why 100x'A' Doesn't Crash?

I'm trying to exploit a buffer overflow vulnerability in an ARM64 program from this blog. When I give as input 100*'A', and I compile the program for ARM 32 bit (without canaries), the program crashes ...
3 votes
1 answer
1k views

Calling Swift 4 methods from C

I have earlier been able to call Swift methods using a function pointer from C, and providing the appropriate arguments because the calling convention was the same. Unfortunately this no longer works....
2 votes
1 answer
2k 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,...
3 votes
3 answers
2k views

Exports that redirects to other library

I'm writing an analog of GetProcAddress function. When looking inside the export table I see the exports like this in advapi32.dll for example: .text:4C362BAA aEventregister db 'EventRegister',0 ;...
0 votes
0 answers
20 views

What guidelines and/or tools exist that facilitate the analysis of a program in assembly language for PIC-Microchip?

What tools exist that facilitate the interpretation of a program written in assembly language of a PIC-Microchip, appealing to the construction, for example, of a flowchart and then recoding it in ...
0 votes
1 answer
68 views

Updating legacy library in an already compiled binary

I'm dealing with a reverse engineering challenge involving a binary application that was statically compiled with a legacy library. While the legacy library is not vulnerable, it lacks certain ...
1 vote
2 answers
505 views

Hiding shared library calls from ltrace

I am trying to implement some antidebug methods. Although I have encrypted texts, ltrace reveals them, for example: strstr("Name:\tltrace\n", "ltrace") A solution would be static linking, but I do ...
1 vote
1 answer
452 views

Identifying C/C++ Library Functions

I am attempting to reverse-engineer an old DOS executable, which seems to have been compiled around 1992 using Microsoft's C compiler at the time. When opening the executable in Ghidra no imports are ...
0 votes
1 answer
92 views

ELF - Why does objdump provide a wrong byte value in the .got?

I seriously can't tell if I'm misunderstanding something grossly or if this is a bug in objdump. Newbie alert. $ objdump -s --start-address=0x3fc0 --stop-address=0x3fc1 test test: file format ...
11 votes
2 answers
10k views

Decompile and recompile C?

What tools produce C code that does not produce errors when you try to recompile it again? Can Hex-Rays decompiler convert everything to project files in a single folder and just compile it?
0 votes
1 answer
109 views

Create exe that jumps directly into main()-function from C

I am using x64dbg to explore image files on Windows. After the computer finishes prowling ntdll.dll it jumps to OptionalHeader.AddressOfEntryPoint. But this is not my main()-function. What is this ...
2 votes
0 answers
398 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 ...
2 votes
0 answers
291 views

Help Needed With Finding Image Data In DOS Game File

I have been analysing, an File called FW190AS.PAC from a 16 Bit Game called Secret Weapons Of The Luftwaffe, in a Hex Editor, the Bytes are displayed in Little Endian format. My aim with this game, is ...
1 vote
0 answers
131 views

Reversing Assembly to C

I've read the open letter addressing students asking for help with their homework and I agree with it, therefore I will try to be less of a pain in the *** ;) I need to reverse the x86-64 (AT&T) ...
1 vote
0 answers
56 views

Fuzzing closed application

I want to get from you some advice about fuzzing. I am checking a huge C application (not open source) which is also an HTTP server. My purpose is to fuzz the HTTP server via the requests being sent ...
2 votes
0 answers
242 views

What is the meaning of call ds:ApiName[registry*constant] in IDA .asm files?

I have a dataset of .ASM files generated by IDA (dont have the corresponding file) ‌And there are a lot of calls like this : .text:00637114 5F pop edi .text:...
3 votes
1 answer
135 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 ...
3 votes
0 answers
301 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 ...
1 vote
1 answer
109 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
254 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)...
5 votes
1 answer
2k views

Why is fastcall used for replacing thiscall functions in memory instead of cdecl?

Assume I were to be reversing some game which processes all of it's movement client side and have determined some function to be of the type: bool __thiscall Player::CanJump(Player *this) that I ...
2 votes
0 answers
148 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 ...
0 votes
1 answer
648 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 ...
5 votes
1 answer
156 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?
7 votes
2 answers
2k views

Identifying possible structs in C/C++ disassembly

I'm currently working on taking apart a game (Soul Reaver: Legacy of Kain) and I often come across odd looking sections such as this in the decompiler *(_DWORD *)(a2 + 16) = a2 + 624; *(_DWORD *)(...
5 votes
0 answers
3k views

Can IDA generate C code for ASM assembly without the binary?

Lets say I have this picture of some assembly: Now I know how to manual tranform this assembly into C code because it is small but is it possible for IDA to convert this into C code? Ideally I would ...
4 votes
2 answers
142 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
99 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 ...
2 votes
1 answer
396 views

How to reverse engineer structs in radare2?

Is there any way to indentify structs in radare2? when i tried to look them, they look like normal variables, i seen people using td and tl command but I don't know how to use them. If you know please ...
1 vote
1 answer
83 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 ...
2 votes
0 answers
98 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 ...
2 votes
0 answers
126 views

Static analysis

I am working on a class project. I need to find out static features of a program (without executing it). Backward branches (loops) Conditional branches (potential threads with load imbalance) ...
2 votes
1 answer
87 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 ...
3 votes
0 answers
45 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**...
1 vote
0 answers
461 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 ...
18 votes
4 answers
177k views

Converting assembly code to c

I have the following assembly code over Linux distro: # using the .data section for write permission # instead of .text section .section .data .globl _start _start: # displaying some characters ...
1 vote
0 answers
1k 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
0 answers
396 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 ...
1 vote
0 answers
45 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
0 answers
58 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. ...
48 votes
8 answers
33k views

How do I add functionality to an existing binary executable?

I want to add some functionality to an existing binary file. The binary file was created using gcc. Do I need to decompile the binary first, even though I sufficiently understand the functioning of ...
1 vote
1 answer
204 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. ...
11 votes
3 answers
1k views

What methodology can be used to change code flow atomically during program execution?

I have been reading a lot about the different techniques for Windows API hooking (a technique I'm particularly fascinated by and fond of), and it seems a major problem in implementing a realiable ...
2 votes
0 answers
178 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
2 3 4 5
7