tlsfixer.asm

来自「pe exe packer (must use vc2005 to compil」· 汇编 代码 · 共 34 行

ASM
34
字号
; Author:   Brandon LaCombe
; Date:     February 3, 2006
; License:  Public Domain
.386
.model flat, stdcall
option casemap:none

include     windows.inc
include     LoaderStructs.inc

.code

ExportTLSFixer proc pdwTLSFixerSize:dword
    mov eax, pdwTLSFixerSize
    .if eax
        mov dword ptr[eax], tls_fixer_end - tls_fixer_start
    .endif
    mov eax, tls_fixer_start
    ret
ExportTLSFixer endp

; The Windows loader has overwritten the tls index, so we need to restore
; it to its original value. (or restore the windows loader value)
tls_fixer_start:

    mov eax, (LOADER_STRUCT ptr[ebx]).pTLSIndex
    mov edx, (LOADER_STRUCT ptr[ebx]).dwOrigTLSIndex
    xchg [eax], edx
    mov (LOADER_STRUCT ptr[ebx]).dwOrigTLSIndex, edx

tls_fixer_end:

end

⌨️ 快捷键说明

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