⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 p2kman.asm

📁 这是一个多媒体播放软件. 这是一个多媒体播放软件. 这是一个多媒体播放软件.
💻 ASM
📖 第 1 页 / 共 5 页
字号:
                  call    logstat

                  push    offset fn_mytonedb
                  call    FSAC_delete

                  push    offset str_tonebase_deleted
                  call    logstat
                  push    1F4h
                  call    Sleep

                  call   P2K_Restart

                  pop     edi
                  pop     esi
                  pop     ecx
                  retn
RingTonesUpdate   endp

;--------------------------------------
; Write file to Phone

Upload          proc    near

arg_0           = dword ptr  8

                push    ebp
                mov     ebp,esp
                pusha

                push    offset str_upload
                call    logstat

                push    offset str_buf
                call    FSAC_GetVolName
                cmp     eax, 0
                jz      @@volinfo_ok
                push    offset str_volinfofail
                call    logstat
                jmp     @@exit

@@volinfo_ok:
                push    offset str_buf
                call    FSAC_volume_space
                cmp     eax, 0
                jz      @@volinfo_2_ok
                push    offset str_volinfofail
                call    logstat
                jmp     @@exit
@@volinfo_2_ok:
                mov     edi, offset fname_buf
                mov     eax, 0
                mov     ecx, 80h
                rep     stosd

                mov     fname_buf, 0
                mov     fname_t_buf, 0
                mov     OFN_Flags, 80200h
                push    offset OpenFileNameSize
                call    GetOpenFileNameA
                cmp     eax, 0
                jz      @@exit

                mov     esi, offset fname_buf

                push    offset fname_buf
                call    lstrlenA
                inc     eax
                cmp     byte ptr [eax+esi], 0
                jz      @@single_file
@@next_ul:
                add     esi, eax
@@single_file:
                push    -1
                push    0
                push    3 ; open existing
                push    0
                push    0
                push    0C0000000h ; generic RW
                push    esi
                call    CreateFileA
                mov     FHandle, eax
                cmp     eax,-1
                jnz     @@_open_ok
                push    offset str_openfail
                call    logstat
                jmp     @@exit
@@_open_ok:
                push    eax

                push    80h
                push    offset str_buf
                push    1017
                push    [ebp+arg_0]
                call    GetDlgItemTextA

                cmp     byte ptr [fname_t_buf], 0
                mov     eax, offset fname_t_buf
                jnz     @@single_file_t
                mov     eax, esi
@@single_file_t:
                push    eax
                push    offset str_buf
                call    lstrcatA

                push    offset str_buf ; fname_t_buf
                call    logstat

                pop     eax

                push    offset filesize_ex
                push    eax
                call    GetFileSize

                cmp     filesize_ex, 0
                jnz     @@fail_size
                cmp     eax, 0
                jz      @@fail_size
                cmp     eax, VolSpace
                jb      @@_size_ok
@@fail_size:
                push    offset str_sizefail
                call    logstat
                jmp     @@try_next_ul

@@_size_ok:
                sub     VolSpace, eax
                mov     FileSize, eax
                push    eax
                push    40h
                call    GlobalAlloc
                cmp     eax, 0
                jz      @@exit_fclose
                mov     FileBuf_Ptr, eax

                push    0 ; overlapped
                push    offset file_readed ; bytes readen
                push    FileSize  ; bytes to read
                push    FileBuf_Ptr
                push    FHandle
                call    ReadFile
                cmp     eax, 0
                jz      @@exit_fclose
                mov     eax, FileSize
                cmp     file_readed, eax
                jnz     @@exit_fclose
                push    FHandle
                call    CloseHandle

; Begin write
                push    offset str_buf ; fname_t_buf
                call    lstrlenA
                mov     ecx, FileList_RecSize
                cmp     ecx, 0
                jz      @@warn_no_fl
                sub     ecx, 8
                cmp     eax, ecx
                ja      @@exit_fclose
@@warn_no_fl:
                push    0 ; attrib
                push    offset str_buf ; fname_t_buf             ; fname_ptr
                call    FSAC_open
                test    eax, eax
                jnz     short @@exit

                push    FileSize
                push    FileBuf_Ptr
                call    FSAC_write
                test    eax, eax
                jnz     short @@close ; fail
@@close:
                call    FSAC_close
;                test    eax, eax
;                jnz      @@exit   ; fail
                push    offset str_ok
                call    logstat
@@try_next_ul:
                push    esi
                call    lstrlenA
                inc     eax
                cmp     byte ptr [esi+eax], 0
                jnz     @@next_ul
@@upl_done:
                cmp     AutoUpd, 1
                jnz     @@skip_upd
                push    [ebp+arg_0]
                call    ListP2K
@@skip_upd:

@@exit_fclose:
                push    FHandle
                call    CloseHandle

@@exit:
                popa
                leave
                retn 4
Upload          endp

ChangeAttrib    proc near
arg_0           = dword ptr  8

                push    ebp
                mov     ebp, esp
                pusha

                mov     next_sel_item, -1
