assembly

Debugging string from resource with assembly

Here is my issue. I'm trying to learn how to do debugging in assembly with OllyDBG. Usually, when a string is literally in the application, I can find something that points to it, however, this string is from the resource file (when doing WinAPI programming, a resource, .rc, is used). Therefore, given that it is in resource data, how can...

LEAL Assembler instruction

I have the following instruction and I'd like to know what the function is of the 0x10 in regards to this LEAL instruction? Is it a multiply or addition or is something else? leal 0x10(%ebx), %eax Can someone please clarify? This is x86 assembler on a Linux box. ...

What address does the x86 begin executing at?

When an 8086 or 8088 first powers up, what address does the processor begin executing at? I know the Z80 starts at 0, and the 6809 looks to FFFF for an address to start at, but I have often wondered how the x86 starts off. EDIT: This is assuming no BIOS intervention. I.E. if I had my own EEPROM to boot from, where should it be located ...

how do you make an x86 assembly program in linux that converts files to uppercase?

I found a pdf file called: ProgrammingGroundUp-1-0-booksize.pdf, and one of the projects is to make an assembly program that takes in files and converts them to uppercase, ` .section .data #######CONSTANTS######## #system call numbers .equ SYS_OPEN, 5 .equ SYS_WRITE, 4 .equ SYS_READ, 3 .equ SYS_CLOSE, 6 .equ SYS_EXIT, 1 #options for ope...

Assembly Language to C

Hi, so I have the following assembly language code which I need to convert into C. I am confused on a few lines of the code. I understand that this is a for loop. I have added my comments on each line. I think the for loop goes like this for (int i = 1; i > 0; i << what?) { //calculate result } What is the test condition? And ...

Switch Case Assembly Language

I am looking at the assembly language code of a switch statement. I understand how the code works and what the cases are. My question is how do I decide on the case names? Below is the assembly language code, which will be followed with my interpretation of it. I basically just need to use the jump table and fill in the case names. ...

M.A.R.I.E divide one number by another

I'm learning assembly using the MARIE program but I cant figure out hot to do this this is the question from the book divide one number by another and store the quotient and the remainder in two different memory locations. this is what I have so far what am I doing wrong? FYI there is no divide or multiplication built into the program ...

C++ Using a file format

Hi there, A couple of days ago, I asked how you could reverse engineer a file format. While that didn't really work out, someone gave me the file format. (Click Here) Thank you Xadet. I'm still quite new to all this, and I was wondering where I should go from here. I am guessing I will have to use inline-asm in C++ to use this format, ...

RegisterClassEx in Assembly

Hi guys, I'm trying to manually call RegisterClassEx Windows API without using a WNDCLASS structure on .data section, I need to create this structure only using push instruction. Could someone help me on that please? Thanks a lot ...

How to check if a signed integer is neg or pos?

I am new to x86 assembly language, I have a signed integer saved in register eax, and I want to check if the number is negative or positive. To do that, i used bt operator to check the first bit. here is what I did: bt eax,0 jnc isNegative bt carries the first bit to carry flag, and i used jnc to check if carry flag is 0 or 1. If i...

How to get Page assembly from a Control?

I've create a method that gets the current page's assembly name and version so that I can display it in the page footer. It works just fine, but I'd like to move this logic into a control that I could drop into any web application project master page that references my control library. However, in the control library Assembly.GetExecutin...

How do I wrap a non-standard calling convention in C?

Without getting into specifics, say I need to make use of a non-standard calling convention from C code. Functions that use this convention may return multiple values on the stack. It would be simple to put each function in a wrapper that uses inline assembly to make the call, sending output via pointer parameters given to the wrapper. U...

Analyzing assembly code

$ gcc -O2 -S test.c -----------------------(1) .file "test.c" .globl accum .bss .align 4 .type accum, @object .size accum, 4 accum: .zero 4 .text .p2align 2,,3 .globl sum .type sum, @function sum: pushl %ebp movl %esp, %ebp movl 12(%ebp)...

selection sort in assembly language

Hey guys, here is my code.. I have to perform a selection sort on an array. It is homework. The Irvine32.inc sets up my memory model. Any suggestions to what I'm doing wrong would be helpful. I've redone the entire thing a few times now. INCLUDE Irvine32.inc .data myArray DWORD 10, 12, 3, 5 .code main PROC call Clrscr MOV EDI, ...

Sorting a string of characters in assembly

I'm trying to write in assembly language a function sort. It will sort the two dimensional array such that the rows will now contain data in alphabetical order. I have tried many things but it is honestly beyond my current knowledge. here's what I tried so far... .386 public _Sort .model flat .code _Sort proc push ebp mov ebp...

Searching for thread start parameters at top of stack

I've inherited some code that worked on Windows 2000 thats using a small piece of assembly code to locate the base address of the stack, then it uses an offset to grab the parameter value passed to the thread start function. However this doesnt work in Windows 2008 Server. The offset is obviously different. #define TEB_OFFSET 4 DWO...

MIPS (curiosity) faster way of clearing a register?

Hello! Anyone knows which is the fastest way of clearing a register (=0) in MIPS assembly? Some examples: xor $t0, $t0, $t0 and $t0, $t0, $0 move $t0, $0 li $t0, 0 add $t0, $0, $0 Which is the most efficient? Thanks! ...

Can anyone help me interpret this simple disassembly from WinDbg?

Hi friends, I got the following simple C++ code: #include <stdio.h> int main(void) { ::printf("\nHello,debugger!\n"); } And from WinDbg, I got the following disassembly code: SimpleDemo!main: 01111380 55 push ebp 01111381 8bec mov ebp,esp 01111383 81ecc0000000 sub esp,0C0h 01111389 53 ...

USB RF Receiver Mouse Hacking

How do wireless mice work, as in technically, the RF Receiver you plug in via USB (PnP)? I want to know how I would go about accessing the data section of the receiver and see either the actual code involved in sending information to the OS driver, or see the drivers involved to go about decompilation. ...

Bubble Sort in Assembly

I'm trying to figure out sorting an array of strings using assembly. I compare the first and the second alphabets and then rearrange them in alphabethic order. I have it almost figured out but my output is rearranging some character incorrectly. For example, when printing 'eight', it'll just print 'eigh'. .386 public _Sort .model flat ....