for (int i = 0;
i < PRODUCTS_COUNT; i++) {
if (! check_product( products[i].category)) {
printf(\product !!!\\n\
break; }
if
(products[i].category == SOFTWARE) {
if (!
check_software(
products[i].p.software.info)) {
printf(\ software !!!\\n\
break; } } pop ecx
test eax, eax
jnz short product_is_valid
push offset aInvalidProduct ; format call _printf pop ecx
jmp short exit
; ------------------------------------------------------------
product_is_valid: ; CODE XREF: main+E0j mov edx, esi shl edx, 4 add edx, esi
cmp [ebx+edx*8+product_t.category], SOFTWARE
jnz short print_product mov ecx, esi shl ecx, 4 add ecx, esi push
[ebx+ecx*8+product_t.p.software.info] ; software_info
call check_software pop ecx
test eax, eax
jnz short print_product
push offset aInvalidSoftwar ; format call _printf pop ecx
jmp short exit
; -----------------------------------------------------------
print_product: ; CODE XREF: main+FBj main+110j
imul eax, esi, 88h add eax, ebx
push eax ; product call print_product pop ecx inc esi cmp esi, 4
print_product(&produc jl short loop_verify_print_product
exit: ; CODE XREF: main+EDj main+11Dj
ts[i]); }
free(products); }
push ebx ; block call _free pop ecx pop edi pop esi pop ebx pop ebp retn main endp
; [COLLAPSED AREA .text2. PRESS KEYPAD \TO EXPAND]
; [COLLAPSED AREA .text2. PRESS KEYPAD \TO EXPAND]
; Section 2. (virtual address 0000A000) ; Virtual size : 00003000 ( 12288.)
; Section size in file : 00002800 ( 10240.)
; Offset to raw data for section: 00009400 ; Flags C0000040: Data Readable Writable ; Alignment : 16 bytes ?
; ------------------------------------------------------------
; Segment type: Pure data
; Segment permissions: Read/Write
_data segment para public 'DATA' use32 assume cs:_data ;org 40A000h
; [COLLAPSED AREA .data1. PRESS KEYPAD \
TO EXPAND]
customer_t customers[] = {
{ 1,
\ 'm' }, { 2,
\ 'm' }, { 3,
\ 'f' }, { 0 } };
customers dd 1 ; id ; DATA XREF: main+11o db
'Peter',0,0,0,0,0,0,0,0,0,0,0,0,0,0, ... ; name
dd 'm' ; sex dd 2 ; id db
'John',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,... ; name
dd 'm' ; sex dd 3 ; id db
'Mary',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,... ; name
dd 'f' ; sex dd 0 ; id db
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, ... ; name
db 0 ; name dd 0 ; sex
aIdaQuickstartG db 'IDA QuickStart Guide',0 ; DATA XREF: ... db 6Bh dup(0)
book_t ida_book = { \QuickStart
Guide\
softwares_t softwares = { 3,
{ { { PC,
WINDOWS|DOS,
DISASSEMBLY }, \ { { PC|MAC, WINDOWS|OS_X,
RECOVERY }, \
softwares dd 3 ; count ; DATA XREF: main+62o
dd PC or WINDOWS or DOS or DISASSEMBLY; softs.info
db 'IDA
Pro',0,0,0,0,0,0,0,0,0,0,0,0,0, ...; softs.name
dd PC or MAC or WINDOWS or OS_X or
{ { PC, WINDOWS,
CRYPTOGRAPHY }, \ } };
RECOVERY; softs.info db
'PhotoRescue',0,0,0,0,0,0,0,0,0,0,0, ...; softs.name
dd PC or WINDOWS or CRYPTOGRAPHY; softs.info db
'aCrypt',0,0,0,0,0,0,0,0,0,0,0,0,0,0,...; softs.name
aWeDonTSellHardwareForThe db 'We don',27h,'t sell hardware ... ; DATA XREF: check_product+Eo ...
aCustomer04xSC db 'CUSTOMER X: %s (%c)',0Ah,0 ; ...
aBookS db 'BOOK: %s',0Ah,0 ; DATA XREF: print_book+6o
aSoftwareS db 'SOFTWARE: %s:',0 ; DATA XREF: ...
aPc db ' PC',0 ; DATA XREF: print_software+27r
aMac db ' MAC',0 ; DATA XREF: print_software+3Br
asc_40A31B db ';',0 ; DATA XREF: print_software+45r
aWindows db ' WINDOWS',0 ; DATA XREF: ... aDos db ' DOS',0 ; DATA XREF: print_software+72r
aOsX db ' OS-X',0 ; DATA XREF: print_software+89r
asc_40A331 db ';',0 ; DATA XREF: print_software+93r
aDisassembly db ' DISASSEMBLY',0 ; DATA XREF: ...
aRecovery db ' RECOVERY',0 ; DATA XREF: ...
aCryptography db ' CRYPTOGRAPHY',0 ; DATA XREF: ...
asc_40A358 db 0Ah,0 ; DATA XREF: print_software+D8r
aProduct04x db 'PRODUCT X: ',0 ; DATA XREF: ...
aCustomers db 'CUSTOMERS:',0Ah,0 ; DATA XREF: ...
aProducts db 0Ah ; DATA XREF: main+C0o db 'PRODUCTS:',0Ah,0
aInvalidProduct db 'Invalid product !!!',0Ah,0 ; ... aInvalidSoftwar db 'Invalid software !!!',0Ah,0 ; ...
TOP 附录
#include
// our structures // ==============
// information about our customers struct customer_t { // a typical structure long id; char name[32];
char sex; // 'm'ale - 'f'emale };
// we sell books struct book_t {
char title[128]; // an ASCII string };
百度搜索“77cn”或“免费范文网”即可找到本站免费阅读全部范文。收藏本站方便下次阅读,免费范文网,提供经典小说教育文库IDA简易教程(9)在线全文阅读。
相关推荐: