, EDX, 0, 0Invoke closehandle, eax. EndifInvoke sleep, 1000JMP @ BRETShelld endp
Start:
; Read the base address and size of your memory imageInvoke getmodulehandle, 0MoV hmodule, eax; Save the base address hereMoV EDI, eaxAssume EDI: PTR image_dos_headerAdd EDI, [EDI]. e_lfanewAdd
-4]
00401273 call @ ILT + 0 (Manager ::~ Manager) (00401005)
00401278 pop EDI
00401279 pop ESI
004020.a pop EBX
004010000b add ESP, 44 h
0040da-e cmp ebp, ESP
00401280 call _ chkesp (00408760)
00401285 mov ESP, EBP
00401287 pop EBP
We found that the manager structure and analysis structure are also simple. A constructor is constructed when a variable appears. When will the structure be analyzed? The function is analyzed at
.
In this example, replace _ cdecl with _ stdcall:
Int _ stdcall add (int A, int B)
{
Return (A + B );
}
Disassembly code of function call:
; Add (1, 2 );
Push 2; the parameter is pushed from right to left to 2 first
Push 1; press 1
Call @ ILT + 10 (ADD) (0040100f); call function implementation
Disassembly code for function implementation:
; Int _ stdcall add (int A, int B)
Push EBP
MoV EBP, ESP
Sub ESP, 40 h
Push EBX
Push ESI
Push
Reading Tips:
《Delphi Image ProcessingThe series focuses on efficiency. The general code is Pascal, and the core code is BaSm.
The C ++ image processing series focuses on code clarity and readability, all using C ++ code.
Make sure that the two items are consistent and can be compared with each other.
The code in this article must include the imagedata. Pas unit in "Delphi Image Processing-data type and public process.
Set the Key Color of the image to make the color of an image or within a ce
Label: Ar SP Div BS as Har relation ca nbspThree registers are involved: ECx, Al, EDI, and ZF bit and DF bit of the Mark register.Repne first checks whether ECx is 0, and if it is not 0, the loop is performed.Scasb is equivalent to SCAs byte ptr ds: [EDI] That is, sub Al, byte ptr ds: [EDI]. in addition, if the flag register df = 0, after scasb is executed,
I hope you can come up with some ideas ~
Check whether there is any shell... Microsoft Visual C ++ 6.0, indicating no shell ~
Let's enter an account and password for trial run ~ The error message "incorrect registration name or registration code!" is displayed !"
Okay. Let's load it with OD ~~ Search for asii, find the error message, and double-click it to go to the code ~
00401d00/0f85 df1_00 jnz ultradic.00401de500401d06. | 68 01100000 push 100100401d0b. | 68 f4704300 push ultradic.004370f4; A
, because the parameter needs to be seen before createfont is called, to determine which call corresponds to the song name, use "BC" to clear the breakpoint and set the breakpoint in the last return statement of the kernel, then press "F5" until Winamp starts running and closes it."Load" again, press "F5", this time it stops on the Return Statement in the kernel, and then press "F10" to return to the code area where Winamp is located, and look up, you can see the following code:
"Copyright Notice: respect for the original, reproduced please retain the source: blog.csdn.net/shallnet, the article only for learning Exchange, do not use for commercial purposes"the CMPS directive is used to compare string values, and the CMPS directive has three formats: CMPSB, CMPSW, CMPSL. The implied source operand and target operand locations are stored in the ESI and EDI registers, and each time the cmps instruction is executed, the ESI and
).
So the different compilers of different platforms have to be treated differently. The above is the last insufficient supplement.
Here's a look at the array:
test.c Example:
Copy Code code as follows:
void Hello1 ()
{
int a[3]={1,2,3};
int b=a[1];
}
void Hello2 ()
{
int a[3]={1,2,3};
int b=* (a+1);
}
void Hello3 ()
{
int a[3]={1,2,3};
int B=1[a]; Is that right?
}
If you look carefully, the difference between the three functions is that of the
[Debugging environment]: WinXP, Ollydbg1.10C, WinHex, LordPE, UPXAngela, ImportREC
---------------------------------[Shelling Process ]:
In fact, this article is just an Ollydbg version of UPX in "encryption and decryption" 2nd.It is very convenient for Ollydbg1.10C and UPXAngela to remove the upx dll.---------------------------------1. Get the relocated table RVA and OEP
Code :--------------------------------------------------------------------------------003B8100 807C24 08 01 cmp byte ptr ss:
, dword ptr ds: [403236]; the first address of the user name is to esi00401627 8D3D 58324000 lea edi, dword ptr ds: [403258]; place the calculated User Name0040162D B9 0A000000 mov ecx, 0A; ecx = 1000401632 0FBE041E movsx eax, byte ptr ds: [ESI + EBX]; eax = the first character of the user name00401636 99 CDQ00401637 F7F9 idiv ecx; division operation, eax = 122/10 = 12 = ch, edx (remainder) 122% 10 = 200401639 33D3 xor edx, EBX; abnormal or operate ed
Once the original program encounters a 0-byte file, it will be suspended. Here I added the seh error handling code, which perfectly solved the problem!
. 386
. Model flat, stdcall
Option Casemap: None
Include windows. inc
Include user32.inc
Includelib user32.lib
Include kernel32.inc
Includelib kernel32.lib
. Data?
Hfile dd?
Hmapfile dd?
Lpfile dd?
. Const
Szerr DB "is not a valid 32-bit program! ", 0
Szok db "is an executable file! ", 0
Szno DB "failed to open the file! ", 0
Szname DB "D:. EXE
This is even a boring time to track part of Kingsoft Ranger's code, and write the complete code according to the program process with the compilation. Let's be a trainer!
0041ec32/. 55 push EBP; Use EBP to read the stack and find external parameters. Therefore, save EBP first.0041ec33 |. 8bec mov EBP, esp; Use EBP to read the stack, so that ESP is constantly changing0041ec35 |. 51 push ECx0041ec36 |. 56 push ESI0041ec37 |. 57 push EDI; values of the a
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
int goo(int a, int b){return a + b;}void foo(){int a[] = {1, 2, 3};int result = goo(a[1], a[2]);printf("result: %d", result);}
Compile in vs2010
Foo function assembly:
00EB3890 push ebp 00EB3891 mov ebp,esp 00EB3893 sub esp,0E4h 00EB3899 push ebx 00EB389A push esi 00EB389B push edi 00EB389C lea edi,[ebp-0E4h] 00EB38A2 mov ecx,39h
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.