Questions tagged [reversing]

Reversing refers to performing a task in the direction opposite to that which the task is normally performed in. It also refers to changing the order of an ordered list of items such that they are rearranged from the last item to the first item. For questions related to discovering the principles of a human made system through analysis, please use [tag:reverse-engineering].

Reversing refers to performing a task in the direction opposite to that which the task is normally performed in.

It also refers to changing the order of an ordered list of items such that they are rearranged from the last item to the first item.

For questions related to discovering the principles of a human made system through analysis, please use .

113 questions
0
votes
2 answers

Reversing a string with a for loop in JavaScript

got a very quick question to y'all as I'm relatively new to JavaScript. This task is actually from the freeCodeCamp course and it's about reversing a string as shown in the title. The question is, why do we include the -1 integer in the str.length…
Martin
  • 1
  • 1
0
votes
0 answers

how to set char [ ] so it will give output if we enter any character or any no. Code is given below

So main line is 8 Code is given below and program is about reversing the string. Basically I have given the character value 80 I want help so If I enter value it will reverse the string #include #include #include…
0
votes
3 answers

Reverse a list in python using append and pop method

In the tutorial video I was watching the range used in for loop was "range(len(l))" which successfully reversed the list. But I guess simply putting " l " will solve the purpose and it didn't can someone please tell me why is that? def…
0
votes
2 answers

How do I derive this part of the algorithm

I'm a beginner at programming Python and came across this program. This algorithm is used to reverse a list: mylist = [1,2,3,4] reverse = mylist[:] for i in range(len(reverse)//2): reverse[i], reverse[len(reverse) -i -1] = reverse[len(reverse)…
user14733911
0
votes
1 answer

Bypass ptrace anti-debugging trick

I'm having some trouble bypassing calls to ptrace when debugging a 32-bit Linux executable. I have this binary: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux.so.2, for GNU/Linux 2.6.26,…
Sp00nc3
  • 87
  • 1
  • 8
0
votes
1 answer

JUMP Table close to the end of the .text section

I have wrote the following very simple program: #include #include int wmain(void) { DWORD dwProcId = GetCurrentProcessId(); HANDLE hProc = OpenProcess(0x0400, FALSE, dwProcId); wprintf(L"Process handle is %p\n.",…
servo
  • 3
  • 2
0
votes
2 answers

Reverse into new array VS reverse in place

I have been trying to reverse an array, first by using push and creating a new array, and then second by using destructuring and mutating the original array. I'm wondering which of the two runs faster, and why?
Stephn
  • 3
  • 1
0
votes
0 answers

How to change the protection of memory address in kernel (Windows)

#pragma warning(disable: 4100) #include "UnexDriver.h" // includes print() and GetKernelProcAddress() LONGLONG someFunction() { return 10; } typedef NTSTATUS(_stdcall* ZwProtectVirtualMemory_t)(IN HANDLE ProcessHandle, IN PVOID* BaseAddress,…
Unex
  • 11
  • 2
0
votes
1 answer

How does the function call to reverse the string in the code below?

def reverse(s): str = "" for i in s: str = i + str return str s = "Geeksforgeeks" print ("The original string is : ",end="") print (s) print ("The reversed string(using loops) is : ",end="") print (reverse(s)) I tried the…
anon
0
votes
2 answers

Reversing an integer in c++

Is there any better way to reverse an integer than this? int reverse(int x) { int out=0; while(x) { if(out > INT_MAX/10 || out < INT_MIN/10){return 0;} else{ out = out*10 + x%10; …
Ghiri Hari
  • 71
  • 1
  • 6
0
votes
1 answer

Negative step indexing on List in Python

So, my confusion on slicing a list in reverse order took a hit when I tried to compare the two commands, one with their default values and the other one with the actual command PS: I'm trying to reverse a list using slicing List = ["Apple",…
Paris
  • 73
  • 1
  • 9
0
votes
0 answers

Anti-debugging and anti-reversing techniques inside windows executable

I'm trying to implement some anti-debugging/anti-reversing techinques in order to prevent my (python) executable to be debugged/reversed, but when I try to launch it from x32dbg or python -m pdb they don't work, letting x32gdb/pdb to access my code…
Ivan
  • 1
  • 1
  • 8
0
votes
1 answer

Understanding the "self" in classes for Python

I'm trying to understand the solution provided for reversing a linked list. In particular, I don't get why for the very last line we write: self.head=prev and not current=prev since current=self.head I know my reasoning is flawed, that's why I…
0
votes
2 answers

basic Java coding question about reversing order of words for JAVA

I am looking for a way to reverse the word in java. This is my code and it occurs errors. Can somebody explain why? import java.util.Scanner; public class Robot { public static void reverse(String text) { int leng = text.length(); …
able20
  • 167
  • 1
  • 1
  • 7
0
votes
0 answers

save as Little Endian

BYTE b = 0x12; WORD w = 0x1234; DWORD dw = 0x12345678; char str[] = "abcde"; int main(int argc, char *argv[]) { byte lb = b; WORD lw = w; DWORD ldw = dw; char *lstr = str; return…
hy ro
  • 11
  • 1