Function at 0x580530
Capabilities:
Encode data using xor

Disassembly:
sub esp, 0x21c
mov eax, dword [0x5eef00]
xor eax, esp
mov dword [esp + 0x218], eax
push ebx
mov ebx, ecx
test ebx, ebx
mov dword [esp + 0xc], 0xffffffff
je 0x580de2
mov eax, dword [esp + 0x224]
test eax, eax
je 0x580de2
cmp dword [eax + 8], 0
je 0x580de2
push ebp
mov ebp, 1
cmp dword [ebx + 0xc48], ebp
jne 0x580de1
cmp dword [ebx + 0x1028], ebp
jne 0x580de1
cmp byte [eax], 0x14
jne 0x580de1
cmp dword [eax + 4], 0xc
jne 0x580de1
mov eax, dword [ebx]
cmp eax, ebp
push esi
lea esi, [ebx + 0xf00]
je 0x5805b4
lea esi, [ebx + 0xdd8]
cmp eax, ebp
push edi
mov ecx, 0x16
lea edi, [esp + 0x1c]
rep movsd dword es:[edi], dword [esi]
lea esi, [ebx + 0xf58]
je 0x5805d0
lea esi, [ebx + 0xe30]
cmp eax, ebp
mov ecx, 0x18
lea edi, [esp + 0x74]
rep movsd dword es:[edi], dword [esi]
lea esi, [ebx + 0xfb8]
je 0x5805eb
lea esi, [ebx + 0xe90]
cmp word [ebx + 0x1054], 0x303
mov ecx, 0x1c
lea edi, [esp + 0xd4]
rep movsd dword es:[edi], dword [esi]
jb 0x580875
lea eax, [esp + 0x208]
push eax
lea ecx, [esp + 0xd8]
push ecx
call fcn.004ce230
lea edx, [esp + 0x210]
add esp, 8
test edx, edx
lea esi, [ebx + 0xcc0]
mov dword [esp + 0x14], esi
je 0x580ddf
test esi, esi
je 0x580ddf
lea eax, [esp + 0x1c8]
test eax, eax
je 0x580ddf
cmp dword [ebx], ebp
je 0x580698
mov ecx, dword [str.client_finished]
mov edx, dword [0x5bc5b0]
mov eax, dword [0x5bc5b4]
mov dword [esp + 0x144], ecx
mov cx, word [0x5bc5b8]
mov dword [esp + 0x148], edx
mov dl, byte [0x5bc5ba]
mov dword [esp + 0x14c], eax
mov word [esp + 0x150], cx
mov byte [esp + 0x152], dl
jmp 0x5806d9
mov eax, dword [str.server_finished]
mov ecx, dword [0x5bc5a0]
mov edx, dword [0x5bc5a4]
mov dword [esp + 0x144], eax
mov ax, word [0x5bc5a8]
mov dword [esp + 0x148], ecx
mov cl, byte [0x5bc5aa]
mov dword [esp + 0x14c], edx
mov word [esp + 0x150], ax
mov byte [esp + 0x152], cl
push 0x20
lea edx, [esp + 0x20c]
push edx
lea eax, [esp + 0x15b]
push eax
call fcn.004b42c0
lea ecx, [esp + 0x150]
add esp, 0xc
test ecx, ecx
je 0x580ddf
push 0x20
lea edx, [esp + 0x1ac]
push edx
push 0x30
push esi
mov eax, ecx
push 0x2f
push eax
xor ebp, ebp
mov dword [esp + 0x28], 0xffffffff
call fcn.004cbed0
add esp, 0x18
test eax, eax
jne 0x580ddf
push 0x4f
call fcn.004772c0
mov ebx, eax
add esp, 4
test ebx, ebx
je 0x580ddf
mov ecx, 8
lea esi, [esp + 0x1a8]
mov edi, ebx
rep movsd dword es:[edi], dword [esi]
push 0x2f
lea ecx, [esp + 0x148]
push ecx
lea eax, [ebx + 0x20]
push eax
call fcn.004b42c0
mov esi, dword [esp + 0x20]
push 0x20
lea edx, [esp + 0x188]
push edx
push 0x30
push esi
push 0x4f
push ebx
call fcn.004cbed0
add esp, 0x24
test eax, eax
jne 0x580857
push 0x20
lea eax, [esp + 0x1ac]
push eax
push 0x30
push esi
mov ecx, eax
push 0x20
push ecx
call fcn.004cbed0
add esp, 0x18
test eax, eax
jne 0x580857
mov eax, 0xc
sub eax, ebp
cmp eax, 0x20
jbe 0x5807bc
mov eax, 0x20
push eax
lea edx, [esp + 0x17c]
push edx
lea eax, [esp + ebp + 0x1d0]
push eax
call fcn.004b42c0
add ebp, 0x20
add esp, 0xc
cmp ebp, 0xc
jb 0x580742
xor eax, eax
mov dword [esp + 0x178], eax
mov dword [esp + 0x17c], eax
mov dword [esp + 0x180], eax
mov dword [esp + 0x184], eax
mov dword [esp + 0x188], eax
mov dword [esp + 0x18c], eax
mov dword [esp + 0x190], eax
mov dword [esp + 0x194], eax
mov dword [esp + 0x1a8], eax
mov dword [esp + 0x1ac], eax
mov dword [esp + 0x1b0], eax
mov dword [esp + 0x1b4], eax
mov dword [esp + 0x1b8], eax
mov dword [esp + 0x1bc], eax
mov dword [esp + 0x1c0], eax
mov dword [esp + 0x1c4], eax
xor esi, esi
jmp 0x58085b
mov esi, dword [esp + 0x10]
push 0x4f
push 0
push ebx
call fcn.004b3a80
push ebx
call fcn.00477540
add esp, 0x10
test esi, esi
jmp 0x580d3d
lea ecx, [esp + 0x1c]
push ecx
lea edx, [esp + 0x1d8]
push edx
call fcn.004ca7f0
lea eax, [esp + 0x1fc]
push eax
lea ecx, [esp + 0x80]
push ecx
call fcn.004caee0
lea edx, [esp + 0x1e4]
add esp, 0x10
test edx, edx
lea ebp, [ebx + 0xcc0]
je 0x580ddf
lea eax, [esp + 0x1f4]
test eax, eax
je 0x580ddf
test ebp, ebp
je 0x580ddf
lea ecx, [esp + 0x1c8]
test ecx, ecx
je 0x580ddf
cmp dword [ebx], 1
je 0x580922
mov edx, dword [str.client_finished]
mov eax, dword [0x5bc5b0]
mov ecx, dword [0x5bc5b4]
mov dword [esp + 0x144], edx
mov dx, word [0x5bc5b8]
mov dword [esp + 0x148], eax
mov al, byte [0x5bc5ba]
mov dword [esp + 0x14c], ecx
mov word [esp + 0x150], dx
mov byte [esp + 0x152], al
jmp 0x580964
mov ecx, dword [str.server_finished]
mov edx, dword [0x5bc5a0]
mov eax, dword [0x5bc5a4]
mov dword [esp + 0x144], ecx
mov cx, word [0x5bc5a8]
mov dword [esp + 0x148], edx
mov dl, byte [0x5bc5aa]
mov dword [esp + 0x14c], eax
mov word [esp + 0x150], cx
mov byte [esp + 0x152], dl
mov eax, dword [esp + 0x1d4]
mov ecx, dword [esp + 0x1d8]
mov edx, dword [esp + 0x1dc]
mov dword [esp + 0x153], eax
mov eax, dword [esp + 0x1e0]
mov dword [esp + 0x15f], eax
mov eax, dword [esp + 0x1fc]
mov dword [esp + 0x157], ecx
mov ecx, dword [esp + 0x1f4]
mov dword [esp + 0x15b], edx
mov edx, dword [esp + 0x1f8]
mov dword [esp + 0x16b], eax
mov dword [esp + 0x163], ecx
mov ecx, dword [esp + 0x200]
mov dword [esp + 0x167], edx
mov edx, dword [esp + 0x204]
or esi, 0xffffffff
lea eax, [esp + 0x144]
test eax, eax
mov dword [esp + 0x16f], ecx
mov dword [esp + 0x173], edx
mov dword [esp + 0x14], esi
je 0x580ddf
push 0xc
call fcn.004772c0
mov edi, eax
add esp, 4
test edi, edi
je 0x580ddf
push 0x10
lea ecx, [esp + 0x19c]
push ecx
push 0x18
push ebp
lea edx, [esp + 0x154]
push 0x33
push edx
xor ebx, ebx
mov dword [esp + 0x28], esi
call fcn.004cbb40
add esp, 0x18
test eax, eax
jne 0x580d25
push 0x43
call fcn.004772c0
mov esi, eax
add esp, 4
test esi, esi
je 0x580d25
lea ecx, [ecx]
mov eax, dword [esp + 0x198]
mov dword [esi], eax
mov ecx, dword [esp + 0x19c]
mov dword [esi + 4], ecx
mov edx, dword [esp + 0x1a0]
mov dword [esi + 8], edx
mov eax, dword [esp + 0x1a4]
push 0x33
lea ecx, [esp + 0x148]
mov dword [esi + 0xc], eax
push ecx
lea eax, [esi + 0x10]
push eax
call fcn.004b42c0
push 0x10
lea edx, [esp + 0x1f4]
push edx
push 0x18
push ebp
push 0x43
push esi
call fcn.004cbb40
add esp, 0x24
test eax, eax
jne 0x580b3c
push 0x10
lea eax, [esp + 0x19c]
push eax
push 0x18
push ebp
mov ecx, eax
push 0x10
push ecx
call fcn.004cbb40
add esp, 0x18
test eax, eax
jne 0x580b3c
mov eax, 0xc
sub eax, ebx
cmp eax, 0x10
jbe 0x580ad9
mov eax, 0x10
push eax
lea edx, [esp + 0x1e8]
push edx
lea eax, [esp + ebx + 0x1d0]
push eax
call fcn.004b42c0
add ebx, 0x10
add esp, 0xc
cmp ebx, 0xc
jb 0x580a50
xor eax, eax
mov dword [esp + 0x1e4], eax
mov dword [esp + 0x1e8], eax
mov dword [esp + 0x1ec], eax
mov dword [esp + 0x1f0], eax
mov dword [esp + 0x198], eax
mov dword [esp + 0x19c], eax
mov dword [esp + 0x1a0], eax
mov dword [esp + 0x1a4], eax
xor ebx, ebx
jmp 0x580b40
mov ebx, dword [esp + 0x10]
push 0x43
push 0
push esi
call fcn.004b3a80
push esi
call fcn.00477540
add esp, 0x10
test ebx, ebx
jne 0x580d25
add ebp, 0x18
test ebp, ebp
mov dword [esp + 0x10], 0xffffffff
je 0x580d25
push 0x14
lea ecx, [esp + 0x17c]
push ecx
push 0x18
push ebp
lea edx, [esp + 0x154]
push 0x33
push edx
call fcn.004cbd00
add esp, 0x18
test eax, eax
jne 0x580d25
push 0x47
call fcn.004772c0
mov esi, eax
add esp, 4
test esi, esi
je 0x580d25
lea esp, [esp]
mov eax, dword [esp + 0x178]
mov dword [esi], eax
mov ecx, dword [esp + 0x17c]
mov dword [esi + 4], ecx
mov edx, dword [esp + 0x180]
mov dword [esi + 8], edx
mov eax, dword [esp + 0x184]
mov dword [esi + 0xc], eax
mov ecx, dword [esp + 0x188]
push 0x33
lea edx, [esp + 0x148]
push edx
lea eax, [esi + 0x14]
push eax
mov dword [esi + 0x10], ecx
call fcn.004b42c0
push 0x14
lea eax, [esp + 0x1b8]
push eax
push 0x18
push ebp
push 0x47
push esi
call fcn.004cbd00
add esp, 0x24
test eax, eax
jne 0x580cb4
push 0x14
lea ecx, [esp + 0x17c]
push ecx
push 0x18
push ebp
mov edx, ecx
push 0x14
push edx
call fcn.004cbd00
add esp, 0x18
test eax, eax
jne 0x580cb4
mov eax, 0xc
sub eax, ebx
cmp eax, 0x14
jbe 0x580c47
mov eax, 0x14
push eax
lea eax, [esp + 0x1ac]
push eax
lea ecx, [ebx + edi]
push ecx
call fcn.004b42c0
add ebx, 0x14
add esp, 0xc
cmp ebx, 0xc
jb 0x580bb0
xor eax, eax
mov dword [esp + 0x1a8], eax
mov dword [esp + 0x1ac], eax
mov dword [esp + 0x1b0], eax
mov dword [esp + 0x1b4], eax
mov dword [esp + 0x1b8], eax
mov dword [esp + 0x178], eax
mov dword [esp + 0x17c], eax
mov dword [esp + 0x180], eax
mov dword [esp + 0x184], eax
mov dword [esp + 0x188], eax
xor ebx, ebx
jmp 0x580cb8
mov ebx, dword [esp + 0x10]
push 0x47
push 0
push esi
call fcn.004b3a80
push esi
call fcn.00477540
add esp, 0x10
test ebx, ebx
jne 0x580d25
mov esi, edi
lea edx, [esp + 0x1c8]
xor ecx, ecx
sub esi, edx
lea esp, [esp]
lea eax, [esp + ecx + 0x1c8]
movzx edx, byte [eax + esi]
xor byte [eax], dl
movzx edx, byte [edi + ecx + 1]
xor byte [eax + 1], dl
movzx edx, byte [edi + ecx + 2]
xor byte [eax + 2], dl
movzx edx, byte [edi + ecx + 3]
xor byte [eax + 3], dl
movzx edx, byte [edi + ecx + 4]
xor byte [eax + 4], dl
movzx edx, byte [edi + ecx + 5]
xor byte [eax + 5], dl
add ecx, 6
cmp ecx, 0xc
jb 0x580ce0
mov dword [esp + 0x14], 0
xor eax, eax
mov dword [edi], eax
mov dword [edi + 4], eax
push edi
mov dword [edi + 8], eax
call fcn.00477540
add esp, 4
cmp dword [esp + 0x14], 0
jne 0x580ddf
mov edx, dword [esp + 0x230]
mov edx, dword [edx + 8]
mov eax, 0xc
lea ecx, [esp + 0x1c8]
lea esp, [esp]
mov esi, dword [edx]
cmp esi, dword [ecx]
jne 0x580d78
sub eax, 4
add ecx, 4
add edx, 4
cmp eax, 4
jae 0x580d60
test eax, eax
je 0x580dd5
movzx esi, byte [edx]
movzx edi, byte [ecx]
sub esi, edi
jne 0x580dc7
sub eax, 1
add ecx, 1
add edx, 1
test eax, eax
je 0x580dd5
movzx esi, byte [edx]
movzx edi, byte [ecx]
sub esi, edi
jne 0x580dc7
sub eax, 1
add ecx, 1
add edx, 1
test eax, eax
je 0x580dd5
movzx esi, byte [edx]
movzx edi, byte [ecx]
sub esi, edi
jne 0x580dc7
sub eax, 1
add ecx, 1
add edx, 1
test eax, eax
je 0x580dd5
movzx esi, byte [edx]
movzx eax, byte [ecx]
sub esi, eax
je 0x580dd5
test esi, esi
mov eax, 1
jg 0x580dd7
or eax, 0xffffffff
jmp 0x580dd7
xor eax, eax
test eax, eax
jne 0x580ddf
mov dword [esp + 0x18], eax
pop edi
pop esi
pop ebp
mov ecx, dword [esp + 0x21c]
mov eax, dword [esp + 0xc]
pop ebx
xor ecx, esp
call fcn.004b2f95
add esp, 0x21c
ret