Function at 0x512330
Capabilities:
Packed with generic packer

Disassembly:
push ebp
mov ebp, esp
push ecx
push ebx
push esi
mov esi, ecx
push edi
mov dword [ebp - 4], esi
mov ecx, dword [esi + 0x1e0]
mov eax, dword [esi + 0x234]
inc ecx
test eax, eax
mov dword [esi + 0x1e0], ecx
je 0x5123ac
call dword [0x5872c8]
cmp eax, dword [esi + 0x234]
je 0x5123ac
mov eax, dword [esi + 0x3f0]
mov edi, dword [ebp + 8]
test eax, eax
je 0x51238e
push eax
call dword [0x587650]
test eax, eax
je 0x51238e
mov eax, dword [esi + 0x3f0]
push 0
push edi
push 0x83e7
push eax
call dword [0x58765c]
mov eax, dword [esi + 0x428]
test eax, eax
jne 0x5126ae
push edi
call dword [0x5872cc]
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 4
mov ecx, esi
mov dword [esi + 0x428], 1
call fcn.005110c0
mov edx, dword [esi + 0x104]
lea ecx, [esi + 0x104]
call dword [edx + 8]
mov eax, dword [esi + 0x41c]
test eax, eax
je 0x512408
mov al, byte [0x6d54b4]
test al, 1
jne 0x5123f1
or al, 1
mov byte [0x6d54b4], al
mov eax, dword [esi + 0x41c]
mov dword [0x6d54b0], eax
pushal
call dword [0x6d54b0]
popal
mov ecx, dword [ebp - 4]
mov esi, ecx
mov dword [ecx + 0x41c], 0
mov ebx, dword [esi + 0x130]
xor edi, edi
shr ebx, 2
test ebx, ebx
jle 0x51243a
mov edx, dword [esi + 0x128]
mov eax, dword [edx + edi*4]
test eax, eax
je 0x512435
mov ecx, dword [esi + 0x13c]
push 0
mov edx, dword [ecx + edi*4]
push edx
push 6
call dword [eax + 0x78]
inc edi
cmp edi, ebx
jl 0x512417
lea ecx, [esi + 0x134]
call fcn.004f9e80
lea ecx, [esi + 0x120]
call fcn.004f9e80
mov ebx, dword [esi + 0x180]
shr ebx, 2
test ebx, ebx
jle 0x5124a8
xor edi, edi
test ebx, ebx
jle 0x51247c
mov eax, dword [esi + 0x178]
mov eax, dword [eax + edi*4]
test eax, eax
je 0x512477
push eax
call dword [0x58730c]
inc edi
cmp edi, ebx
jl 0x512463
lea ecx, [esi + 0x170]
call fcn.004f9e80
lea ecx, [esi + 0x184]
call fcn.004f9e80
lea ecx, [esi + 0x148]
call fcn.004f9e80
lea ecx, [esi + 0x15c]
call fcn.004f9e80
mov ebx, dword [esi + 0x1bc]
shr ebx, 2
test ebx, ebx
jle 0x5124ea
xor edi, edi
test ebx, ebx
jle 0x5124d0
mov ecx, dword [esi + 0x1b4]
mov edx, dword [ecx + edi*4]
push edx
call dword [0x58730c]
inc edi
cmp edi, ebx
jl 0x5124bb
lea ecx, [esi + 0x1ac]
call fcn.004f9e80
push 0xffffffffffffffff
push 0
lea ecx, [esi + 0x1c0]
call fcn.00574e68
mov ecx, esi
call fcn.00511750
lea ecx, [esi + 0x1dc]
call fcn.00575ce6
lea ecx, [esi + 0x198]
call fcn.004f9e80
mov eax, dword [esi + 0x420]
xor ebx, ebx
cmp eax, ebx
je 0x512520
push eax
call dword [0x58756c]
mov dword [esi + 0x420], ebx
mov eax, dword [esi + 0x424]
cmp eax, ebx
je 0x512537
push eax
call dword [0x58756c]
mov dword [esi + 0x424], ebx
mov eax, dword [esi + 0x3f0]
cmp eax, ebx
je 0x51256b
push eax
call dword [0x587650]
test eax, eax
je 0x51256b
push ebx
call fcn.005776ed
test eax, eax
je 0x512565
mov eax, dword [esi + 0x3d4]
lea ecx, [esi + 0x3d4]
call dword [eax + 0x58]
mov dword [esi + 0x3f0], ebx
mov ecx, esi
call fcn.0050fec0
mov eax, dword [esi + 0x3b8]
xor edi, edi
cmp eax, ebx
mov dword [ebp + 8], eax
jle 0x51259c
mov ecx, dword [esi + 0x3b4]
mov ecx, dword [ecx + edi*4]
cmp ecx, ebx
je 0x512597
mov edx, dword [ecx]
push 1
call dword [edx]
mov eax, dword [ebp + 8]
inc edi
cmp edi, eax
jl 0x512581
push 0xffffffffffffffff
push ebx
lea ecx, [esi + 0x3b0]
call fcn.00575102
push 1
mov ecx, esi
call fcn.005145e0
cmp dword [esi + 0x270], ebx
jne 0x5125bf
xor ecx, ecx
jmp 0x5125c5
mov ecx, dword [esi + 0x268]
mov eax, dword [esi + 0x270]
shr eax, 2
cmp eax, ebx
jle 0x512628
mov dword [ebp + 8], ecx
mov dword [ebp - 4], eax
mov edi, dword [ecx]
cmp edi, ebx
je 0x512616
mov eax, dword [edi + 0xc]
mov dword [edi], ebx
cmp eax, ebx
mov dword [edi + 4], ebx
mov dword [edi + 8], ebx
mov dword [edi + 0x14], ebx
je 0x5125fa
push eax
call dword [0x58756c]
mov dword [edi + 0xc], ebx
mov eax, dword [edi + 0x10]
cmp eax, ebx
je 0x51260d
push eax
call fcn.00575ac5
add esp, 4
mov dword [edi + 0x10], ebx
push edi
call fcn.00575ac5
add esp, 4
mov ecx, dword [ebp + 8]
mov eax, dword [ebp - 4]
add ecx, 4
dec eax
mov dword [ebp + 8], ecx
mov dword [ebp - 4], eax
jne 0x5125d8
lea ecx, [esi + 0x260]
call fcn.004f9e80
cmp dword [esi + 0x3ac], 1
jne 0x512648
call dword [0x5877b0]
mov dword [esi + 0x3ac], ebx
mov ebx, dword [esi + 0xf8]
xor edi, edi
test ebx, ebx
jle 0x512676
mov eax, dword [esi + 0xf4]
mov edx, dword [esi + 0xe0]
push 0
mov ecx, dword [eax + edi*4]
mov eax, dword [edx + edi*4]
push ecx
push eax
mov ecx, esi
call fcn.00511f10
inc edi
cmp edi, ebx
jl 0x512654
push 0xffffffffffffffff
push 0
lea ecx, [esi + 0xdc]
call fcn.00574e68
push 0xffffffffffffffff
push 0
lea ecx, [esi + 0xf0]
call fcn.00574e68
mov eax, dword [esi + 0x410]
test eax, eax
je 0x5126ae
call dword [0x5877fc]
mov dword [esi + 0x410], 0
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 4