Tag Archives: assembly

Ida assembly instruction invalid operate

Using “assemble” option to patch binary files in IDA, you will receive an invalid operation error every time you enter an arithmetic instruction with calculated offset. For example:

mov [bp-4], bx  

  Invalid operate error occurred

however

mov ax, bx

success. The official explanation is that the function support of modification instruction is relatively small, so it needs to be modified by other methods.

【arm】arm-assembly-print-register-value-in-decimal

Date: 2018-7-15


1. Reference:
https://stackoverflow.com/questions/2370942/arm-assembly-print-register-value-in-decimal
2. Arm register printing
Since the ARM register print is always in hexadecimal, it seems to be a bit of a struggle. Therefore, we have been exploring the relatively convenient method of arm register printing recently, and now there are two methods for reference.
Method one:

print_decimal:
        stmfd   sp!, {
  r4,r5,lr}

        cmp     r0, #0
        moveq   r0, #'0'
        bleq    putchar
        beq     done

        mov     

LNK2001: unresolved external symbol maincrtstartup

Compile 64 bit assembly under VS, create a new project, right click on the project name, select “Build Dependencies” -& GT; “Build Customizations”:

Check the masm:

Add main.asm, and the simplest piece of code is typed:

.code
main proc
	ret
main endp

end

Direct F5 run (right-click added project), annoying error:
LNK2001: unresolved external symbol mainCRTStartup

Unparsed external symbol mainCRTStartup, which is the default entry function, will call the main function we wrote, but that is the main function inC /C++, such as void main() {return 0; }, the compiler can’t find such a main function to report the above error, so we need to specify the entry function as our own main function (in this case mian is not that main; you can change it to any other name that conforms to the identifier specification).
Right-click the project name and select the last project property
Linker -> Advanced -> The Entry Point: main name needs to be the same as in the code.

If nothing happens, you’ll be fine, but of course this code doesn’t do anything, and you won’t see anything.