Function at 0x596ad1
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 0x596b3f
test dword [ebp + 8], 0x3fefff
jne 0x596b3f
cmp dword [ebp + 0xc], eax
jne 0x596b2e
cmp dword [ebp + 0x10], eax
jne 0x596b3f
test dword [ebp + 8], 0x40000000
je 0x596b49
cmp dword [esi + 0x260], eax
jne 0x596b49
mov ebx, 0x8876086c
jmp 0x5971d7
or dword [ebp + 8], 0x1000000
mov edi, 0xc000000
test dword [ebp + 8], edi
mov eax, 0x2000000
je 0x596b62
or dword [ebp + 8], eax
mov ecx, dword [ebp + 8]
and ecx, eax
mov dword [ebp - 0x10], ecx
je 0x596bb9
test dword [ebp + 8], 0x40000000
jne 0x596bb9
test dword [ebp + 8], 0x20000000
mov eax, dword [esi + 0x23c]
mov dword [ebp - 0x30], eax
jne 0x596bb9
lea eax, [ebp - 0x1c]
push eax
lea eax, [ebp - 0x34]
push eax
mov ecx, esi
call fcn.005889ed
mov ebx, eax
test ebx, ebx
jl 0x5971d7
cmp dword [ebp - 0x1c], 0
jbe 0x596bb9
test dword [ebp + 8], 0x10000000
je 0x596bb9
mov ebx, 0x88760b56
jmp 0x5971d7
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 0x5971d2
cmp dword [ebp - 4], 0
je 0x5971d2
test eax, eax
je 0x5971d2
mov eax, dword [esi + 0x23c]
mov dword [ebp - 0x3c], eax
mov eax, dword [ebp + 8]
and eax, edi
mov dword [ebp - 0x4c], eax
je 0x596c67
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 0x5971d2
test dword [ebp + 8], 0x1000000
je 0x596c95
test dword [ebp + 8], 0x40000000
jne 0x596c95
push dword [ebp - 0xc]
mov ecx, esi
push dword [ebp - 4]
push dword [ebp - 8]
call fcn.0057ee25
mov ebx, eax
test ebx, ebx
jl 0x5971d7
jmp 0x596cd0
xor eax, eax
cmp dword [esi + 0x264], eax
jbe 0x596cb7
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 0x596ca7
xor eax, eax
cmp dword [esi + 0x23c], eax
jbe 0x596cd0
mov ecx, dword [ebp - 0xc]
mov dword [ecx + eax*4], eax
inc eax
cmp eax, dword [esi + 0x23c]
jb 0x596cc1
cmp dword [ebp - 0x10], 0
je 0x596cfc
test dword [ebp + 8], 0x40000000
jne 0x596cfc
push dword [ebp + 8]
mov ecx, esi
push dword [ebp - 0xc]
push dword [ebp - 4]
push dword [ebp - 8]
call fcn.0057ef22
mov ebx, eax
test ebx, ebx
jl 0x5971d7
mov eax, dword [ebp + 8]
and eax, 0x10000000
mov dword [ebp - 0x44], eax
je 0x596d22
xor eax, eax
cmp dword [esi + 0x23c], eax
jbe 0x596d22
mov ecx, dword [ebp - 0xc]
mov dword [ecx + eax*4], eax
inc eax
cmp eax, dword [esi + 0x23c]
jb 0x596d13
push dword [ebp - 0xc]
mov ecx, esi
push dword [ebp - 8]
call fcn.00588e04
mov ebx, eax
test ebx, ebx
mov dword [ebp - 0x10], eax
jl 0x5971d7
cmp dword [ebp - 0x4c], 0
je 0x596e82
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.0059508b
mov ebx, eax
test ebx, ebx
jl 0x5971d7
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 0x5971d2
cmp dword [ebp - 0x44], eax
jne 0x596de6
push edi
push dword [ebp - 4]
mov ecx, esi
call fcn.0057f3eb
mov ebx, eax
test ebx, ebx
jl 0x5971d7
xor ecx, ecx
cmp dword [esi + 0x23c], ecx
jbe 0x596dfa
mov eax, dword [ebp - 0xc]
lea edx, [eax + ecx*4]
mov eax, dword [edx]
cmp eax, 0xffffffff
je 0x596ddb
mov eax, dword [edi + eax*4]
mov dword [edx], eax
inc ecx
cmp ecx, dword [esi + 0x23c]
jb 0x596dc9
jmp 0x596dfa
cmp dword [esi + 0x23c], eax
jbe 0x596dfa
mov dword [edi + eax*4], eax
inc eax
cmp eax, dword [esi + 0x23c]
jb 0x596dee
push edi
push dword [ebp - 8]
mov ecx, esi
call fcn.00588e04
mov ebx, eax
test ebx, ebx
mov dword [ebp - 0x10], ebx
jl 0x5971d7
xor edx, edx
xor ecx, ecx
cmp dword [esi + 0x264], edx
jbe 0x596e44
mov edi, dword [ebp - 4]
mov eax, dword [edi + ecx*4]
cmp eax, 0xffffffff
je 0x596e37
mov edi, dword [ebp - 0x24]
mov eax, dword [edi + eax*4]
mov edi, dword [ebp - 4]
mov dword [edi + ecx*4], eax
jmp 0x596e3b
or dword [edi + ecx*4], 0xffffffff
inc ecx
cmp ecx, dword [esi + 0x264]
jb 0x596e1e
xor eax, eax
cmp dword [esi + 0x264], edx
jbe 0x596e5e
mov ecx, dword [ebp - 8]
or dword [ecx + eax*4], 0xffffffff
inc eax
cmp eax, dword [esi + 0x264]
jb 0x596e4e
xor eax, eax
cmp dword [esi + 0x264], edx
jbe 0x596e82
mov ecx, dword [ebp - 4]
mov ecx, dword [ecx + eax*4]
cmp ecx, 0xffffffff
je 0x596e79
mov edx, dword [ebp - 8]
mov dword [edx + ecx*4], eax
inc eax
cmp eax, dword [esi + 0x264]
jb 0x596e68
xor edi, edi
cmp dword [ebp + 0x18], edi
jne 0x596e9a
cmp dword [ebp - 0x1c], edi
ja 0x596e9a
cmp dword [esi + 0x240], edi
jne 0x596f2d
lea eax, [ebp - 0x14]
push eax
mov eax, dword [esi + 0x23c]
shl eax, 2
push eax
call sym.d3dx9_35.dll_D3DXCreateBuffer
mov ebx, eax
cmp ebx, edi
mov dword [ebp - 0x10], ebx
jl 0x5971d7
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 0x596edf
or dword [edx + eax*4], 0xffffffff
inc eax
cmp eax, dword [esi + 0x23c]
jb 0x596ed2
xor eax, eax
cmp dword [ebp - 0x3c], edi
jbe 0x596efa
mov ecx, dword [ebp - 0xc]
mov ecx, dword [ecx + eax*4]
cmp ecx, 0xffffffff
je 0x596ef4
mov dword [edx + ecx*4], eax
inc eax
cmp eax, dword [ebp - 0x3c]
jb 0x596ee6
cmp dword [ebp - 0x1c], edi
jbe 0x596f30
xor ecx, ecx
cmp dword [esi + 0x23c], edi
jbe 0x596f2d
mov eax, dword [edx + ecx*4]
cmp eax, 0xffffffff
je 0x596f24
cmp eax, dword [ebp - 0x30]
jb 0x596f22
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 0x596f09
cmp dword [ebp - 0x1c], edi
jne 0x596f6f
cmp dword [esi + 0x240], edi
jbe 0x596f6f
push edi
lea eax, [ebp - 0x18]
push eax
mov ecx, esi
call fcn.0057d58a
mov ebx, eax
cmp ebx, edi
jl 0x5971d7
push dword [ebp - 0x18]
mov ecx, esi
push dword [ebp - 0xc]
call fcn.00588cb8
mov ebx, eax
cmp ebx, edi
mov dword [ebp - 0x10], ebx
jl 0x5971d7
jmp 0x597122
test byte [esi + 0x218], 0x20
jne 0x597122
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 0x596fab
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.00582720
mov ebx, eax
test ebx, ebx
jl 0x5971d7
push 0
lea eax, [ebp - 0x18]
push eax
mov ecx, esi
call fcn.0057d58a
mov ebx, eax
test ebx, ebx
jl 0x5971d7
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 0x5971d7
cmp dword [ebp + 0x20], 0
je 0x597078
lea edi, [esi + 0xc]
push edi
push dword [ebp + 0x20]
call fcn.0057cc47
test eax, eax
jne 0x597078
push edi
push dword [ebp + 0x20]
lea ecx, [ebp - 0x3e0]
call fcn.0058301c
push dword [ebp - 0x18]
lea ecx, [ebp - 0x3e0]
push dword [ebp - 0x2c]
call fcn.0057cb5a
xor edi, edi
cmp dword [esi + 0x23c], edi
jbe 0x5970bf
mov eax, dword [ebp - 0x28]
mov eax, dword [eax + edi*4]
cmp eax, 0xffffffff
je 0x59706d
push 1
push edi
push eax
lea ecx, [ebp - 0x3e0]
call fcn.0057cb8a
inc edi
cmp edi, dword [esi + 0x23c]
jb 0x597053
jmp 0x5970bf
and dword [ebp + 0x20], 0
cmp dword [esi + 0x23c], 0
mov ebx, dword [ebp - 0x18]
jbe 0x5970bf
mov eax, dword [ebp - 0x28]
mov ecx, dword [ebp + 0x20]
mov ecx, dword [eax + ecx*4]
cmp ecx, 0xffffffff
je 0x5970b1
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 0x597088
mov ecx, dword [ebp - 0x38]
xor eax, eax
cmp ecx, eax
je 0x5970f1
cmp dword [esi + 0x23c], eax
jbe 0x5970f1
mov edx, dword [ebp - 0x28]
mov edx, dword [edx + eax*4]
mov edx, dword [ecx + edx*4]
mov ebx, dword [ebp - 0xc]
mov edi, dword [esi + 0x244]
mov edx, dword [ebx + edx*4]
mov dword [edi + eax*4], edx
inc eax
cmp eax, dword [esi + 0x23c]
jb 0x5970d0
xor ecx, ecx
xor edx, edx
cmp dword [esi + 0x23c], ecx
jbe 0x597117
mov eax, dword [ebp - 0xc]
lea eax, [eax + ecx*4]
cmp dword [eax], 0xffffffff
je 0x59710b
inc edx
jmp 0x59710e
or dword [eax], 0xffffffff
inc ecx
cmp ecx, dword [esi + 0x23c]
jb 0x5970fd
mov ebx, dword [ebp - 0x10]
mov dword [esi + 0x23c], edx
xor edi, edi
cmp dword [ebp + 0x14], edi
je 0x59714d
mov eax, dword [esi + 0x264]
shl eax, 2
test dword [ebp + 8], 0x80000000
push eax
je 0x59713f
push dword [ebp - 8]
jmp 0x597142
push dword [ebp - 4]
push dword [ebp + 0x14]
call sub.msvcrt.dll_memcpy
add esp, 0xc
cmp dword [ebp + 0x10], edi
je 0x5971c0
mov eax, dword [ebp + 0x10]
cmp eax, dword [ebp + 0xc]
jne 0x59716e
push dword [ebp - 0x48]
push eax
push dword [ebp - 8]
call fcn.0057a90f
mov ebx, eax
test ebx, ebx
jl 0x5971d7
jmp 0x5971c0
xor edx, edx
cmp dword [esi + 0x264], edx
jbe 0x5971c0
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 0x5971a8
mov ebx, dword [ebp - 8]
mov edi, dword [ebx + edi*4]
mov ebx, dword [ebp - 0x10]
mov dword [ecx], edi
jmp 0x5971ab
or dword [ecx], 0xffffffff
add ecx, 4
dec dword [ebp + 0x10]
jne 0x597193
add dword [ebp + 8], 0xc
inc edx
cmp edx, dword [esi + 0x264]
jb 0x59717b
mov eax, dword [ebp + 0x18]
test eax, eax
je 0x5971d7
mov ecx, dword [ebp - 0x14]
and dword [ebp - 0x14], 0
mov dword [eax], ecx
jmp 0x5971d7
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 0x59721c
push eax
call sub.msvcrt.dll_void___cdecl_operator_delete_void__
pop ecx
xor edi, edi
cmp dword [ebp - 0x18], edi
je 0x59722f
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 0x59723d
mov eax, dword [esi]
push esi
call dword [eax + 0x30]
mov eax, dword [ebp - 0x14]
cmp eax, edi
je 0x59724d
mov ecx, dword [eax]
push eax
call dword [ecx + 8]
mov dword [ebp - 0x14], edi
cmp esi, edi
je 0x597257
mov eax, dword [esi]
push esi
call dword [eax + 8]
pop edi
pop esi
mov eax, ebx
pop ebx
leave
ret 0x1c