Note:The address of the next instruction to be executed in the EIP register;MoV eax and EBX move the eax content of the register to EBX. The machine instruction is 2 bytes.The operation performed by the Leave command is equivalent to mov EBP, ESP, and pop EBP. The machine command is 1 byte.The operation performed by the RET command is equivalent to pop EIP, and the machine command is 1 byte.The operation performed by the call ADDR command is equivalen
after NAT, perform Test2. If the STUN Client can receive a response from the STUN Server, it indicates that the STUN Client is Full Cone NAT; otherwise, further testing is required. 1.2.1. Perform Test1 #2. STUN Client compare whether the IP-m1 and IP-m1 #2 are the same, if not the same, it means that the STUN Client is the sort Ric NAT type; otherwise, further testing is required. 1.2.1.1 Test3. If the STUN Client can receive a response from the STUN Server, it indicates that the STUN Client i
Today I read the chapter on calling functions from the ground up (page 53) in programming, and I have some knowledge about function calls in assembly language. Call this function name when calling a function in assembly language. The function execution process is as follows:
Prepare for execution
In the masterProgramIn each call to a function, the parameters are first pushed to the stack in reverse order;Then call func_name. Here, call will do two things: first, put the return address of the
; the bounds of the descriptor Lgdt [cs:pgdt+0x7c00]43] in al,0x92 ; The port in the South Bridge chip is al,0000_0010b46 out 0x92,al; open A204748 CLI Interrupt mechanism has not yet worked 4950 mov eax,cr051 or eax,152 mov cr0,eax ; set PE bit 53 54; The following enters the protection mode ... JMP DWORD 0x0010:flush; 16-bit Descriptor Selector Sub: 32-bit offset 56 57 [ bits [] flush:59 mov eax,0x0018 DS,EAX61 mov mov
can work with each other and execute the code in step.The current experiment requires disassembly of a simple C program, direct reading of the assembly code to understand the core working mechanism of computer hardware (stored program computer and function call stack) has some help, the following is my experimental process.experimental Environment: Experimental Building1. Create a C file exp.cThe EXP.C code is as follows:2. Enter the following instructions to compile the assembly code:
store, you can connect to it after you execute the command. But for local ret, I'm afraid you are not easy to find its storage address, then the RET space where? Don't worry, we'll go on.
# objdump–d OVERFLOW1.O
Over3.o:file format elf32-i386
Disassembly of section. Text:
00000000
0:55 Push%EBP
1:89 e5 mov%esp,%ebp
3:83 EC Sub $0x10,%esp
6:c7 FC Movl $0x0,-0x4 (%EBP)
D:8B FC Mov-0x4 (%EBP),%
type of pointer. In order for Arg to point to the first variable parameter, we use the address of NR with the data type size of NR, which can be achieved by using the following definition.#define VA_START (ARG, start) arg = (va_list) ((char*) (start) + sizeof (start)).
By ((char*) (start) + sizeof (start), you can get the address of the first variable parameter and cast it to the va_list type.
After the first variable parameter is successfully removed, the next task is to continue to remove t
;
void Fun ()
{
g_st.f1 = ten;
G_ST.F2 =;
G_ST.F3 = +;
G_ST.F4 = +;
G_st.f5 = 50.0;
}
The corresponding assembly is: it can be seen that in this disassembly code list, access to struct members does not require any arithmetic calculations, if there is no source code, you simply cannot conclude that the program uses the structure.
Push EBP
mov EBP, esp
mov dword_403018, ten; int f1 = ten
mov eax,
mov word_ 40301C, Ax; Word F2 =
MaybeScheduleMemoryPressureEvent()//Enable The"memory-pressure" state
If the memory size is less than 0 × 08000000 bytes, the memory-pressure status is automatically activated. When firefox enters this state mode, the constructor of the BumpChunk object will be created:
// In "js::detail::BumpChunk * js::LifoAlloc::getOrCreateChunk()" / mozjs.dll 0x00BFEF3E push edi ; Size 0x00BFEF3F call ds:__imp__malloc 0x00BFEF45 add esp, 4 0x00BFEF48 test eax, e
of data from the Badfile file, but the buffer is only 20 bytes long, so it is possible to find the stack overflow.Here is the compilation code compiled in the context of Cygwin (I have removed some details that are irrelevant to the logical understanding):_main:PUSHL%EBPMOVL%esp,%EBPAndl $-16,%espSubl $32,%espCall ___mainMOVL $LC 0, 4 (%ESP)MOVL $LC 1, (%ESP)Cal
this is the most important point.
The __cdecl rule requires the caller to be responsible for the stack's recovery, and in the assembly's perspective, the location of the recovery stack is within the calling function, considering such a C + + code (in VC Debug)
Copy Code code as follows:
#include
void __cdecl func (int param1, int param2, int param3) {int var1 = param1;int var2 = param2;int var3 = PARAM3;
printf ("%ld\n", Long (param1));printf ("%ld\n", Long (param2));prin
Method-On both sides
VroThe same name is required. In the example, encry-des
Crypto ipsec transform-set encry-desesp-des
(4) Various conditions required for establishing a VPN connection-ipsec-manual
Method
Crypto map vpntest 8 ipsec-manual
(5) Use crypto map in the previous step to enter the crypto configuration mode.
A) configure a remote VPN gateway
Set peer 202.106.185.2
B) Configure Inbound and Outbound Security alliances
Set security-association inbound
I learned how to call functions in the past, but I forgot to use them for a long time ~~ I wonder if anyone else has this experience. It is nice to know a lot about the underlying details of the compiler when writing C/C ++ programs. Otherwise, it may be frustrating. Although it is relatively simple, let's also recall...
We know that the most common way to pass parameters in a function call is to use a stack. The local variables of a function are also created on the stack. How can this problem b
Disable the Linux memory address randomization mechanism and disable process address space randomization. you can fix the base address, stack, and vdso page addresses of the mmap process. you can set kernel. randomize_va_space kernel parameters are used to set memory address randomization. currently, three randomize_va_space values are available: [, 2] 0-indicating that the process address space is disabled for randomization. 1-randomizes the base address, stack, and vdso pages of mmap. 2-adds h
during function calls in a program, analyzing the specific implementation of function calls can help you understand the principle of computer operation. We will write the above Code into the main. c file. Then use
gcc -S -o main.s main.c -m32
Command to generate assembly code. The result is as follows. The append-m32 is used for disassembly Based on the 32-bit method.
We only need to look at the key part of the assembly code. We can delete all the statements starting with a vertex and get the
National Day holiday did not have to do a few pwn problem practiced hand, and so there is time to post the analysis of the PWN problem.Bypassing DEP using the VirtualAlloc method is much the same as the previous method, except that VirtualAlloc opens up a new executable memory space, and then copying the shellcode is a little trickier than modifying the memory properties.VirtualAlloc function Description: Lpaddress: The starting address of the application memory, the experiment selected 0x00030
, to this step:
After entering the main () function, no statement has been executed, we right-click and go To Disassembly:
See the Code of assembly language, what is EBP and ESP in the figure? We know that when calling a function, the operating system allocates a memory space to the function, and before that the main () function is called by the-__tcrtstartup () function, so look at:
When the Maincrtstratup () function calls the __tmain
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.