Function at 0x4afd81
Capabilities:
Inspect section memory permissions

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x3e0
xor eax, eax
cmp dword [ebp + 8], eax
push ebx
push esi
mov esi, ecx
mov ecx, dword [esi + 0x264]
push edi
mov dword [ebp - 8], eax
mov dword [ebp - 4], eax
mov dword [ebp - 0x24], eax
mov dword [ebp - 0xc], eax
mov dword [ebp - 0x40], eax
mov dword [ebp - 0x18], eax
mov dword [ebp - 0x34], eax
mov dword [ebp - 0x1c], eax
mov dword [ebp - 0x30], eax
mov dword [ebp - 0x14], eax
mov dword [ebp - 0x28], eax
mov dword [ebp - 0x2c], eax
mov dword [ebp - 0x20], eax
mov dword [ebp - 0x38], eax
mov dword [ebp - 0x48], ecx
je 0x4afdef
test dword [ebp + 8], 0x3fefff
jne 0x4afdef
cmp dword [ebp + 0xc], eax
jne 0x4afdde
cmp dword [ebp + 0x10], eax
jne 0x4afdef
test dword [ebp + 8], 0x40000000
je 0x4afdf9
cmp dword [esi + 0x260], eax
jne 0x4afdf9
mov ebx, 0x8876086c
jmp 0x4b0498
or dword [ebp + 8], 0x1000000
mov edi, 0xc000000
test dword [ebp + 8], edi
mov eax, 0x2000000
je 0x4afe12
or dword [ebp + 8], eax
mov ecx, dword [ebp + 8]
and ecx, eax
mov dword [ebp - 0x10], ecx
je 0x4afe69
test dword [ebp + 8], 0x40000000
jne 0x4afe69
test dword [ebp + 8], 0x20000000
mov eax, dword [esi + 0x23c]
mov dword [ebp - 0x30], eax
jne 0x4afe69
lea eax, [ebp - 0x1c]
push eax
lea eax, [ebp - 0x34]
push eax
mov ecx, esi
call fcn.0049ef20
mov ebx, eax
test ebx, ebx
jl 0x4b0498
cmp dword [ebp - 0x1c], 0
jbe 0x4afe69
test dword [ebp + 8], 0x10000000
je 0x4afe69
mov ebx, 0x88760b56
jmp 0x4b0498
mov eax, dword [esi + 0x264]
push 4
xor ecx, ecx
pop ebx
mov edx, ebx
mul edx
seto cl
neg ecx
or ecx, eax
push ecx
call sub.msvcrt.dll_void____cdecl_operator_new_unsigned_int_
mov dword [ebp - 8], eax
mov eax, dword [esi + 0x264]
xor ecx, ecx
mov edx, ebx
mul edx
seto cl
neg ecx
or ecx, eax
push ecx
call sub.msvcrt.dll_void____cdecl_operator_new_unsigned_int_
mov dword [ebp - 4], eax
mov eax, dword [esi + 0x23c]
xor ecx, ecx
mov edx, ebx
mul edx
seto cl
neg ecx
or ecx, eax
push ecx
call sub.msvcrt.dll_void____cdecl_operator_new_unsigned_int_
add esp, 0xc
cmp dword [ebp - 8], 0
mov dword [ebp - 0xc], eax
je 0x4b0493
cmp dword [ebp - 4], 0
je 0x4b0493
test eax, eax
je 0x4b0493
mov eax, dword [esi + 0x23c]
mov dword [ebp - 0x3c], eax
mov eax, dword [ebp + 8]
and eax, edi
mov dword [ebp - 0x4c], eax
je 0x4aff17
mov eax, dword [esi + 0x264]
xor ecx, ecx
mov edx, ebx
mul edx
seto cl
neg ecx
or ecx, eax
push ecx
call sub.msvcrt.dll_void____cdecl_operator_new_unsigned_int_
test eax, eax
pop ecx
mov dword [ebp - 0x24], eax
je 0x4b0493
test dword [ebp + 8], 0x1000000
je 0x4aff45
test dword [ebp + 8], 0x40000000
jne 0x4aff45
push dword [ebp - 0xc]
mov ecx, esi
push dword [ebp - 4]
push dword [ebp - 8]
call fcn.004981fd
mov ebx, eax
test ebx, ebx
jl 0x4b0498
jmp 0x4aff80
xor eax, eax
cmp dword [esi + 0x264], eax
jbe 0x4aff67
mov ecx, dword [ebp - 8]
mov edx, dword [ebp - 4]
sub edx, ecx
mov dword [edx + ecx], eax
mov dword [ecx], eax
inc eax
add ecx, ebx
cmp eax, dword [esi + 0x264]
jb 0x4aff57
xor eax, eax
cmp dword [esi + 0x23c], eax
jbe 0x4aff80
mov ecx, dword [ebp - 0xc]
mov dword [ecx + eax*4], eax
inc eax
cmp eax, dword [esi + 0x23c]
jb 0x4aff71
cmp dword [ebp - 0x10], 0
je 0x4affac
test dword [ebp + 8], 0x40000000
jne 0x4affac
push dword [ebp + 8]
mov ecx, esi
push dword [ebp - 0xc]
push dword [ebp - 4]
push dword [ebp - 8]
call fcn.00498322
mov ebx, eax
test ebx, ebx
jl 0x4b0498
mov eax, dword [ebp + 8]
and eax, 0x10000000
mov dword [ebp - 0x44], eax
je 0x4affd2
xor eax, eax
cmp dword [esi + 0x23c], eax
jbe 0x4affd2
mov ecx, dword [ebp - 0xc]
mov dword [ecx + eax*4], eax
inc eax
cmp eax, dword [esi + 0x23c]
jb 0x4affc3
push dword [ebp - 0xc]
mov ecx, esi
push dword [ebp - 8]
call fcn.0049f374
mov ebx, eax
test ebx, ebx
mov dword [ebp - 0x10], eax
jl 0x4b0498
cmp dword [ebp - 0x4c], 0
je 0x4b013a
mov eax, dword [esi + 0x264]
shl eax, 2
push eax
push dword [ebp - 4]
push dword [ebp - 0x24]
call sub.msvcrt.dll_memcpy
add esp, 0xc
push dword [ebp + 0xc]
mov ecx, esi
push dword [ebp - 4]
push dword [ebp - 8]
push dword [ebp + 8]
call fcn.004af463
mov ebx, eax
test ebx, ebx
jl 0x4b0498
mov eax, dword [esi + 0x23c]
xor ecx, ecx
push 4
pop edx
mul edx
seto cl
neg ecx
or ecx, eax
push ecx
call sub.msvcrt.dll_void____cdecl_operator_new_unsigned_int_
mov edi, eax
xor eax, eax
cmp edi, eax
pop ecx
mov dword [ebp - 0x40], edi
je 0x4b0493
cmp dword [ebp - 0x44], eax
jne 0x4b0098
push edi
push dword [ebp - 4]
mov ecx, esi
call fcn.00498811
mov ebx, eax
test ebx, ebx
jl 0x4b0498
xor ecx, ecx
cmp dword [esi + 0x23c], ecx
jbe 0x4b00ac
mov eax, dword [ebp - 0xc]
lea edx, [eax + ecx*4]
mov eax, dword [edx]
cmp eax, 0xffff
je 0x4b008d
mov eax, dword [edi + eax*4]
mov dword [edx], eax
inc ecx
cmp ecx, dword [esi + 0x23c]
jb 0x4b0079
jmp 0x4b00ac
cmp dword [esi + 0x23c], eax
jbe 0x4b00ac
mov dword [edi + eax*4], eax
inc eax
cmp eax, dword [esi + 0x23c]
jb 0x4b00a0
push edi
push dword [ebp - 8]
mov ecx, esi
call fcn.0049f374
mov ebx, eax
test ebx, ebx
mov dword [ebp - 0x10], ebx
jl 0x4b0498
xor edx, edx
xor ecx, ecx
cmp dword [esi + 0x264], edx
jbe 0x4b00f6
mov edi, dword [ebp - 4]
mov eax, dword [edi + ecx*4]
cmp eax, 0xffffffff
je 0x4b00e9
mov edi, dword [ebp - 0x24]
mov eax, dword [edi + eax*4]
mov edi, dword [ebp - 4]
mov dword [edi + ecx*4], eax
jmp 0x4b00ed
or dword [edi + ecx*4], 0xffffffff
inc ecx
cmp ecx, dword [esi + 0x264]
jb 0x4b00d0
xor eax, eax
cmp dword [esi + 0x264], edx
jbe 0x4b0113
mov ecx, dword [ebp - 8]
mov dword [ecx + eax*4], 0xffff
inc eax
cmp eax, dword [esi + 0x264]
jb 0x4b0100
xor eax, eax
cmp dword [esi + 0x264], edx
jbe 0x4b013a
mov ecx, dword [ebp - 4]
mov ecx, dword [ecx + eax*4]
cmp ecx, 0xffff
je 0x4b0131
mov edx, dword [ebp - 8]
mov dword [edx + ecx*4], eax
inc eax
cmp eax, dword [esi + 0x264]
jb 0x4b011d
xor edi, edi
cmp dword [ebp + 0x18], edi
jne 0x4b0152
cmp dword [ebp - 0x1c], edi
ja 0x4b0152
cmp dword [esi + 0x240], edi
jne 0x4b01e8
lea eax, [ebp - 0x14]
push eax
mov eax, dword [esi + 0x23c]
shl eax, 2
push eax
call sym.d3dx9_34.dll_D3DXCreateBuffer
mov ebx, eax
cmp ebx, edi
mov dword [ebp - 0x10], ebx
jl 0x4b0498
mov eax, dword [ebp - 0x14]
mov ecx, dword [eax]
push eax
call dword [ecx + 0xc]
mov edx, eax
xor eax, eax
cmp dword [esi + 0x23c], edi
mov dword [ebp - 0x28], edx
jbe 0x4b0197
or dword [edx + eax*4], 0xffffffff
inc eax
cmp eax, dword [esi + 0x23c]
jb 0x4b018a
xor eax, eax
cmp dword [ebp - 0x3c], edi
jbe 0x4b01b5
mov ecx, dword [ebp - 0xc]
mov ecx, dword [ecx + eax*4]
cmp ecx, 0xffff
je 0x4b01af
mov dword [edx + ecx*4], eax
inc eax
cmp eax, dword [ebp - 0x3c]
jb 0x4b019e
cmp dword [ebp - 0x1c], edi
jbe 0x4b01eb
xor ecx, ecx
cmp dword [esi + 0x23c], edi
jbe 0x4b01e8
mov eax, dword [edx + ecx*4]
cmp eax, 0xffffffff
je 0x4b01df
cmp eax, dword [ebp - 0x30]
jb 0x4b01dd
sub eax, dword [ebp - 0x30]
mov edi, dword [ebp - 0x34]
mov eax, dword [edi + eax*4]
mov dword [edx + ecx*4], eax
xor edi, edi
inc ecx
cmp ecx, dword [esi + 0x23c]
jb 0x4b01c4
cmp dword [ebp - 0x1c], edi
jne 0x4b022a
cmp dword [esi + 0x240], edi
jbe 0x4b022a
push edi
lea eax, [ebp - 0x18]
push eax
mov ecx, esi
call fcn.00497144
mov ebx, eax
cmp ebx, edi
jl 0x4b0498
push dword [ebp - 0x18]
mov ecx, esi
push dword [ebp - 0xc]
call fcn.0049f200
mov ebx, eax
cmp ebx, edi
mov dword [ebp - 0x10], ebx
jl 0x4b0498
jmp 0x4b03e3
test byte [esi + 0x218], 0x20
jne 0x4b03e3
mov eax, dword [esi + 0x234]
mov ebx, dword [esi + 0x23c]
mov dword [ebp - 0x20], eax
mov eax, dword [esi + 0x244]
lea edi, [esi + 0x240]
cmp dword [edi], 0
mov dword [ebp - 0x38], eax
jne 0x4b0266
mov eax, dword [ebp + 0x1c]
mov ecx, dword [eax]
push eax
mov dword [ebp - 0x20], eax
call dword [ecx + 4]
xor eax, eax
push ebx
push dword [esi + 0x264]
mov ecx, esi
mov dword [esi + 0x234], eax
mov dword [esi + 0x23c], eax
mov dword [edi], eax
mov dword [esi + 0x244], eax
call fcn.0049b1dc
mov ebx, eax
test ebx, ebx
jl 0x4b0498
push 0
lea eax, [ebp - 0x18]
push eax
mov ecx, esi
call fcn.00497144
mov ebx, eax
test ebx, ebx
jl 0x4b0498
mov eax, dword [ebp - 0x20]
mov ecx, dword [eax]
push 0x810
lea edx, [ebp - 0x2c]
push edx
push 0
push 0
push eax
call dword [ecx + 0x2c]
mov ebx, eax
test ebx, ebx
mov dword [ebp - 0x10], ebx
jl 0x4b0498
cmp dword [ebp + 0x20], 0
je 0x4b0333
lea edi, [esi + 0xc]
push edi
push dword [ebp + 0x20]
call fcn.00496105
test eax, eax
jne 0x4b0333
push edi
push dword [ebp + 0x20]
lea ecx, [ebp - 0x3e0]
call fcn.0049b829
push dword [ebp - 0x18]
lea ecx, [ebp - 0x3e0]
push dword [ebp - 0x2c]
call fcn.00496018
xor edi, edi
cmp dword [esi + 0x23c], edi
jbe 0x4b037a
mov eax, dword [ebp - 0x28]
mov eax, dword [eax + edi*4]
cmp eax, 0xffffffff
je 0x4b0328
push 1
push edi
push eax
lea ecx, [ebp - 0x3e0]
call fcn.00496048
inc edi
cmp edi, dword [esi + 0x23c]
jb 0x4b030e
jmp 0x4b037a
and dword [ebp + 0x20], 0
cmp dword [esi + 0x23c], 0
mov ebx, dword [ebp - 0x18]
jbe 0x4b037a
mov eax, dword [ebp - 0x28]
mov ecx, dword [ebp + 0x20]
mov ecx, dword [eax + ecx*4]
cmp ecx, 0xffffffff
je 0x4b036c
lea edi, [esi + 0x238]
mov eax, dword [edi]
push eax
imul eax, ecx
add eax, dword [ebp - 0x2c]
push eax
push ebx
call sub.msvcrt.dll_memcpy
add esp, 0xc
add ebx, dword [edi]
inc dword [ebp + 0x20]
mov eax, dword [ebp + 0x20]
cmp eax, dword [esi + 0x23c]
jb 0x4b0343
mov ecx, dword [ebp - 0x38]
xor eax, eax
cmp ecx, eax
je 0x4b03af
cmp dword [esi + 0x23c], eax
jbe 0x4b03af
mov edx, dword [ebp - 0x28]
mov edx, dword [edx + eax*4]
movzx edx, word [ecx + edx*2]
mov ebx, dword [ebp - 0xc]
mov edi, dword [esi + 0x244]
mov dx, word [ebx + edx*4]
mov word [edi + eax*2], dx
inc eax
cmp eax, dword [esi + 0x23c]
jb 0x4b038b
xor ecx, ecx
xor edx, edx
cmp dword [esi + 0x23c], ecx
jbe 0x4b03d8
mov eax, dword [ebp - 0xc]
lea eax, [eax + ecx*4]
cmp dword [eax], 0xffff
je 0x4b03cc
inc edx
jmp 0x4b03cf
or dword [eax], 0xffffffff
inc ecx
cmp ecx, dword [esi + 0x23c]
jb 0x4b03bb
mov ebx, dword [ebp - 0x10]
mov dword [esi + 0x23c], edx
xor edi, edi
cmp dword [ebp + 0x14], edi
je 0x4b040e
mov eax, dword [esi + 0x264]
shl eax, 2
test dword [ebp + 8], 0x80000000
push eax
je 0x4b0400
push dword [ebp - 8]
jmp 0x4b0403
push dword [ebp - 4]
push dword [ebp + 0x14]
call sub.msvcrt.dll_memcpy
add esp, 0xc
cmp dword [ebp + 0x10], edi
je 0x4b0481
mov eax, dword [ebp + 0x10]
cmp eax, dword [ebp + 0xc]
jne 0x4b042f
push dword [ebp - 0x48]
push eax
push dword [ebp - 8]
call fcn.0049412c
mov ebx, eax
test ebx, ebx
jl 0x4b0498
jmp 0x4b0481
xor edx, edx
cmp dword [esi + 0x264], edx
jbe 0x4b0481
mov dword [ebp + 8], eax
mov eax, dword [ebp - 4]
mov eax, dword [eax + edx*4]
mov ecx, dword [ebp + 8]
imul eax, eax, 0xc
add eax, dword [ebp + 0xc]
mov dword [ebp + 0x10], 3
sub eax, ecx
mov edi, dword [eax + ecx]
cmp edi, 0xffffffff
je 0x4b0469
mov ebx, dword [ebp - 8]
mov edi, dword [ebx + edi*4]
mov ebx, dword [ebp - 0x10]
mov dword [ecx], edi
jmp 0x4b046c
or dword [ecx], 0xffffffff
add ecx, 4
dec dword [ebp + 0x10]
jne 0x4b0454
add dword [ebp + 8], 0xc
inc edx
cmp edx, dword [esi + 0x264]
jb 0x4b043c
mov eax, dword [ebp + 0x18]
test eax, eax
je 0x4b0498
mov ecx, dword [ebp - 0x14]
and dword [ebp - 0x14], 0
mov dword [eax], ecx
jmp 0x4b0498
mov ebx, 0x8007000e
push dword [ebp - 0xc]
call sub.msvcrt.dll_void___cdecl_operator_delete_void__
push dword [ebp - 8]
call sub.msvcrt.dll_void___cdecl_operator_delete_void__
push dword [ebp - 4]
call sub.msvcrt.dll_void___cdecl_operator_delete_void__
push dword [ebp - 0x24]
call sub.msvcrt.dll_void___cdecl_operator_delete_void__
push dword [ebp - 0x34]
call sub.msvcrt.dll_void___cdecl_operator_delete_void__
push dword [ebp - 0x40]
call sub.msvcrt.dll_void___cdecl_operator_delete_void__
mov eax, dword [ebp - 0x38]
add esp, 0x18
cmp dword [esi + 0x244], eax
je 0x4b04dd
push eax
call sub.msvcrt.dll_void___cdecl_operator_delete_void__
pop ecx
xor edi, edi
cmp dword [ebp - 0x18], edi
je 0x4b04f0
mov esi, dword [esi + 0x234]
mov eax, dword [esi]
push esi
call dword [eax + 0x30]
cmp dword [ebp - 0x2c], edi
mov esi, dword [ebp - 0x20]
je 0x4b04fe
mov eax, dword [esi]
push esi
call dword [eax + 0x30]
mov eax, dword [ebp - 0x14]
cmp eax, edi
je 0x4b050e
mov ecx, dword [eax]
push eax
call dword [ecx + 8]
mov dword [ebp - 0x14], edi
cmp esi, edi
je 0x4b0518
mov eax, dword [esi]
push esi
call dword [eax + 8]
pop edi
pop esi
mov eax, ebx
pop ebx
leave
ret 0x1c