add eax,0x8; Pptr+2 003cc57c; In C language, the operation of pointers is 003cc57c based on pointer type; An int pointer plus 1 means that the address it points to is moved backward in length to a 003cc57c; The distance of the int size, which is 4 bytes. If it's a word type, move backwards by 2 bytes. 003cc57f Push eax003cc580 mov ecx,[local.7]003cc583 add ecx,0x4; Pptr+1 003cc586 push ecx003cc587 mov edx,[local.7]003cc58a push
(MOV)
(An immediate number is actually a constant integer.) different operand type combinations supported by the data transfer Directive
What is inside the parentheses represents the memory address.
(For example,%eax, which represents a memory address.) Simple addressing mode
If we have an operand that accesses memory, then how is the memory address calculated or referred to as how it is addressed.
(-Indirect addressing
Take Movl (%ECX),%eax as an example:
The register ECX inside the value a
(LOCK_PREFIX "decl (% eax) \ n" \ # as shown here, if count is first subtracted from the thread, SF is not equal to 1 (not equal to negative ), execute it later, that is, obtain the lock. then, if the thread that tries to obtain the lock executes this atomic operation (in the unlocked state), SF equals 1, so that void (*) (atomic_t *) is executed *) type Function to enter the waiting queue. therefore, this locking atomic operation can be completed with a single command. in non-SMP scenarios, a
have been learning about Windows kernel recently, write a blog for memo.The specific process of Windows system call in the Pan teacher's "Windows kernel Principle and implementation" in the 8th chapter has been written very clearly, first read the picture given in the.Take CreateFile as an example, after some parameter checking in Ring3 's CreateFile, the final call is NtCreateFile in Ntdll. There are also zwcreatefile, but their addresses point to the same area, so they are essentially the same
the ELF format is generally divided into the following parts :. text ,. data and. bss, where. text is a read-only code area ,. data is a readable and writable data area, while. bss is a readable and writable data zone without initialization. Code and data zones are collectively called sections in ELF. You can use other standard sections or add custom sections as needed, but at least one ELF executable program should have one. text section. The following is our first assembler, In the ATT assemb
Movl $ sys_write, % eax
Movl st_filedes (% EBP), % EBX
Movl st_write_buffer (% EBP), % ECx
Movl $ record_size, % edX
Int $ linux_syscall
# Note-% eax has the return value, which we will
# Give back to our calling program
Popl % EBX
Movl % EBP, % ESP
Popl % EBP
RET
File write-records.s:
. Include "Linux. s"
. Include "record-def.s"
. Section. Data
# Constant data of the records we want to write
# Each text data item is padded to the proper
# Length
insensitive, that is, the meaning of
Function rightpos (const substr, S: string): integer;VaRIPOs: integer;Tmpstr: string;BeginTmpstr: = s;IPOs: = pos (substr, tmpstr); Result: = 0;// Find the location where substr appears for the first timeWhile IPOs BeginDelete (tmpstr, 1, IPOs + Length (substr)-1 );// Delete the searched charactersResult: = Result + IPOs;IPOs: = pos (substr, tmpstr); // find the position where the substr appearsIf IPOs = 0 Then break;Result: = Result + Length (substr)-1;End
1) classic comparison, usually at the registration code (by programhunter)1MoV eax [] can be an address or another register.MoV edX [] the preceding two addresses usually store important information.Call 00 ??????Test eaxJZ (jnz)2MoV eax [] can be an address or another register.MoV edX [] the preceding two addresses usually store important information.Call 00 ??????JNE (JE)3MoV eax []MoV
computer tests, only through their own test, the magic is not much difference in Ubuntu, the problem is said later), and then I compile, look at their assembly code, found a mysterious thing I do not understand.
The following are the assembly codes for the If-else and three mesh operations respectively.
37:if (a>b) 00401079 mov ecx,dword ptr [ebp-10h] 0040107C cmp ecx,dword ptr [ebp-14h]
0040107F jle main+79h (00401089) 38:temp=a; 00401081 mov edx,dw
Different compilers may produce different codes, resulting in different results.
The Code is as follows:
#include
Environment: win7
Compiler: GCC
IDE: vc ++ 6.0/DEV-C ++
Result: q = 22
: Q = (++ j) + (++ mov eax, dword ptr [ebp-] Move J = add eax, add 1 to the Register eax value, eax = 0040103C mov dword ptr [ebp-], eax moves the register value to the variable j, j = 0040103F mov ecx, dword ptr [ebp-] Move J = add ecx, in the register, ecx +, j = mov dword ptr [ebp-], ecx moves the value on
| pDebugEvent = 0012ED7C0012DC94 000003E8 Timeout = 1000. MS0012DC98 7C930738 ntdll.7C930738
Locate CD90 in the data window and check the OEP value.
Now go to the code window Ctrl + G: 0181c386Ctrl + f search command at the current location: or eax, 0FFFFFFF8Locate the first place in 0181c956, on which cmp dword ptr ss: [ebp-A34], where 0 sets the breakpoint.
0181C90A> 83BD CCF5FFFF> cmp dword ptr ss: [EBP-A34], 0 // off, Shift + F9 interrupt down to [ebp-A34] = [0012CD7C] = 000001B7 clear 0018
After the system patch is completed, the online blind irrigation is still connected to www.net.cn. now .... put down his network horse, 8 error, really good. kill 98. nt.2000.xp. xpsp2.2003. I kept it myself and analyzed his Trojan. A traffic Trojan. Server. Now all the ponies are here.Slightly shelled, written in VB.00403DAD. FF15 54104000 call dword ptr ds: [00403DB3. 8985 E0FCFFFF mov dword ptr ss: [EBP-320], EAX00403DB9. EB 0A jmp short Rundll32.00403DC500403DBB> C785 E0FCFFFF> mov dword ptr
will break down the BPX shell_policyicona breakpoint and use F12 to check if the software is called and the parameters are used!
First come to the following:
Here is where the software is called at startup:
* Possible reference to string resource id = 00114: "CCProxy"|: 00408770 6a72 push 00000072: 00408772 51 push ECx: 00408773 c681_f0000000005 mov byte PTR [esp + 000024f4], 05: 0040877b e8c0890100 call 00421140: 00408780 83c408 add ESP, 00000008: 00408783 50 push eax: 00408784 8d4c2414 Lea EC
][-----------------------------------------------------------]The example of shellcode below can effectively deal with NaI Entercept. The method used is to rewrite the function header.[-----------------------------------------------------------]
// This sample code overwrites the preamble of winexec and// Createprocessa to avoid detection. The Code then// Callwinexec with a "calc.exe" parameter.// The Code demonstrates that by overwriting Function// Preambles, it is able to evade Entercept and
Mul: Unsigned Multiplication
; Influence of, CF flag bit; Command Format:; Mul R/m; parameter is the multiplier; if the parameter is R8/M8, the Al will be used as the multiplier and the result will be placed in ax; if the parameter is R16/M16, ax will be used as the multiplier and the result will be placed in eax; if the parameter is R32/M32, eax will be used as the multiplier and the result will be placed in edX: eax
; Test27_1.asm.38
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.