[Switch] C # reverse engineering-il Instruction Set

Source: Internet
Author: User

Reprinted from: http://www.cnblogs.com/davyjiang/articles/1337400.html

Some il language explanations:

Jump command set
If the two values of beq are equal, the control is transferred to the target command.
Beq_s if the two values are equal, the control is transferred to the target command (short format ).
If the first value of Bge is greater than or equal to the second value, the control is transferred to the target command.
Bge_s if the first value is greater than or equal to the second value, the control is transferred to the target command (short format ).
Bge_un when comparing unsigned integer values or unordered floating point values, if the first value is greater than the second value, the control is transferred to the target command.
Bge_un_s when comparing unsigned integer values or unordered floating point values, if the first value is greater than the second value, the control is transferred to the target command (short format ).
Bgt if the first value is greater than the second value, the control is transferred to the target command.
Bgt_s if the first value is greater than the second value, the control is transferred to the target command (short format ).
Bgt_un when comparing unsigned integer values or unordered floating point values, if the first value is greater than the second value, the control is transferred to the target command.
Bgt_un_s when comparing unsigned integer values or unordered floating point values, if the first value is greater than the second value, the control is transferred to the target command (short format ).
Ble transfers control to the target command if the first value is less than or equal to the second value.
Ble_s if the first value is less than or equal to the second value, the control is transferred to the target command (short format ).
Ble_un when comparing unsigned integer values or unordered floating point values, if the first value is less than or equal to the second value, the control is transferred to the target command.
Ble_un_s when comparing unsigned integer or unordered floating point values, if the first value is less than or equal to the second value, the control is transferred to the target command (short format ).
If the first value of BLT is smaller than the second value, the control is transferred to the target command.
Blt_s if the first value is smaller than the second value, the control is transferred to the target command (short format ).
When blt_un compares unsigned integer values or unordered floating point values, if the first value is smaller than the second value, the control is transferred to the target command.
Blt_un_s when comparing unsigned integer values or unordered floating point values, if the first value is smaller than the second value, the control is transferred to the target command (short format ).
Bne_un transfers control to the target command when two unsigned integer values or unordered floating point values are not equal.
Bne_un_s when two unsigned integer values or unordered floating point values are not equal, the control is transferred to the target command (short format ).
BR unconditionally transfers the control to the target command.
Br_s unconditionally transfers the control to the target command (short format ).
Brfalse if the value is false, null reference (nothing in Visual Basic), or zero, the control is transferred to the target command.
Brfalse_s transfers control to the target command if value is false, null reference, or zero.
Brtrue: If the value is true, non-null, or non-zero, the control is transferred to the target command.
Brtrue_s if the value is true, non-null, or non-zero, the control is transferred to the target command (short format ).

Comparison command set
CEQ compares two values. If the two values are equal, the integer 1 (int32) is pushed to the computing stack; otherwise, 0 (int32) is pushed to the computing stack.
CGT compares two values. If the first value is greater than the second value, the integer 1 (int32) is pushed to the computing stack. Otherwise, 0 (int32) is pushed to the computing stack.
Cgt_un compares two unsigned or unordered values. If the first value is greater than the second value, the integer 1 (int32) is pushed to the computing stack. Otherwise, 0 (int32) is pushed to the computing stack.
CLT compares two values. If the first value is smaller than the second value, the integer 1 (int32) is pushed to the computing stack. Otherwise, 0 (int32) is pushed to the computing stack.
Clt_un compares unsigned or unordered values value1 and value2. If value1 is less than value2, the integer 1 (int32) is pushed to the computing stack. Otherwise, 0 (int32) is pushed to the computing stack.
JMP exits the current method and jumps to the specified method.

 

Description
Add adds two values and pushes the results to the computing stack.
Add_ovf adds two integers, performs an overflow check, and pushes the result to the computing stack.
Add_ovf_un adds two unsigned integer values, performs an overflow check, and pushes the results to the computing stack.
And calculates the bitwise "and" of the two values and pushes the result to the computing stack.
Arglist returns an unmanaged pointer to the parameter list of the current method.

