ipod_st.asm
来自「为ipod shuffle写的程序」· 汇编 代码 · 共 451 行 · 第 1/2 页
ASM
451 行
db 0,0,0,0,0,0,0,0,109,104,111,100,24,0,0,0
db 72,0,0,0,52,0,0,0,0,0,0,0,0,0,0,0
db 4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 109,104,111,100,24,0,0,0,72,0,0,0,52,0,0,0
db 0,0,0,0,0,0,0,0,7,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,109,104,111,100,24,0,0,0
db 72,0,0,0,52,0,0,0,0,0,0,0,0,0,0,0
db 18,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
; readme.txt is 679 bytes long
mesberr_2 db 177,190,179,204,208,242,200,195,196,227,196,220,185,187,183,199
db 179,163,188,242,181,165,181,196,202,185,211,195,105,112,111,100
db 32,115,104,117,102,102,108,101,32,109,112,51,178,165,183,197
db 198,247,13,10,176,209,184,232,199,250,180,171,181,189,109,112
db 51,214,208,178,162,178,165,183,197,44,214,187,208,232,200,253
db 184,246,178,189,214,232,58,13,10,49,46,207,241,184,241,202
db 189,187,175,117,197,204,210,187,209,249,44,184,241,202,189,187
db 175,105,112,111,100,32,115,104,117,102,102,108,101,197,204,13
db 10,50,46,184,180,214,198,196,227,207,178,187,182,181,196,109
db 112,51,206,196,188,254,181,189,105,112,111,100,32,115,104,117
db 102,102,108,101,197,204,181,196,184,249,196,191,194,188,13,10
db 51,46,176,209,177,190,179,204,208,242,105,112,111,100,95,115
db 116,46,101,120,101,184,180,214,198,181,189,105,112,111,100,32
db 115,104,117,102,102,108,101,197,204,181,196,184,249,196,191,194
db 188,44,13,10,203,171,187,247,212,203,208,208,203,252,44,176
db 206,207,194,186,243,190,205,191,201,210,212,204,253,184,232,193
db 203,46,13,10,105,112,111,100,95,115,116,202,199,105,112,111
db 100,32,115,104,117,102,102,108,101,32,116,111,111,108,181,196
db 203,245,208,180,13,10,177,190,179,204,208,242,211,195,51,50
db 206,187,187,227,177,224,211,239,209,212,177,224,214,198,44,212
db 218,119,105,110,120,112,207,194,181,247,202,212,179,201,185,166
db 13,10,42,42,42,42,42,42,42,42,42,42,42,42,42,42
db 42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42
db 42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42
db 42,42,42,42,13,10,13,10,210,212,207,194,202,199,185,227,184,230
db 163,172,215,170,212,216,202,177,199,235,177,163,193,244,58,45
db 41,13,10,201,189,182,171,186,163,187,175,188,175,205,197,206
db 171,183,187,186,163,212,180,185,164,179,204,189,168,201,232,188
db 224,192,237,211,208,207,222,185,171,203,190,163,172,195,230,207
db 242,200,171,185,250,13,10,179,208,181,163,187,175,185,164,161
db 162,202,175,211,205,161,162,189,168,214,254,161,162,202,208,213
db 254,185,164,179,204,181,196,188,224,192,237,210,181,206,241,161
db 163,206,210,195,199,181,196,185,164,13,10,215,247,196,191,177
db 234,202,199,163,186,200,195,210,181,214,247,194,250,210,226,163
db 172,200,195,211,195,187,167,183,197,208,196,161,163,185,171,203
db 190,182,212,176,239,214,250,179,208,192,191,210,181,13,10,206
db 241,186,205,204,225,185,169,208,197,207,162,181,196,200,203,212
db 177,202,181,208,208,204,225,179,201,186,205,189,177,192,248,163
db 172,200,231,185,251,196,227,183,162,207,214,211,208,208,232,210
db 170,13,10,191,170,185,164,189,168,201,232,181,196,207,238,196
db 191,163,172,199,235,188,176,202,177,186,205,177,190,206,196,215
db 247,213,223,202,162,211,241,212,246,193,170,207,181,161,163,13
db 10,176,236,185,171,181,231,187,176,163,186,48,53,51,54,45
db 53,51,50,57,48,51,50,13,10,185,171,203,190,205,248,214
db 183,58,104,116,116,112,58,47,47,119,119,119,46,119,102,104
db 121,106,108,46,99,110,32,32,13,10,101,45,109,97,105,108
db 58,115,121,122,64,119,102,104,121,106,108,46,99,110,32,113
db 113,58,53,54,49,49,52,48,57,13,10,13,10
db 0
.data?
hInstance HINSTANCE ?
CommandLine LPSTR ?
fhand1 dd ?
fhand2 dd ?
fhand3 dd ?
.code
start:
invoke GetModuleHandle, NULL
mov hInstance,eax
invoke CreateDirectory,ADDR path1,NULL
invoke CreateDirectory,ADDR path2,NULL
;BOOL CopyFile(
;LPCTSTR lpExistingFileName, // address of name of an existing file
;LPCTSTR lpNewFileName, // address of filename to copy to
;BOOL bFailIfExists ) // flag for operation if file exists
;invoke CopyFile ,ADDR FileName_SD,ADDR bakFileName1,FALSE
;invoke CopyFile ,ADDR FileName_DB,ADDR bakFileName2,FALSE
invoke CreateFile,ADDR FileName_DB, ; pointer to name of the file
GENERIC_WRITE, ; access (read-write) mode
FILE_SHARE_WRITE, ;NULL, ; share mode
NULL, ; pointer to security attributes
CREATE_ALWAYS, ; how to create
FILE_ATTRIBUTE_NORMAL, ; file attributes
NULL
.if eax==INVALID_HANDLE_VALUE
jmp nx_3
.else
mov fhand1,eax
invoke WriteFile,fhand1,ADDR file_db,3008,ADDR br1,NULL
invoke CloseHandle,ADDR fhand1
.endif
tx_1:
invoke CreateFile,ADDR FileName_SD, ; pointer to name of the file
GENERIC_WRITE, ; access (read-write) mode
FILE_SHARE_WRITE, ;NULL, ; share mode
NULL, ; pointer to security attributes
CREATE_ALWAYS, ; how to create
FILE_ATTRIBUTE_NORMAL, ; file attributes
NULL
.if eax==INVALID_HANDLE_VALUE
jmp nx_3
.else
mov fhand2,eax
invoke WriteFile,fhand2,ADDR file_head,18,ADDR br1,NULL
invoke CloseHandle,ADDR fhand2
.endif
jmp nx_4
; BOOL WriteFile(
; HANDLE hFile, // handle of file to write to
; LPCVOID lpBuffer, // address of data to write to file
; DWORD nNumberOfBytesToWrite, // number of bytes to write
; LPDWORD lpNumberOfBytesWritten, // address of number of bytes written
; LPOVERLAPPED lpOverlapped // addr. of structure needed for overlapped I/O
; );
;DWORD SetFilePointer (HANDLE hFile, LONG lDistanceToMove, PLONG lpDistanceToMoveHigh, DWORD dwMoveMethod );
nx_4: invoke find_file1
invoke MessageBox,NULL,ADDR mesberr_1,ADDR AppName,MB_OK
jmp end_1
nx_3:
invoke MessageBox,NULL,ADDR mesberr_2,ADDR AppName,MB_OK
end_1: invoke ExitProcess,eax
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;find mp3 file ;;;;;;;;;;;;;;;;;;;;;
find_file1 proc
LOCAL hSearch :DWORD ; search handle
LOCAL sizeBuffer[16]:BYTE
LOCAL fBuffer[256]:BYTE ; file name buffer
LOCAL clBuffer[128]:BYTE ; command line buffer
LOCAL wfd :WIN32_FIND_DATA
mov ecx, LENGTHOF wCard ; copy *.* into
mov esi, offset wCard ; clBuffer
lea edi, clBuffer
rep movsb
invoke FindFirstFile,ADDR clBuffer,ADDR wfd
.if eax == INVALID_HANDLE_VALUE
invoke MessageBox,NULL,ADDR notfound,ADDR AppName,MB_OK
jmp nx_3
.else
mov hSearch, eax
.endif
cl_1: mov ecx,520
mov edi,offset mp3_fn
mov al,0
rep stosb
lea esi, wfd.cFileName
mov edi,offset mp3_fn
cl_2: lodsb
cmp al,0
jz cl_3
mov ah,0
stosw
jmp cl_2
cl_3:invoke wf_e
@@:
invoke FindNextFile,hSearch,ADDR wfd
cmp eax, 0
je lpOut
dl_1: mov ecx,520
mov edi,offset mp3_fn
mov al,0
rep stosb
lea esi, wfd.cFileName
mov edi,offset mp3_fn
dl_2: lodsb
cmp al,0
jz dl_3
mov ah,0
stosw
jmp dl_2
dl_3:invoke wf_e
jmp @B
lpOut:
invoke FindClose,hSearch
invoke CreateFile,ADDR FileName_SD, GENERIC_WRITE,FILE_SHARE_WRITE,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL
.if eax==INVALID_HANDLE_VALUE
jmp nx_3
.else
mov fhand2,eax
invoke WriteFile,fhand2,ADDR file_head,18,ADDR br1,NULL
invoke CloseHandle,ADDR fhand2
.endif
;invoke wsprintf,ADDR sizeBuffer,ADDR fMtStrinG,s_count
TheEnd: ret
find_file1 endp
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
wf_e proc
pushad
invoke CreateFile,ADDR FileName_SD,GENERIC_WRITE,FILE_SHARE_WRITE,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL
.if eax==INVALID_HANDLE_VALUE
invoke MessageBox,NULL,ADDR mesberr_2,ADDR AppName,MB_OK
jmp err_a
.else
mov fhand3,eax
invoke SetFilePointer,fhand3,0,0,FILE_END
invoke WriteFile,fhand3,ADDR entry,558,ADDR br1,NULL
invoke CloseHandle,ADDR fhand3
.endif
mov esi,offset s_count
lodsb
mov ah,al
lodsb
inc ax
xchg ah,al
mov edi,offset s_count
stosw
err_a: popad
ret
wf_e endp
end start
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?