Just interested, Daniel passed by.The silent sister sends a software which is cracked by the SMC Way, then studies its shellcode in the SMC.//////////////////////////////////////////////////////////////////////////////////////////////////Execution process:1. First get kernel32 imagebase as the initial analytic PE, get the export table.2. Then remove the GetProcAddress function address to get the specified API3.Api Hook cracked the softwareAnalysis Code:00400380 Pushad; Save Regi
on the hard drive into the 0x900 of the memory address
main boot program;------------------------------------------------------------%include "Boot.inc"
Section MBR vstart=0x7c00 mov ax,cs mov ds,ax mov es,ax mov ss,ax mov fs,ax mo
carried out in assembly, let's talk about some personal opinions. Next, we will conduct some small tests and explain them in assembly language. You can do it together.
(1) Char name [] and char * Name
[CPP] View plaincopy
1:
2:VoidProcess ()
3 :{
00401020 push EBP
00401021 mov EBP, ESP
00401023 sub ESP, 4ch
00401026 push EBX
00401027 push ESI
00401028 push EDI
00401029 Lea EDI, [ebp-4Ch]
0040102c
Note that there are programs and test programs. For example, exp1303.asm refers to Chapter 13's third question. exp1303. ASM refers to the test of exp1303 program...
; Exp1301.asm
Install the 7ch Interrupt RoutineFunction: calculates the square of a word number.;;Assume Cs: Code
Code segmentStart:; Copy the code to a non-system management areaMoV ax, CSMoV ds, axMoV Si, offset sqr; copy from sqr of CS segment to 0: 200
MoV ax, 0MoV es, axMoV Di, 200
talk about some personal opinions. Next, we will conduct some small tests and explain them in assembly language. You can do it together.
(1) char name [] and char * name
1:
2: void process ()
3 :{
00401020 push ebp
00401021 mov ebp, esp
00401023 sub esp, 4Ch
00401026 push ebx
00401027 push esi
00401028 push edi
00401029 lea edi, [ebp-4Ch]
0040102C mov ecx, 13 h
00401031
model. Of course, this security model consists of multiple periods.
Sometimes user-State jobs cannot be completed without the core-level functions, which is why native APIs are introduced. Native APIs are non-documented internal function sets and run in kernel mode. Native APIS exist to provide some ways to securely call kernel-mode services in user mode.
A user application can call the native API exported by NTDLL. dll. A large number of functions exported by NTDLL. dll are used to en
push EAX; block table size
push edx; edx is the offset of the Virus code block table
push esi; buffer address
Combined virus code block and Virus code block table must be less than or equal to the amount of space not used
Inc ECX
push ecx; Save numberofsections+1
SHL ecx, 03h; multiply 8
push ecx; reserved virus block table space
Add ecx, eax
add ecx, edx; offset of the body of the ecx+ file
Sub ecx, (sizeofheaders-@9) [esi]
Not ECX
Inc ECX; ecx for file header size-offset of
Share notesFilter function (called by __except (filtered expression) after an exception occurs) DWORD Filters (DWORD code, Pexception_pointers exceptioninfo) {/* This is just a test that captures what type of exception (depending on the situation) is determined by the condition, except for the 0 exception. Switch (Code) {//Memory access exception case Exception_access_violation:break; Except for 0 exception case Status_integer_divide_by_zero: {int a = 10; 012C44E1
1. Simple Man-Machine Interaction
Stacka segment
DB 100 DUP (?)
Stacka ends
Data Segment
Mess1 dB 'What is your name? ',' $'
Mess2 dB 'How old are you? ',' $'
Buf1 dB 20
DB?
DB 20 DUP (?)
Buf2 dB 15
DB?
DB 15 DUP (?)
Data ends
Code segment
Assume Cs: code, DS: data, SS: stacka
Main proc far
Start: PUSH DS
MoV ax, 0
PUSH AX
MoV ax, Data
MoV ds, ax
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: 0
be viewed through the linux system, but the stack frame Implementation of centos7 seems to be somewhat different, and the same code cannot run on centos7.
The following is a Disassembly
1 int main() 2 { 3 00A118E0 push ebp 4 00A118E1 mov ebp,esp 5 00A118E3 sub esp,0D8h 6 00A118E9 push ebx 7 00A118EA push esi 8 00A118EB push edi 9 00A118EC lea edi,[ebp-0D8h] 10 00A118F2
is not running in the compiler environment and does not include to declare functions, there is no function table for the application. Therefore, shellcode needs to find its own API function address and then forcibly call it.(1) Find the kernel32.dll base address:The APIs used in the shellcode are generally unrelated to the user interface, because it is used in kernel32.dll to do bad things. Therefore, we must first find the base address of kernel32 to further find the specific address of each A
I have been studying assembler recently, but the input and output are my first difficulties. Here I will briefly describe some basic output and output strings, characters, output numbers, and other knowledge of assembler, it is only for everyone to learn. This is only some basic knowledge. Compilation experts can also learn some basic input and output knowledge. 1. The output string below is the code that calls the 9 function to output the string "Hello World.
Datas segment; Output string 13 pre
Player cannot play Master
[code=php] [/code]
/*
if ($_get[' url ']!= ') {
$mov _url=$_get[' url '];
$mov _wigth=$_get[' W '];
$mov _height=$_get[' h '];
$mov _auto=$_get[' a '];
$mov _player=$_get[' P '];
*/
if ($url!
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.