{2002.8.5 kingron}
{Source: Source string}
{Sub: Sub string}
{Return: Count}
{Ex: strsubcount ('abccdcd', 'bc') = 2}
Function strsubcount (const source, Sub: string): integer;
VaR
Buf: string;
I: integer;
Len: integer;
Begin
Result: = 0;
Buf: = source;
I: = pos (sub, Buf );
Len: = length (sub );
While I Begin
INC (result );
Delete (BUF, 1, I + len-1 );
I: = pos (sub, Buf );
End;
End; {strsubcount}
{The following function returns the position after the specified position of substr in S}{Example:
known to be tuned in the control function and its argument list (stored in aIn the Tvarrec array), how to pass the arguments in when it is called. This requires a few preliminary knowledge:1. First let's take a look at this parameter list: Params. Its type is called variable-open by Delphi.Array of Tvarrec (Variant Open array), which means that the Params is aA member is an array of Tvarrec. In other words, when parameters are passed into the Params, various types areDelphi Automatic conversion
table are in the exception_table_entry structure:
struct exception_table_entry{ unsigned long insn, fixup;};
Insn is the linear address of the instruction to access the process address space. When a page-missing exception is triggered by commands in the insn unit, fixup is the assembly instruction code address to be called. Generally, this assembly code forces the service routine to return an error code to the user-state process.
Insert a table item to the exception table through the Assembl
from left to right. We are still confident that the suffix-specific method and multiplication have a higher operation priority, so we will soon prove ourselves that there is no order in which we can calculate I ++, add up and multiply the three array elements to get 60.
Now I am fascinated by this. My first thought was to check the disassembly code of the code and try to find out what actually happened. I used the debug symbol debugging symbols) to compile this sample code. After using objdump,
] corresponds to the offset of the interrupt number in the Interrupt Descriptor table, the type of the interrupt descriptor is 15, and the privilege level is 3. #define SET_SYSTEM_GATE (N,ADDR) _set_gate (IDT[N],15,3,ADDR)////set the gate description macros function. Parameters: GATE_ADDR-descriptor address; Type-descriptor field value; DPL-descriptor privileged layer value; addr-offset address. %0-(Type label word combined by Dpl,type);%1-(Descriptor low 4-byte address),//%2-(Descriptor high 4-
results are as follows: One of the first two cases overflowed, and only the third was normal. And then we'll look at their assembly code, which is the assembler code I disassembled with Objdump: 1 intMainintArgc,char *argv[])2 {3 8048394: - Push%EBP4 8048395: theE5mov%ESP,%EBP5 8048397: theE4 F8 and$0xfffffff8,%esp6804839a: theEc - Sub$0x30,%esp7Long Muln =203879;8804839d: C7 - - 0c the1cGenevamovl $0x31c67,0xc (%ESP)980483A4:xx TenLong Long MULNL =2
After openedx is installed, access is very slow. The reason is that fonts.googleapis.com is blocked in China. Therefore, the image is changed to a 360 image, which is expected to be used for a long time. Major changes: 1.cd/edx/app/edxapp/edx-platform/lms/static/sass/basesudo vi _ font_face.scss 2.cd/edx/app/edxapp/edx
prompt in the ocean of strings: "You have purchased and registered the shared data protection expert advanced Edition Software, thank you for your support! ". This prompt is no longer clear. Double-click it and you will be directed to the corresponding code. We still perform analysis in the order of first flow and then algorithm, just like the previous analysis process.
An amazing burst"First, find the place where the registration process starts, follow the registration success prompt to look u
overflow, so instead of There are also problems with the number of signed and unsigned numbers, and when the length is particularly large, the correct result is not obtained.So instead:unsigned Ifor (i = 0; i ****************************************************************Declaration: The following various byte-length representations are based on the IA32 instruction set architecture.Machine-level representation of the program:A IA32 central processing unit contains 8 registers that store the
This article is divided into 3 modules.
Example---example of this directive
explain ---to the point where the instructions are difficult to understand
Practice ---in order to become more familiar with the directive
1.1 Signed Division instruction and take-over example:In the C language to complete the 8/2 assembly instructions are as follows:in C language to complete 8 2 of the assembly instructions are as follows:An example of a 4-byte division and take-rest operation is
Previously asked on edx code (edx Google Group) How to expand a field for course, such as adding a category field to a course.The reply says to add the field you want directly to the couesefields. Position common/lib/xmodule/course_module.py after. The field is automatically displayed in the Advanced settings. In this way I find that the field is indeed a property of course (experiment in the shell). Howeve
basically no design pattern, which cannot reflect the great superiority of the C ++ language in object-oriented design. Let's take a look at how this virtual works?
[CPP] View plaincopy
76: employee P;
0040128d Lea ECx, [ebp-10h]
00401290 call @ ILT + 45 (employee: Employee) (00401032)
00401295 mov dword ptr [ebp-4], 0
77: manager m;
0040129c Lea ECx, [ebp-14h]
0040129f call @ ILT + 65 (Manager: Manager) (00401046)
004012a4 mov byte PTR [ebp-4], 1
78: employee * E =
of system_call. In system. h:
//// Set the system call function. // Parameter: n-interrupt number; addr-interrupt program offset address. // Idt [n] corresponds to the offset value of the interrupt number in the Interrupt Descriptor Table. The Interrupt Descriptor type is 15 and the privileged level is 3. # Define set_system_gate (n, addr) _ set_gate ( idt [n], 15,3, addr) /// set the macro function of the gate descriptor. // Parameter: gate_addr-Descriptor address; type-Descriptor field value
converted to the address of the method to be called and the list of its parameters (stored inTvarrec array), how to pass parameters when calling it. Some preparations are required:
1. First, let's take a look at the passed parameter table: Params. Its type is called Variable-enable by Delphi.Put an array (variant open array), equivalent to array of tvarrec, that is, Params isArray of tvarrec members. In other words, all types of parameters areDelphi is automatically converted to tvarrec (see
state transition.
on each platform, there is a specific directive that converts the execution of a process from user state to a core state, which is called the Operating system trap (operating system traps). After the process has been executed into the command, it can run the system call code in the kernel mentality.
In Linux it is through soft interrupts to achieve this, on the x86 platform, this instruction is int 0x80. That is, in Linux, the interface of the system call is a special case o
EAX, the parameter is EBX, ECX, edx, EDI, ESI to pass. Writing Shellcode To write Shellcode under Linux, you can use GCC to assemble directly. s file to compile the link, generate the standard executable Elf file, but also can be directly tested, but it is not convenient to extract machine code is very inconvenient.In order to facilitate the extraction of machine code, using the NASM compiler to generate the bin file, no other format data, convenient
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.