@@next:                              ; Find selected item
                                        ; Find selected item
                push    2               ; flags - search for selected item
                push    next_sel_item   ; start from beginning
                push    100Ch           ; LVM_GETNEXTITEM
                push    3F0h
                push    [ebp+arg_0]
                call    SendDlgItemMessageA
                cmp     eax, -1
                je      @@no_more_sel
                mov     next_sel_item, eax

                push    offset str_attr
                call    logstat

                mov     lv_Item, 0
                mov     lv_SubItem, 0
                mov     lv_Text, offset lv_get_text
                mov     lv_TextMax, 105h

                push    offset lv_Mask
                push    eax
                push    102Dh           ; LVM_GETITEMTEXT
                push    3F0h
                push    [ebp+arg_0]
                call    SendDlgItemMessageA

                push    offset lv_get_text
                call    logstat

                push    0
                push    0
                push    1015
                push    [ebp+arg_0]
                call    GetDlgItemInt
                cmp     eax, 10000h
                jna     @@ok
                mov     eax, 0
@@ok:
                push    eax
                push    offset lv_get_text
                call    FSAC_Open
                test    eax, eax
                jnz     @@openfail

                push    offset str_ok
                call    logstat

                call    FSAC_Close
@@openfail:
                jmp     @@next
@@no_more_sel:
                cmp     next_sel_item, -1
                jnz     @@exit
                push    offset str_no_files_sel
                call    logstat
@@exit:
                cmp     AutoUpd, 1
                jnz     @@skip_upd
                push    [ebp+arg_0]
                call    ListP2K
@@skip_upd:

                popa
                leave
                retn    4
ChangeAttrib    endp

Download        proc

arg_0           = dword ptr  8

                push    ebp
                mov     ebp, esp
                pusha

                mov     files_dl_first, 0
                mov     next_sel_item, -1
@@dl_next:                              ; Find selected item

                push    2               ; flags - search for selected item
                push    next_sel_item   ; start from beginning
                push    100Ch           ; LVM_GETNEXTITEM
                push    3F0h
                push    [ebp+arg_0]
                call    SendDlgItemMessageA
                cmp     eax, -1
                je      @@no_more_sel
                mov     next_sel_item, eax

                push    offset str_download
                call    logstat

                mov     lv_Item, 0
                mov     lv_SubItem, 0
                mov     lv_Text, offset lv_get_text
                mov     lv_TextMax, 105h

                push    offset lv_Mask
                push    eax
                push    102Dh           ; LVM_GETITEMTEXT
                push    3F0h
                push    [ebp+arg_0]
                call    SendDlgItemMessageA

                push    offset lv_get_text
                call    logstat

                push    offset lv_get_text
                call    Get_List_FileSize

                cmp     eax, -1
                jz      @@sizefail
                cmp     eax, 0
                jnz     @@size_ok
@@sizefail:
                push    offset str_sizefail
                call    logstat
                push    Download_BufPtr
                call    GlobalFree
                jmp     @@exit

@@size_ok:
                mov     Download_FSize, eax

                push    eax
                push    40h
                call    GlobalAlloc
                cmp     eax, 0
                jnz     @@mem_ok
                push    offset str_memfail
                call    logstat
                jmp     @@exit

@@mem_ok:
                mov     Download_BufPtr, eax

                push    offset lv_get_text
                call    Get_List_FileAttr
                mov     stay_quiet, 1
                push    eax
                push    offset lv_get_text
                call    FSAC_Open
                test    eax, eax
                jz      @@open_ok
                mov     stay_quiet, 0
                push    offset lv_get_text
                call    Get_List_FileAttr
                push    eax
                push    offset lv_get_text
                call    FSAC_Open
                test    eax, eax
                jz      @@open_ok
                push    offset str_openfail
                call    logstat
                push    Download_BufPtr
                call    GlobalFree
                mov     eax, -1
                jmp     @@exit

@@open_ok:
                mov     stay_quiet, 0
                push    0
                push    0
                call    FSAC_Seek
                test    eax, eax
                jz      @@seek_ok
                push    offset str_seekfail
                call    logstat
                call    FSAC_Close
                push    Download_BufPtr
                call    GlobalFree
                mov     eax, -1
                jmp     @@exit

@@seek_ok:
                push    Download_FSize
                push    Download_BufPtr
                call    FSAC_Read
                cmp     eax, 0
                jz      @@read_ok
                push    offset str_readfail
                call    logstat
                call    FSAC_Close
                push    Download_BufPtr
                call    GlobalFree
                mov     eax, -1
                jmp     @@exit
@@read_ok:

                call    FSAC_Close
;                cmp     eax, 0
;                jz      @@close

                push    10Dh
                push    offset fname_buf
                push    offset lv_get_text
                call    GetFileTitleA

                cmp     files_dl_first, 0
                jnz     @@skip_path
                mov     fname_t_buf, 0
                push    offset OpenFileNameSize
                mov     OFN_Flags, 0
                call    GetSaveFileNameA
                cmp     eax, 0
                jnz     @@path_ok
                push    offset str_canceled
                call    logstat
                push    Download_BufPtr
                call    GlobalFree
                jmp     @@exit

@@path_ok:
                mov     files_dl_first, 1
@@skip_path:
                push    -1
                push    0
                push    1 ; Create new
                push    0
                push    0
                push    0C0000000h ; generic RW
                push    offset fname_buf
                call    CreateFileA
                mov     FHandle, eax
                cmp     eax,0
                jnz     @@create_ok
                push    offset str_fcreatefail
                call    logstat
                push    Download_BufPtr
                call    GlobalFree

@@create_ok:
                push    0
                push    offset file_readed
                push    Download_FSize
                push    Download_BufPtr

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -