Function at 0x10006e80
Capabilities:
Copy file

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x3c
mov eax, dword [0x1009400c]
xor eax, esp
mov dword [esp + 0x38], eax
push ebx
mov ebx, dword [sym.imp.d3d9.dll_D3DPERF_BeginEvent]
push esi
push edi
push str.Normal_Map
push 0xff000064
mov edi, edx
mov esi, ecx
call ebx
cmp dword [esi + 0x14], 0x10
mov eax, esi
mov dword [esp + 0x10], 0
mov dword [esp + 0x14], 0
jb 0x10006ec7
mov eax, dword [esi]
lea ecx, [esp + 0x10]
push ecx
push 0
push 0
push 0
push 5
push 3
push 1
push 0xfffffffffffffffd
push 0
push 0xffffffffffffffff
push 0xffffffffffffffff
push 0xffffffffffffffff
push eax
push dword [0x101f3f18]
call dword [sym.imp.d3dx9_43.dll_D3DXCreateTextureFromFileExA]
mov eax, dword [esp + 0x10]
lea edx, [esp + 0x24]
push edx
push 0
push eax
mov ecx, dword [eax]
call dword [ecx + 0x44]
cmp dword [esp + 0x24], 0x35545844
jne 0x10007036
push str.Backgenerating_XYZ_Normal_Map
push 0xff000064
call ebx
lea eax, [esp + 0x14]
push eax
push 0
push 0x14
push 1
push 0xffffffffffffffff
push dword [esp + 0x54]
push dword [esp + 0x54]
push dword [0x101f3f18]
call dword [sym.imp.d3dx9_43.dll_D3DXCreateTexture]
cmp dword [edi + 0x14], 0x10
jb 0x10006f43
mov edi, dword [edi]
cmp dword [esi + 0x14], 0x10
jb 0x10006f4b
mov esi, dword [esi]
push 0
push edi
push esi
call dword [sym.imp.KERNEL32.dll_CopyFileA]
mov eax, dword [esp + 0x14]
push eax
mov ecx, dword [eax]
call dword [ecx + 4]
mov eax, dword [0x101db478]
push str.NormalMapInv
push eax
mov ecx, dword [eax]
call dword [ecx + 0xe8]
mov eax, dword [esp + 0x14]
lea edx, [esp + 0x18]
push edx
mov dword [esp + 0x1c], 0
push 0
mov ecx, dword [eax]
push eax
call dword [ecx + 0x48]
mov eax, dword [0x101db478]
push dword [esp + 0x10]
push str.tex_in
mov ecx, dword [eax]
push eax
call dword [ecx + 0xd0]
mov eax, dword [0x101f3f18]
push dword [esp + 0x18]
push 0
mov ecx, dword [eax]
push eax
call dword [ecx + 0x94]
mov eax, dword [0x101db478]
mov ecx, dword [eax]
push ecx
mov dword [esp], 0
push str.g_iMipLevel
push eax
call dword [ecx + 0x78]
mov eax, dword [0x101db478]
push 0
push 0x101f4264
push eax
mov ecx, dword [eax]
call dword [ecx + 0xfc]
mov eax, dword [0x101db478]
push 0
push eax
mov ecx, dword [eax]
call dword [ecx + 0x100]
mov eax, dword [0x101f3f18]
push 2
push 0
push 5
mov ecx, dword [eax]
push eax
call dword [ecx + 0x144]
mov eax, dword [0x101db478]
push eax
mov ecx, dword [eax]
call dword [ecx + 0x108]
mov eax, dword [0x101db478]
push eax
mov ecx, dword [eax]
call dword [ecx + 0x10c]
mov eax, dword [esp + 0x14]
push eax
mov ecx, dword [eax]
call dword [ecx + 0x40]
mov eax, dword [esp + 0x18]
jmp 0x100071dd
push str.Generating_DXT5_Normal_Map
push 0xff000064
call ebx
mov esi, dword [sym.imp.d3dx9_43.dll_D3DXCreateTexture]
lea eax, [esp + 0x20]
push eax
push 0
push 0x15
push 1
push 0xffffffffffffffff
push dword [esp + 0x54]
mov dword [esp + 0x38], 0
push dword [esp + 0x54]
push dword [0x101f3f18]
call esi
lea eax, [esp + 0x14]
push eax
push 1
push 0x35545844
push 0
push 0xffffffffffffffff
push dword [esp + 0x54]
push dword [esp + 0x54]
push dword [0x101f3f18]
call esi
mov eax, dword [esp + 0x10]
push eax
mov ecx, dword [eax]
call dword [ecx + 4]
mov eax, dword [0x101db478]
push str.NormalMap
push eax
mov ecx, dword [eax]
call dword [ecx + 0xe8]
mov eax, dword [esp + 0x10]
xor esi, esi
push eax
mov ecx, dword [eax]
call dword [ecx + 0x34]
test eax, eax
je 0x100071ce
mov ebx, dword [sym.imp.d3dx9_43.dll_D3DXLoadSurfaceFromSurface]
mov eax, dword [esp + 0x14]
lea edx, [esp + 0x1c]
push edx
mov dword [esp + 0x20], 0
mov dword [esp + 0x1c], 0
mov ecx, dword [eax]
push esi
push eax
call dword [ecx + 0x48]
mov eax, dword [esp + 0x20]
lea edx, [esp + 0x18]
push edx
push esi
push eax
mov ecx, dword [eax]
call dword [ecx + 0x48]
mov eax, dword [0x101db478]
push dword [esp + 0x10]
push str.tex_in
mov ecx, dword [eax]
push eax
call dword [ecx + 0xd0]
mov eax, dword [0x101f3f18]
push dword [esp + 0x18]
push 0
mov ecx, dword [eax]
push eax
call dword [ecx + 0x94]
mov eax, dword [0x101db478]
movd xmm0, esi
cvtdq2ps xmm0, xmm0
mov ecx, dword [eax]
push ecx
movss dword [esp], xmm0
push str.g_iMipLevel
push eax
call dword [ecx + 0x78]
mov eax, dword [0x101db478]
push 0
push 0x101f4264
push eax
mov ecx, dword [eax]
call dword [ecx + 0xfc]
mov eax, dword [0x101db478]
push 0
push eax
mov ecx, dword [eax]
call dword [ecx + 0x100]
mov eax, dword [0x101f3f18]
push 2
push 0
push 5
mov ecx, dword [eax]
push eax
call dword [ecx + 0x144]
mov eax, dword [0x101db478]
push eax
mov ecx, dword [eax]
call dword [ecx + 0x108]
mov eax, dword [0x101db478]
push eax
mov ecx, dword [eax]
call dword [ecx + 0x10c]
push 0
push 1
push 0
push 0
push dword [esp + 0x28]
push 0
push 0
push dword [esp + 0x38]
call ebx
mov eax, dword [esp + 0x1c]
push eax
mov ecx, dword [eax]
call dword [ecx + 8]
mov eax, dword [esp + 0x18]
push eax
mov ecx, dword [eax]
call dword [ecx + 8]
inc esi
mov eax, dword [esp + 0x10]
push eax
mov edx, dword [eax]
call dword [edx + 0x34]
cmp esi, eax
jb 0x100070c4
mov edx, dword [esp + 0x14]
mov ecx, edi
call fcn.10006bc0
mov eax, dword [esp + 0x20]
mov ecx, dword [eax]
push eax
call dword [ecx + 8]
mov esi, dword [sym.imp.d3d9.dll_D3DPERF_EndEvent]
call esi
mov eax, dword [esp + 0x10]
push eax
mov ecx, dword [eax]
call dword [ecx + 8]
mov eax, dword [esp + 0x14]
push eax
mov ecx, dword [eax]
call dword [ecx + 8]
call esi
mov ecx, dword [esp + 0x44]
pop edi
pop esi
pop ebx
xor ecx, esp
call fcn.1004d763
mov esp, ebp
pop ebp
ret