Box converts a value class to an object reference (O type ).
Break sends a signal to the common language structure (CLI) to notify the debugger that a breakpoint has been hit.
Call calls the method indicated by the passed method specifier.
Calli calls the method indicated on the computing stack by calling the parameters described in the Convention (as a pointer to the entry point ).
Callvirt calls the post-binding method on the object and pushes the return value to the computing stack.
Castclass tries to convert the referenced object to the specified class.
If the ckfinite value is not a finite number, arithmeticexception is thrown.

Type of virtual method call to be performed on a constrained constraint.
Conv_ I converts the value at the top of the computing stack to natural Int.
Conv_i1 converts the value at the top of the computing stack to int8, and then expands (Fills) It To int32.
Conv_i2 converts the value at the top of the computing stack to int16, and then expands (Fills) It To int32.
Conv_i4 converts the value at the top of the computing stack to int32.
Conv_i8 converts the value at the top of the computing stack to int64.
Conv_ovf_ I converts the signed value at the top of the computing stack to a signed natural int, and causes overflowexception when overflow occurs.
Conv_ovf_ I _un converts the unsigned value at the top of the computing stack to a signed natural int, and causes overflowexception when overflow occurs.
Conv_ovf_i1 converts the signed value at the top of the computing stack to a signed int8 value, extends it to int32, and causes overflowexception when overflow occurs.
Conv_ovf_i0000un converts the unsigned value at the top of the computing stack to a signed int8 value, extends it to int32, and causes overflowexception when overflow occurs.
Conv_ovf_i2 converts the signed value at the top of the computing stack to a signed int16, extends it to int32, and causes overflowexception when overflow occurs.
Conv_ovf_i2_un converts the unsigned value at the top of the computing stack to a signed int16 value, extends it to int32, and causes overflowexception when overflow occurs.
Conv_ovf_i4 converts the signed value at the top of the computing stack to a signed int32, and overflowexception is triggered when overflow occurs.
Conv_ovf_i4_un converts the unsigned value at the top of the computing stack to a signed int32 value, and causes overflowexception when overflow occurs.
Conv_ovf_i8 converts the signed value at the top of the computing stack to a signed int64 value, and causes overflowexception when overflow occurs.
Conv_ovf_i8_un converts the unsigned value at the top of the computing stack to a signed int64 value, and causes overflowexception when overflow occurs.
Conv_ovf_u converts the signed value at the top of the computing stack to an unsigned natural int, and causes overflowexception when overflow occurs.
Conv_ovf_u_un converts the unsigned value at the top of the computing stack to an unsigned natural int and causes overflowexception when overflow occurs.
Conv_ovf_u1 converts the signed value at the top of the computing stack to unsigned int8, extends it to int32, and causes overflowexception when overflow occurs.
Conv_ovf_u0000un converts the unsigned int8 value at the top of the computing stack to unsigned int8, extends it to int32, and causes overflowexception when overflow occurs.
Conv_ovf_u2 converts the signed value at the top of the computing stack to unsigned int16, extends it to int32, and causes overflowexception when overflow occurs.
Conv_ovf_u2_un converts the unsigned value at the top of the computing stack to unsigned int16, extends it to int32, and causes overflowexception when overflow occurs.
Conv_ovf_u4 converts the signed value at the top of the computing stack to unsigned int32, and overflowexception is triggered when overflow occurs.
Conv_ovf_u4_un converts the unsigned value at the top of the computing stack to unsigned int32, and causes overflowexception when overflow occurs.
Conv_ovf_u8 converts the signed value at the top of the computing stack to unsigned int64, and causes overflowexception when overflow occurs.
Conv_ovf_u8_un converts the unsigned value at the top of the computing stack to unsigned int64, and causes overflowexception when overflow occurs.
Conv_r_un converts the unsigned integer at the top of the computing stack to float32.
Conv_r4 converts the value at the top of the computing stack to float32.
Conv_r8 converts the value at the top of the computing stack to float64.
Conv_u converts the value at the top of the computing stack to an unsigned natural int and expands it to a natural Int.
Conv_u1 converts the value at the top of the computing stack to unsigned int8 and expands it to int32.
Conv_u2 converts the value at the top of the computing stack to unsigned int16 and expands it to int32.
Conv_u4 converts the value at the top of the computing stack to unsigned int32 and expands it to int32.
Conv_u8 converts the value at the top of the computing stack to unsigned int64 and expands it to int64.
Cpblk copies the specified number of bytes from the source address to the target address.
Cpobj copies the value type at the address of the object (&, * or natural int type) to the address of the target object (&, * or natural int type.
Div splits two values and pushes the result to the computing stack as a floating point (F type) or a quotient (int32 type.
Div_un removes two unsigned integer values and pushes the result (int32) to the computing stack.
DUP copies the current top value of the computing stack and pushes the copy to the computing stack.
Endfilter transfers control from the exception filter clause back to the common language structure (CLI) exception handler.
Endfinally transfers control from the fault or finally clause of the exception block back to the common language structure (CLI) exception handler.
Initblk initializes a specified block of memory located at a specific address to a given size and initial value.
Initobj initializes all fields of the object at the specified address as null references or 0 of the appropriate primitive type.
Whether the isinst test object reference (O type) is an instance of a specific class.
Ldarg loads parameters (referenced by the specified index value) to the stack.
Ldarg_0 loads the index 0 parameter to the computing stack.
Ldarg_1 loads the Index 1 parameter to the computing stack.
Ldarg_2 loads the index 2 parameter to the computing stack.
Ldarg_3 loads the index 3 parameter to the computing stack.
Ldarg_s loads parameters (referenced by the specified short format index) to the computing stack.
Ldarga loads the parameter address to the computing stack.
Ldarga_s loads the parameter address to the computing stack in short format.
Ldc_i4 pushes the int32 value to the computing stack as int32.
Ldc_i4_0 pushes the integer 0 to the computing stack as int32.
Ldc_i4_1 pushes the integer 1 to the computing stack as int32.
Ldc_i4_2 pushes the integer 2 to the computing stack as int32.
Ldc_i4_3 pushes the integer 3 to the computing stack as int32.
Ldc_i4_4 pushes the integer 4 to the computing stack as int32.
Ldc_i4_5 pushes the integer 5 to the computing stack as int32.
Ldc_i4_6 pushes the integer 6 to the computing stack as int32.
Ldc_i4_7 pushes the integer 7 to the computing stack as int32.
Ldc_i4_8 pushes the integer 8 to the computing stack as int32.
Ldc_i4_m1 pushes the integer-1 to the computing stack as int32.
Ldc_i4_s pushes the provided int8 value to the computing stack as int32 (short format ).
Ldc_i8 pushes the provided int64 type value to the computing stack as int64.
Ldc_r4 pushes the provided float32 type value to the computing stack as the F (float) type.
Ldc_r8 pushes the provided float64 type value to the computing stack as the F (float) type.
Ldelem loads the elements in the specified array index to the top of the computing stack according to the type specified in the instruction.
Ldelem_ I loads the natural int type element at the specified array index to the top of the computing stack as a natural Int.
Ldelem_i1 loads int8 elements at the specified array index as int32 to the top of the computing stack.
Ldelem_i2 loads int16 elements at the specified array index as int32 to the top of the computing stack.
Ldelem_i4 loads int32 elements at the specified array index as int32 to the top of the computing stack.
Ldelem_i8 loads int64 elements at the specified array index as int64 to the top of the computing stack.
Ldelem_r4 loads float32 elements located at the specified array index as F (float type) to the top of the computing stack.
Ldelem_r8 loads float64 elements at the specified array index as F (float type) to the top of the computing stack.
Ldelem_ref loads the element containing the object reference at the specified array index as an O (Object Reference) to the top of the computing stack.
Ldelem_u1 loads the unsigned int8 element at the specified array index as int32 to the top of the computing stack.
Ldelem_u2 loads the unsigned int16 element located at the specified array index as int32 to the top of the computing stack.
Ldelem_u4 loads the unsigned int32 element at the specified array index as int32 to the top of the computing stack.
Ldelema loads the address of the array element located in the specified array index as the & type (managed pointer) to the top of the computing stack.
Ldquo searches for the value of the field in the calculation stack that it references.
Ldflda searches for the address of the field that references the current computing stack.
Ldftn pushes the unmanaged pointer (natural int type) pointing to the Local Code implementing the specific method to the computing stack.
Ldind_ I indirectly loads a value of the natural int type to the computing stack as a natural Int.
Ldind_i1 indirectly loads int8 values to the computing stack as int32.
Ldind_i2 indirectly loads int16 values to the computing stack as int32.
Ldind_i4 indirectly loads int32 values to the computing stack as int32 values.
Ldind_i8 indirectly loads int64 values to the computing stack as int64 values.
Ldind_r4 indirectly loads the float32 type value to the computing stack as the F (float) type.
Ldind_r8 indirectly loads the float64 type value to the computing stack as the F (float) type.
Ldind_ref indirectly loads the object reference to the computing stack as the O (Object Reference) type.
Ldind_u1 indirectly loads unsigned int8 values to the computing stack as int32.
Ldind_u2 indirectly loads the unsigned int16 type value to the computing stack as int32.
Ldind_u4 indirectly loads the unsigned int32 type value to the computing stack as int32.
Ldlen pushes the number of elements in a one-dimensional array starting from scratch to the computing stack.
Ldloc loads local variables at the specified index to the computing stack.
Ldloc_0 loads local variables at index 0 to the computing stack.
Ldloc_1 loads local variables at Index 1 to the computing stack.
Ldloc_2 loads local variables at index 2 to the computing stack.
Ldloc_3 loads local variables at index 3 to the computing stack.
Ldloc_s loads local variables at a specific index to the computing stack (short format ).
Ldloca loads the address of the local variable located at a specific index to the computing stack.
Ldloca_s loads the address of the local variable located at a specific index to the computing stack (short format ).
Ldnull pushes an empty reference (O type) to the computing stack.
Ldobj copies the value type object pointed to by the address to the top of the computing stack.
Ldsfld pushes the static field value to the computing stack.
Ldsflda pushes the static field address to the computing stack.
Ldstr pushes new object references to strings stored in metadata.
Ldtoken converts the metadata tag to its runtime representation and pushes it to the computing stack.
Ldw.ftn pushes the unmanaged pointer (natural int type) pointing to the local code that implements the specific virtual method associated with the specified object to the computing stack.
Leave exits the protected code region and unconditionally transfers control to specific target commands.
Leave_s exits the protected code region and unconditionally transfers the control to the target command (abbreviated form ).
Localloc allocates a specific number of bytes from the local dynamic memory pool and pushes the address of the first allocated byte (transient pointer, * type) to the computing stack.
Mkrefany pushes the typed reference to a specific type of instance to the computing stack.
Mul multiplied two values and pushed the results to the computing stack.
Mul_ovf multiply the two integers, perform an overflow check, and push the results to the computing stack.
Mul_ovf_un multiply two unsigned integer values, perform an overflow check, and push the results to the computing stack.
Neg performs reverse lookup on a value and pushes the result to the computing stack.
Newarr pushes the reference of the new one-dimensional array from scratch (its elements belong to a specific type) to the computing stack.
Newobj creates a new object or instance of the value type, and pushes the object reference (O type) to the computing stack.
NOP fills in space if the operation code is patched. Although the processing cycle may be consumed, no meaningful operations are performed.
Not calculate the bitwise complement of the integer at the top of the stack and push the result to the computing stack as the same type.
Or calculate the bitwise complement of the two integers at the top of the stack and push the result to the stack.
Pop removes the value currently at the top of the computing stack.
Prefix1 this command is a reserved command.
Prefix2 this command is a reserved command.
Prefix3 this command is a reserved command.
Prefix4 this command is reserved.
Prefix5 this command is reserved.
Prefix6 this command is a reserved command.
Prefix7 this command is a reserved command.
Prefixref this command is a reserved command.
Readonly specifies that the subsequent array address operations do not perform type checks at runtime, and return managed pointers with limited variability.
Refanytype searches for type tags embedded in a typed reference.
Refanyval retrieves the addresses (& types) embedded in the typed references ).
Rem splits two values and pushes the remainder to the computing stack.
Rem_un splits two unsigned values and pushes the remainder to the computing stack.
RET returns the current method and pushes the returned value (if any) from the caller's computing stack to the called's computing stack.
Rethrow raises the current exception again.
SHL shifts the integer value left (with zero fill) to the specified number of digits and pushes the result to the computing stack.
SHR shifts the integer value to the right (retain the symbol) of the specified number of digits and pushes the result to the computing stack.
Shr_un shifts the unsigned integer value right (filled with zero) to the specified number of digits and pushes the result to the computing stack.
Sizeof pushes the size (in bytes) of the provided value type to the computing stack.
Starg stores the value at the top of the computing stack to the parameter slot of the specified index.
Starg_s stores the value at the top of the computing stack at the specified index (short format) in the parameter slot ).
Stelem replaces the array element at the given index with the value in the computing stack, and its type is specified in the instruction.
Stelem_ I replaces the array element at the given index with the natural int value on the computing stack.
Stelem_i1 replaces the array element at the given index with the int8 value on the computing stack.
Stelem_i2 replaces the array element at the given index with the int16 value on the computing stack.
Stelem_i4 replaces the array element at the given index with the int32 value on the computing stack.
Stelem_i8 replaces the array element at the given index with the int64 value on the computing stack.
Stelem_r4 replaces the array element at the given index with the float32 value on the computing stack.
Stelem_r8 replaces the array element at the given index with the float64 value on the computing stack.
Stelem_ref replaces the array element at the given index with the ref value (O type) of the computing stack object.
Stfld replaces the value stored in the field of the object reference or pointer with the new value.
Stind_ I stores the natural int type value in the provided address.
Stind_i1 stores the int8 type value in the provided address.
Stind_i2 stores int16 type values in the provided address.
Stind_i4 stores int32 values in the provided address.
Stind_i8 stores the int64 type value in the provided address.
Stind_r4 stores float32 type values in the provided address.
Stind_r8 stores float64 values at the provided address.
Stind_ref stores the object reference value at the provided address.
Stloc pops up the current value from the top of the computing stack and stores it in the local variable list at the specified index.
Stloc_0 pops up the current value from the top of the computing stack and stores it in the local variable list at index 0.
Stloc_1 pops up the current value from the top of the computing stack and stores it in the local variable list at Index 1.
Stloc_2 pops up the current value from the top of the computing stack and stores it in the local variable list at index 2.
Stloc_3 pops up the current value from the top of the computing stack and stores it in the local variable list at index 3.
Stloc_s pops up the current value from the top of the computing stack and stores it at the index (short format) in the local variable list ).
Stobj copies the specified type of value from the computing stack to the provided memory address.
Stsfld replaces the static field value with the value from the calculation stack.
Sub deducts a value from other values and pushes the result to the computing stack.
Sub_ovf deducts an integer from another value, performs an overflow check, and pushes the result to the computing stack.
Sub_ovf_un removes an unsigned integer from another value, performs an overflow check, and pushes the result to the computing stack.
Switch to jump to the table.
Tailcall executes the method call instruction with the suffix to remove the stack frame of the current method before executing the actual call instruction.
Throw triggers the exception object currently on the computing stack.
Unaligned indicates that the current address on the computing Stack may not be aligned with the natural size of the following ldind, STIND, ld1_, st1_, ldobj, stobj, initblk, or cpblk commands.
Unbox converts the boxed representation of the value type into its unboxed representation.
Unbox_any converts the boxed representation of the specified type in the command to the unboxed representation.
Volatile specifies that the current address at the top of the computing stack can be easy to lose, and the results of reading this location cannot be cached, or multiple storage zones of this address cannot be canceled.
XOR calculates the bitwise XOR of the two values at the top of the computing stack and pushes the result to the computing stack.

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.