to the string lengthAdd ECx, Len // Add the character LengthINC ECxAdd ECx, 4 // Add the original entry RVA ValueAdd ECx, 4 // Add four bytes of the getmodulhand addressMoV dword ptr [ESI + 28 h], ECxLea ESI, ChaoMoV EDI, dword ptr [eax + 14 H]Add EDI, imagebaseMoV ECx, LenINC ECxClDRep movs byte PTR [EDI], byte PTR [esi]Lea ESI, address // address for writing g
temporary base address in the item bar where the person involved is located.0dd97468, search for this address to get several codes to monitor the access respectively. Move the mouse to change the person's character to get the code:0076b9d1-3B 3D 64811003-cmp edi, [03108164]0076b9d7-75 2a-JNE 0076ba030076b9d9-8B 84 B7 04040000-mov eax, [EDI + ESI * 4 + 00000404]Obviously [
Tags: OS SP Div code BS as method simple functionSTOs includes stosb stosw stosd. The registers involved are eax and EDI. The functions are as follows: stosb copies values in Al to byte ptr es: [EDI, at the same time, EDI ++ stosw copies the value in ax to word ptr es: [EDI], and E
in the operation, such as Movl $foo,%eax equivalent to Intel's mov eax, word ptr foo
Long jumps and calls are different in format, att for ljmp $section, $offset, while Intel is JMP Section:offset
The main difference is these, the other details are many, here is a concrete example to illustrate
#cpuid. S Sample Program
. Section. Data
Output
. ASCII "The processor vendor ID is ' xxxxxxxxxxxx '/n '
. section. Text
. globl _start
_start:
MOVL $,%eax
Cpuid
MOVL $output,%
ptr [ebp-4]14.013b1059 Add Eax,esi15.013b105b Add Eax,edx16.013B105D mov edx,dword ptr [__imp_std::endl (13B204CH)]17.013b1063 Add Ecx,eax//The top 3 Add instructions add Ebx,ecx,edx,edi to ECX, that is, the ECX is the cumulative result
Visible compiler generated code is the best code, eliminate the intermediate variable i, reduce the number of cycles, eliminate the CPU can not be disorderly execution of the factors.
BTW:
One might have a question: i
loadRetDllentry ENDP
To convert the value in Edx:eax to a decimal output form string, which is familiar, as in the previous example!OUTEDXEAX proc \; For example: edx=0,eax=01234567h, the converted string is:Uses ebx esi edi,lpstring; -> ' 19088743 ', 0mov edi,lpstring; point to address where results are storedMOV esi,lpstring
mov ecx,10; convert to Decimal. While eax!=0 | | Edx!=0Push EAXMOV Eax,edxXOR
1 parameter passing (default calling convention)
Use VC6.0 to create a new empty console application, create a new source file Main.c, write the following code, pay attention to debug compile, do not use release, lest the code by VC optimization, disassembly does not correspond.
int addint (int a, int b)
{
int c = a+b;
return c;
}
int main ()
{
int x = AddInt (1, 3);
return 0;
}
In the main function into the braces down, press F5 run, the program is broken, then press the combination of
this limit//run: Run.exe automatically compiles pm16.c and pm32.c and then generates an IMG and calls Bochs to run the program// Hint: Please first compile run.c file with yc09, generate Run.exe Program//After modify PM16.C and pm32.c code, can run Run.exe view effect directly, click Enter again compile run//author: Miao//Time: 2010-2-8 #define Ycbit 32//Tell the compiler to compile the program in 32-bit format #define ycorg 0x0//This value generates an address base offset for variable function
Assembly language: Movsb,movsw,movsdTransferred from: http://blog.csdn.net/zhenyongyuan123/article/details/8364011Currently, the 80386 series of processors provide several sets of instructions for handling byte, Word, and double-word values, although these directives become basic string directives, but their usage is not limited to character arrays.Instructions:MOVSB, MOVSW, Movsd Describe:Moves the string data, copying the data at the memory address addressed by the ESI register to the memory a
))LSet L = bIp2long = L.valEnd Function
It's good and powerful to copy mybytes type variables to MyLong type variables with LSet. Look at the generated assembly code:
Copy Code code as follows:
00401A0E Lea eax, DWORD ptr [ebp-0x20]; Address of variable B
00401A11 push EAX
00401a12 Lea eax, DWORD ptr [ebp-0x14]; The address of the variable L
00401A15 push EAX
00401A16 Push 0x4
00401a18 call __vbacopybytes; JMP to Msvbvm60.__vbacopybytes
Called is the __v
The usage of "[]" has been described in "FAQ" and is cited as follows:
1, push DWORD ptr [024c1100] pressure stack 024c1100 value of two words2, CMP eax,[ebp+14] eax-ebp+14 valid value, does not retain the value, mainly looks at the sign bit3, CMP byte ptr [eax],46 byte type eax-46, see sign bit4, Lea eax,[edx-02] edx-02 valid value (an address value) to EAX5, MOV ecx,[edx+08] edx+8 value as the address, this address points to the value of ECX
I am going to add a few more examples of what I have
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.