assembly

Decompiling .NET 2.0 binary

Is it possible to decompile a .NET 2.0 binary file (*.exe) to some sort of readable code? Or if not, just extract some information from it (for example method names, debugging information, etc.)? ...

Can I programatically deduce the calling convention used by a C++ dll?

Imagine you'd like to write a program that tests functions in a c++ dll file. You should enable the user to select a dll (we assume we are talking about c++ dlls). He should be able to obtain a list of all functions exported by the dll. Then, the user should be able to select a function name from the list, manually input a list of argume...

pusha assembly language instruction

I am having a core dump which stack is corrupted. I try to disassemble it and found the following plz help me to anaylyse it .. (gdb) bt #0 0x55a63c98 in ?? () #1 0x00000000 in ?? () (gdb) disassemble 0x55a63c90 0x55a63ca8 Dump of assembler code from 0x55a63c90 to 0x55a63ca8: 0x55a63c90: add %cl,%dh 0x55a63c92: cmpsb %...

How do you pass a string as an argument to the "call" instruction in inline assembly?

Essentially, I'd like to be able to do something like this: //assume myFunction is defined and takes one argument that is an int char * functionName = "myFunction"; int arg = 5; __asm{ push a call functionName } Basically I want to call a function whose name is stored in a string. What would be the proper syntax for doing thi...

MIPS function inside a function

I am trying to have the function vbsme call another function called sad... is the following procedure correct about saving the registers and return address?? the caller is supposed to save register $t0-$t7, but where and how should I do that? vbsme: li $v0, 0 # reset $v0 li $v1, 0 # reset $v1 li $t0, 1 # i(row) = 1 ...

check if a register value is even/odd in MIPS

I tried to do the following: andi $s7, $s6, 0x1 # (i + j) & 1 (to check if it's even) however it generates an error... am I doing something wrong? ...

In GCC-style extended inline asm, is it possible to output a "virtualized" boolean value, e.g. the carry flag?

If I have the following C++ code to compare two 128-bit unsigned integers, with inline amd-64 asm: struct uint128_t { uint64_t lo, hi; }; inline bool operator< (const uint128_t &a, const uint128_t &b) { uint64_t temp; bool result; __asm__( "cmpq %3, %2;" "sbbq %4, %1;" "setc %0;" : // outp...

Assembler Stack Alignment (or better misaligned example with PUSH)

Hello!, Well first I understand (or a I think that I understand) the problems of misaligned stack. But I know (like a definition) that pushing a 16bit value to 32bit wide stack could cause a stack misaligned. But the thing I dont understand, is how this could happend...since PUSH and POP check the D flag at the segment descriptor (so ...

Assembler: Using "Flat assembler" how do I produce EXE files (compile, link..)?

I'm using FASM to compile a small piece of code: mov ah,4ch mov al,00 int 21h I click Run -> Compile, and what I get is a .BIN file. sorry for the noobish question but why don't I get an OBJ, or an EXE file, and what is this BIN? ...

double-precision numbers in inline assembly (GCC, IA-32)

I'm just starting to learn assembly and I want to round a floating-point value using a specified rounding mode. I've tried to implement this using fstcw, fldcw, and frndint. Right now i get a couple of errors: ~ $ gc a02p gcc -Wall -g a02p.c -o a02p a02p.c: In function `roundD': a02p.c:33: error: parse error before '[' token a02p.c:21...

Within a DLL, how is the function table structured?

I've been looking into the implementation of a device library that doesn't explicitly support my operating system. In particular, I have a disassembled DLL, and a fair amount of supporting source code. Now, how is the function table/export table structured? My understanding is that the first structure of the .data section is a table of ...

Assembly - Trying to reverse string, but it adds an extra character on the final string.

Hi folks. I'm rather new to Assembly (And programming in general, to be honest). I'm trying to play with the stack. The purpose of this code: Take in a String, limited to 80 characters Reprint the String as entered Print each character as it is pushed to the stack Print each character as it is popped from the stack Print the reversed S...

Equivalents to Z80 DJNZ instruction on other architectures?

First a little background. The z80 CPU has an instruction called DJNZ which can be used in a similar manner as a for loop. Basically DJNZ decrements the B register and jumps to a label if not zero. For example: ld b,96 ; erase all of the line disp_version_erase_loop: call _vputblank ; eras...

absolute value in MIPS

Do you have any simple ways to make a value in a register in MIPS as an absolute value? ...

Dynamic relocation of code section

Just out of curiosity I wonder if it is possible to relocate a piece of code during the execution of a program. For instance, I have a function and this function should be replaced in memory each time after it has been executed. One idea that came up our mind is to use self-modifying code to do that. According to some online resources, s...

Learning ARM assembly

During this year there will be coming couple sub-600€ multi-touch portable computers that contain Tegra2. They bring me to a good excuse to learning ARM assembly language. But I have no clue where to start from aside the arm.com. For first throw I could just pick up an emulator with a linux distribution in it. But which emulator and dis...

MIPS load word syntax

If I want to load a value from a memory which base address is at $a0 and off set $t2, why can't I do the following: lw $s2, $a1($t2) so what is the equivalent of the expression above? ...

In MIPS, what is HI and LO

I'm reading about division in MIPS and I've found that div Divides $s by $t and stores the quotient in $LO and the remainder in $HI http://www.mrc.uidaho.edu/mrc/people/jff/digital/MIPSir.html And Wikipedia says HI and LO are used to access the multiplier/divider results, accessed by the mfhi (move from high) and mflo com...

strange instruction call in MIPS

I don't have a syscall code in my MIPS instruction, however in the simulator I can see the following: I don't have any of the following code line in my .s li $v0 10 syscall Why is that? It's bothering me as it gives me a bad address in the syscall ...

A tool for understanding assembler programs ?

I have an assembler program and I try to understand it. (I'm actually profiling it). Is there a Linux tool/editor that would structurize it a little for me? Displaying where loops/jumps are would be enough. Handy description of what an instruction does would be great. ...