Function at 0x501860
Capabilities:
Encrypt data using rc4 ksa
Read file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x320
mov eax, dword [0x641a90]
xor eax, ebp
mov dword [ebp - 4], eax
cmp word [ebp + 0x14], 0
mov eax, dword [ebp + 8]
push ebx
mov dword [ebp - 0x290], eax
mov eax, dword [ebp + 0xc]
push esi
mov esi, dword [ebp + 0x10]
mov dword [ebp - 0x2a0], eax
mov eax, dword [ebp + 0x18]
mov dword [ebp - 0x2a4], eax
mov eax, dword [esi + 0x5c]
mov ebx, dword [esi]
mov dword [ebp - 0x2b0], eax
mov eax, dword [esi + 0x54]
push edi
mov dword [ebp - 0x288], eax
mov dword [ebp - 0x294], 0
mov dword [ebp - 0x2dc], 0xfa00
mov dword [ebp - 0x2e4], 0
je 0x5018d5
mov dword [ebp - 0x298], ebx
jmp 0x501911
mov eax, dword [esi + 0x10]
mov dword [ebp - 0x298], eax
cmp eax, 8
jle 0x5018ee
imul eax, ebx
add eax, 7
sar eax, 3
jmp 0x50190b
mov eax, 8
lea ecx, [ebx - 1]
cdq
idiv dword [ebp - 0x298]
mov edi, eax
add ecx, edi
lea eax, [edi - 1]
not eax
and eax, ecx
cdq
idiv edi
mov dword [ebp - 0x298], eax
movzx ecx, word [esi + 0xa]
movzx edx, word [esi + 0x48]
movsx edi, cx
mov eax, edi
mov dword [esi + 0x9c], 0
imul eax, ebx
mov dword [ebp - 0x28c], 0
mov dword [ebp - 0x2d0], eax
cmp edx, 6
jne 0x501988
movsx eax, word [esi + 8]
cdq
and edx, 7
add eax, edx
sar eax, 3
imul eax, ebx
imul eax, dword [ebp - 0x288]
add eax, eax
push eax
call fcn.00593e38
mov ebx, eax
mov dword [ebp - 0x28c], ebx
add esp, 4
test ebx, ebx
jne 0x501adc
pop edi
pop esi
mov eax, 1
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.005920c1
mov esp, ebp
pop ebp
ret
movzx eax, word [esi + 8]
cmp ax, 8
jl 0x501ada
cmp word [esi + 0xe], 1
jne 0x5019e9
cmp word [esi + 0xc], 0
jle 0x5019e9
cmp cx, 4
jg 0x5019c0
test dx, dx
je 0x5019b4
cmp edx, 1
jne 0x5019e9
cmp ax, 8
jne 0x5019ed
cmp cx, 1
jle 0x5019e9
cwde
cdq
and edx, 7
add eax, edx
sar eax, 3
imul eax, edi
mov edi, eax
mov eax, dword [ebp - 0x288]
imul edi, ebx
imul eax, edi
mov dword [ebp - 0x298], edi
add eax, 0x40
jmp 0x501959
cmp ax, 8
jg 0x501a5d
cmp ax, 8
jne 0x501ada
cmp cx, 2
jne 0x501a06
cmp word [esi + 0xe], 1
je 0x501a5d
cmp ax, 8
jne 0x501ada
cmp word [esi + 0xe], 1
jne 0x501ada
cmp word [esi + 0xc], 1
jne 0x501ada
cmp dword [esi + 0x10], 0x18
jne 0x501ada
imul ebx, dword [ebp - 0x288]
mov eax, dword [ebp - 0x2d0]
mov dword [ebp - 0x298], eax
lea eax, [ebx*4 + 0x400]
push eax
call fcn.00593e38
mov ebx, eax
add esp, 4
mov dword [ebp - 0x28c], ebx
jmp 0x501adc
cmp ax, 0xc
jne 0x501a76
mov eax, dword [ebp - 0x298]
lea eax, [eax + eax*2]
inc eax
cdq
sub eax, edx
mov edi, eax
sar edi, 1
jmp 0x501a8f
mov edi, dword [ebp - 0x298]
cmp ax, 0x10
jne 0x501a86
add edi, edi
jmp 0x501a8f
cmp ax, 0x20
jne 0x501a95
shl edi, 2
mov dword [ebp - 0x298], edi
cmp word [esi + 0x70], 0
je 0x501aa7
mov eax, dword [esi + 4]
imul eax, edi
jmp 0x501959
cmp word [esi + 0x44], 1
jne 0x501ab9
lea eax, [edi + 0x400]
jmp 0x501959
mov eax, dword [ebp - 0x288]
imul eax, edi
add eax, 0x400
push eax
call fcn.00593e38
mov ebx, eax
mov dword [ebp - 0x28c], eax
jmp 0x501967
xor ebx, ebx
push 4
push dword [ebp - 0x2b0]
call fcn.00592c0b
mov edx, eax
add esp, 8
mov dword [ebp - 0x2c4], edx
test edx, edx
jne 0x501b0e
test ebx, ebx
je 0x501972
push ebx
call fcn.00592c4b
add esp, 4
jmp 0x501972
mov edi, dword [esi + 0x60]
xor ecx, ecx
mov dword [ebp - 0x2a8], ecx
test edi, edi
jle 0x501b5f
push 4
push dword [ebp - 0x2b0]
call fcn.00592c0b
mov ecx, eax
add esp, 8
mov dword [ebp - 0x2a8], ecx
test ecx, ecx
jne 0x501b59
test ebx, ebx
je 0x501b46
push ebx
call fcn.00592c4b
add esp, 4
push dword [ebp - 0x2c4]
call fcn.00592c4b
add esp, 4
jmp 0x501972
mov edx, dword [ebp - 0x2c4]
cmp dword [ebp - 0x2b0], 1
mov eax, dword [esi + 0x58]
jne 0x501bcf
mov dword [edx], eax
test ecx, ecx
je 0x501b73
mov dword [ecx], edi
mov edi, dword [ebp - 0x290]
xor eax, eax
mov dword [ebp - 0x2e8], 0x8774
or ecx, 0xffffffff
cmp word [ebp + 0x14], ax
cmove eax, ecx
mov ecx, dword [ebp - 0x298]
mov dword [ebp - 0x2c0], eax
mov eax, dword [esi]
mov dword [esi + 0x14], ecx
mov ecx, 0x804c
mov dword [esi + 0x18], eax
movzx eax, word [esi + 0x44]
lea edx, [ecx + 0x66]
cmp eax, 5
jne 0x501d75
push esi
call fcn.00548390
add esp, 4
test ax, ax
jne 0x501ddf
jmp 0x501972
push 0
push eax
mov eax, dword [ebp - 0x290]
push dword [eax]
call fcn.00595cb4
add esp, 0xc
test eax, eax
je 0x501c22
test ebx, ebx
je 0x501bf3
push ebx
call fcn.00592c4b
add esp, 4
push dword [ebp - 0x2c4]
call fcn.00592c4b
push dword [ebp - 0x2a8]
call fcn.00592c4b
add esp, 8
mov eax, 4
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.005920c1
mov esp, ebp
pop ebp
ret
xor edi, edi
cmp word [esi + 0x64], 3
jne 0x501c60
cmp dword [ebp - 0x2b0], edi
jle 0x501c91
mov ebx, dword [ebp - 0x290]
lea esp, [esp]
mov eax, dword [esi + 0x34]
push ebx
call eax
mov ecx, dword [ebp - 0x2c4]
add esp, 4
movzx eax, ax
mov dword [ecx + edi*4], eax
inc edi
cmp edi, dword [ebp - 0x2b0]
jl 0x501c40
jmp 0x501c8b
cmp dword [ebp - 0x2b0], edi
jle 0x501c91
mov ebx, dword [ebp - 0x290]
mov edi, edi
mov eax, dword [esi + 0x38]
push ebx
call eax
mov ecx, dword [ebp - 0x2c4]
add esp, 4
mov dword [ecx + edi*4], eax
inc edi
cmp edi, dword [ebp - 0x2b0]
jl 0x501c70
mov ebx, dword [ebp - 0x28c]
cmp dword [ebp - 0x2a8], 0
je 0x501b73
mov eax, dword [ebp - 0x290]
push 0
push dword [esi + 0x60]
push dword [eax]
call fcn.00595cb4
add esp, 0xc
xor edi, edi
cmp word [esi + 0x66], 3
jne 0x501cf0
cmp dword [ebp - 0x2b0], edi
jle 0x501d21
mov ebx, dword [ebp - 0x290]
lea ebx, [ebx]
mov eax, dword [esi + 0x34]
push ebx
call eax
mov ecx, dword [ebp - 0x2a8]
add esp, 4
movzx eax, ax
mov dword [ecx + edi*4], eax
inc edi
cmp edi, dword [ebp - 0x2b0]
jl 0x501cd0
jmp 0x501d1b
cmp dword [ebp - 0x2b0], edi
jle 0x501d21
mov ebx, dword [ebp - 0x290]
mov edi, edi
mov eax, dword [esi + 0x38]
push ebx
call eax
mov ecx, dword [ebp - 0x2a8]
add esp, 4
mov dword [ecx + edi*4], eax
inc edi
cmp edi, dword [ebp - 0x2b0]
jl 0x501d00
mov ebx, dword [ebp - 0x28c]
mov edi, dword [ebp - 0x290]
push dword [edi]
call fcn.00595867
add esp, 4
test eax, eax
je 0x501b79
test ebx, ebx
je 0x501d46
push ebx
call fcn.00592c4b
add esp, 4
push dword [ebp - 0x2c4]
call fcn.00592c4b
push dword [ebp - 0x2a8]
call fcn.00592c4b
add esp, 8
mov eax, 0xb
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.005920c1
mov esp, ebp
pop ebp
ret
cmp eax, 2
je 0x501dd6
cmp eax, 3
je 0x501dd6
cmp eax, 4
je 0x501dd6
cmp eax, 7
jne 0x501d9c
lea eax, [ebp - 0x284]
push eax
push esi
push edi
call fcn.00548ba0
add esp, 0xc
jmp 0x501ddf
cmp ax, word [ebp - 0x2e8]
jne 0x501dba
push esi
cmp word [esi + 0x48], cx
jne 0x501db3
call fcn.00549070
jmp 0x501ddc
call fcn.005492e0
jmp 0x501ddc
cmp ax, dx
je 0x501dc4
cmp eax, 8
jne 0x501ddf
lea eax, [ebp - 0x320]
push eax
push esi
call fcn.00549050
add esp, 8
jmp 0x501ddf
push esi
call fcn.00531870
add esp, 4
mov edi, dword [esi + 4]
xor edx, edx
mov dword [ebp - 0x2d4], edi
mov dword [ebp - 0x29c], edx
mov dword [ebp - 0x2b4], edx
mov dword [ebp - 0x2ac], edx
cmp dword [ebp - 0x2b0], edx
jle 0x502a38
jmp 0x501e10
cmp word [ebp - 0x294], 0
jne 0x502a38
cmp dword [esi + 0xe8], 0
je 0x501e33
mov ecx, dword [esi + 0xe4]
mov dword [ebp - 0x2ac], ecx
mov eax, dword [esi + 4]
cmp edx, eax
jl 0x501e64
cmp word [ebp + 0x14], 0
je 0x501e64
mov ecx, dword [esi + 0x54]
mov edi, eax
inc dword [ebp - 0x2c0]
mov dword [ebp - 0x29c], 0
mov dword [ebp - 0x288], ecx
mov dword [ebp - 0x2d4], edi
jmp 0x501e6a
mov ecx, dword [ebp - 0x288]
test edi, edi
je 0x502a38
mov eax, dword [esi + 0x28]
test eax, eax
jle 0x501e83
cmp dword [esi + 0x2c], 0
jle 0x501e83
cmp eax, dword [esi]
jne 0x501ea1
cmp edi, ecx
jge 0x501e99
mov dword [ebp - 0x288], edi
mov dword [ebp - 0x2d4], 0
jmp 0x501ea1
sub edi, ecx
mov dword [ebp - 0x2d4], edi
mov ebx, dword [ebp - 0x290]
mov eax, dword [ebp - 0x2ac]
mov ecx, dword [ebp - 0x2c4]
push dword [ebx]
mov edi, dword [ecx + eax*4]
call fcn.005960c7
mov ecx, edi
add esp, 4
sub ecx, eax
test ecx, ecx
jle 0x501ed4
push ecx
push ebx
call fcn.0045d3f0
add esp, 8
jmp 0x501ee3
jns 0x501ee3
push 0
push edi
push dword [ebx]
call fcn.00595cb4
add esp, 0xc
push dword [ebx]
call fcn.005960c7
mov ebx, dword [esi + 0x28]
add esp, 4
test ebx, ebx
jle 0x501fb6
mov edx, dword [esi + 0x2c]
test edx, edx
jle 0x501fb6
mov ecx, dword [esi]
cmp ebx, ecx
je 0x501fb6
mov edi, dword [ebp - 0x2b4]
mov dword [ebp - 0x2b8], ebx
lea eax, [edi + ebx]
cmp eax, ecx
jle 0x501f2a
mov eax, ecx
sub eax, edi
mov dword [ebp - 0x2b8], eax
mov edi, dword [ebp - 0x29c]
mov eax, edx
mov ecx, dword [esi + 4]
mov dword [ebp - 0x288], eax
mov dword [esi + 0x54], eax
add eax, edi
cmp eax, ecx
jle 0x501f51
mov edx, ecx
sub edx, edi
mov dword [ebp - 0x288], edx
mov dword [esi + 0x54], edx
mov ecx, dword [esi + 0x10]
cmp ecx, 8
jle 0x501f87
mov edx, ebx
imul edx, ecx
add edx, 7
sar edx, 3
cmp word [esi + 8], 0x10
mov dword [ebp - 0x298], edx
jne 0x501fa8
add edx, edx
mov dword [esi + 0x18], ebx
mov ebx, dword [ebp - 0x2b8]
mov dword [ebp - 0x298], edx
mov dword [esi + 0x14], edx
jmp 0x501fc4
mov eax, 8
cdq
idiv ecx
lea ecx, [ebx - 1]
mov edi, eax
add ecx, edi
lea eax, [edi - 1]
not eax
and eax, ecx
cdq
idiv edi
mov edx, eax
mov dword [ebp - 0x298], eax
mov dword [esi + 0x18], ebx
mov ebx, dword [ebp - 0x2b8]
mov dword [esi + 0x14], edx
jmp 0x501fc4
mov ebx, dword [esi]
mov edx, dword [ebp - 0x298]
mov dword [ebp - 0x2b8], ebx
movzx ecx, word [esi + 0x48]
cmp ecx, 6
jne 0x502099
movzx eax, word [esi + 0x72]
cmp ax, 2
jne 0x50201c
cmp word [esi + 0x74], 1
jne 0x501ff4
mov edi, ebx
mov ebx, dword [ebp - 0x288]
imul edi, ebx
add edi, edi
jmp 0x502088
cmp ax, 2
jne 0x50201c
cmp word [esi + 0x74], ax
jne 0x50201c
mov eax, ebx
mov ebx, dword [ebp - 0x288]
imul eax, ebx
lea eax, [eax + eax*2]
add eax, eax
cdq
and edx, 3
lea edi, [edx + eax]
sar edi, 2
jmp 0x502088
cmp ax, 4
jne 0x50206e
cmp word [esi + 0x74], 1
jne 0x502045
mov eax, ebx
mov ebx, dword [ebp - 0x288]
imul eax, ebx
lea eax, [eax + eax*2]
add eax, eax
cdq
and edx, 3
lea edi, [edx + eax]
sar edi, 2
jmp 0x502088
cmp ax, 4
jne 0x50206e
cmp word [esi + 0x74], 2
jne 0x50206e
mov eax, ebx
mov ebx, dword [ebp - 0x288]
imul eax, ebx
lea eax, [eax + eax*4]
add eax, eax
cdq
and edx, 7
lea edi, [edx + eax]
sar edi, 3
jmp 0x502088
mov eax, ebx
mov ebx, dword [ebp - 0x288]
imul eax, ebx
lea eax, [eax + eax*8]
add eax, eax
cdq
and edx, 0xf
lea edi, [edx + eax]
sar edi, 4
cmp word [esi + 8], 0x10
mov edx, dword [ebp - 0x298]
jne 0x5020a4
add edi, edi
jmp 0x5020a4
mov ebx, dword [ebp - 0x288]
mov edi, edx
imul edi, ebx
movzx eax, word [esi + 0x44]
cmp eax, 0x8005
jg 0x5028b5
je 0x5026f5
dec eax
cmp eax, 7
ja case.0x5020c3.6
jmp dword [eax*4 + 0x502ba8]
mov eax, dword [ebp - 0x2a8]
test eax, eax
je 0x5020df
mov ecx, dword [ebp - 0x2ac]
mov eax, dword [eax + ecx*4]
jmp 0x5020e2
or eax, 0xffffffff
push esi
push eax
lea eax, [ebp - 0x284]
push eax
call fcn.00548ce0
movzx eax, ax
add esp, 0xc
mov dword [ebp - 0x294], eax
test ax, ax
jne case.0x5020c3.6
push dword [ebp - 0x2a4]
lea eax, [ebp - 0x284]
push dword [ebp - 0x2a0]
push dword [ebp - 0x29c]
push eax
call fcn.00548af0
add esp, 0x10
jmp 0x50218c
push esi
call fcn.005318f0
add esp, 4
cmp dword [esi + 0x28], 0
jle 0x5021e4
cmp dword [esi + 0x2c], 0
jle 0x5021e4
mov eax, dword [ebp - 0x2a8]
test eax, eax
je 0x50215a
mov ecx, dword [ebp - 0x2ac]
mov eax, dword [eax + ecx*4]
jmp 0x50215d
or eax, 0xffffffff
push dword [ebp - 0x2b8]
push dword [ebp - 0x29c]
push dword [ebp - 0x2b4]
push dword [ebp - 0x2a4]
push esi
push eax
push edi
push dword [ebp - 0x2a0]
push dword [ebp - 0x290]
call fcn.005331d0
add esp, 0x24
movzx eax, ax
mov dword [ebp - 0x294], eax
mov ebx, dword [ebp - 0x28c]
mov edi, dword [ebp - 0x288]
mov ecx, dword [esi + 0x28]
test ecx, ecx
jle 0x502a0b
mov eax, dword [esi + 0x2c]
test eax, eax
jle 0x502a0b
mov edi, dword [ebp - 0x2b4]
mov edx, dword [ebp - 0x29c]
add edi, ecx
mov dword [ebp - 0x2b4], edi
cmp edi, dword [esi]
jl 0x502a19
mov dword [ebp - 0x2b4], 0
add edx, eax
jmp 0x502a13
mov eax, dword [ebp - 0x2a8]
test eax, eax
je 0x5021f9
mov ecx, dword [ebp - 0x2ac]
mov eax, dword [eax + ecx*4]
jmp 0x5021fc
or eax, 0xffffffff
push dword [ebp - 0x2a4]
push esi
push eax
push edi
push dword [ebp - 0x2a0]
push dword [ebp - 0x290]
call fcn.00531820
add esp, 0x18
jmp 0x50218c
push esi
call fcn.005318f0
add esp, 4
cmp dword [esi + 0x28], 0
jle 0x5022d2
cmp dword [esi + 0x2c], 0
jle 0x5022d2
test byte [esi + 0x4c], 1
mov eax, dword [ebp - 0x2a8]
je 0x50228a
test eax, eax
je 0x502256
mov ecx, dword [ebp - 0x2ac]
mov eax, dword [eax + ecx*4]
jmp 0x502259
or eax, 0xffffffff
push dword [ebp - 0x2b8]
push dword [ebp - 0x29c]
push dword [ebp - 0x2b4]
push dword [ebp - 0x2a4]
push esi
push eax
push edi
push dword [ebp - 0x2a0]
push dword [ebp - 0x290]
call fcn.00532360
jmp 0x502189
test eax, eax
je 0x502299
mov ecx, dword [ebp - 0x2ac]
mov eax, dword [eax + ecx*4]
jmp 0x50229c
or eax, 0xffffffff
push dword [ebp - 0x2b8]
push dword [ebp - 0x29c]
push dword [ebp - 0x2b4]
push 1
push dword [ebp - 0x2a4]
push esi
push eax
push edi
push dword [ebp - 0x2a0]
push dword [ebp - 0x290]
call fcn.00531c50
add esp, 0x28
jmp 0x50218c
test byte [esi + 0x4c], 1
mov eax, dword [ebp - 0x2a8]
je 0x502312
test eax, eax
je 0x5022ed
mov ecx, dword [ebp - 0x2ac]
mov eax, dword [eax + ecx*4]
jmp 0x5022f0
or eax, 0xffffffff
push dword [ebp - 0x2a4]
push esi
push eax
push edi
push dword [ebp - 0x2a0]
push dword [ebp - 0x290]
call fcn.005317f0
add esp, 0x18
jmp 0x50218c
test eax, eax
je 0x502321
mov ecx, dword [ebp - 0x2ac]
mov eax, dword [eax + ecx*4]
jmp 0x502324
or eax, 0xffffffff
push 1
push dword [ebp - 0x2a4]
push esi
push eax
push edi
push dword [ebp - 0x2a0]
push dword [ebp - 0x290]
call fcn.005317c0
add esp, 0x1c
jmp 0x50218c
push esi
call fcn.005318f0
add esp, 4
cmp dword [esi + 0x28], 0
jle 0x5023ab
cmp dword [esi + 0x2c], 0
jle 0x5023ab
mov eax, dword [ebp - 0x2a8]
test eax, eax
je 0x502372
mov ecx, dword [ebp - 0x2ac]
mov eax, dword [eax + ecx*4]
jmp 0x502375
or eax, 0xffffffff
push dword [ebp - 0x2b8]
push dword [ebp - 0x29c]
push dword [ebp - 0x2b4]
push 1
push dword [ebp - 0x2a4]
push esi
push eax
push edi
push dword [ebp - 0x2a0]
push dword [ebp - 0x290]
call fcn.00533630
add esp, 0x28
jmp 0x50218c
mov eax, dword [ebp - 0x2a8]
test eax, eax
je 0x5023c0
mov ecx, dword [ebp - 0x2ac]
mov eax, dword [eax + ecx*4]
jmp 0x5023c3
or eax, 0xffffffff
push 1
push dword [ebp - 0x2a4]
push esi
push eax
push edi
push dword [ebp - 0x2a0]
push dword [ebp - 0x290]
call fcn.00531950
add esp, 0x1c
jmp 0x50218c
cmp ecx, 6
jne 0x50243a
mov eax, dword [ebp - 0x290]
mov ebx, dword [ebp - 0x28c]
push dword [eax]
push 1
push edi
push ebx
call fcn.00595b79
mov edi, dword [ebp - 0x288]
add esp, 0x10
test eax, eax
jne 0x50241f
mov dword [ebp - 0x294], 4
jmp 0x5021a1
movsx eax, word [esi + 8]
push eax
push edi
push dword [esi]
lea eax, [esi + 0x72]
push eax
lea eax, [esi + 0x7c]
push eax
push dword [ebp - 0x2a0]
jmp 0x5026c6
mov eax, dword [ebp - 0x28c]
test eax, eax
mov ebx, dword [ebp - 0x2a0]
mov edi, dword [ebp - 0x288]
cmovne ebx, eax
mov eax, dword [ebp - 0x29c]
mov ecx, edi
mov dword [ebp - 0x2d8], ebx
mov dword [ebp - 0x2bc], eax
mov dword [ebp - 0x2cc], ecx
test edi, edi
je 0x502a00
mov edi, eax
imul edi, edx
add edi, dword [ebp - 0x28c]
mov edi, edi
cmp word [esi + 0x70], 0
je 0x50251f
cmp word [esi + 8], 0x10
jne 0x50251f
mov ebx, edi
inc eax
add edi, edx
mov dword [ebp - 0x2bc], eax
mov dword [ebp - 0x2c8], edi
xor edi, edi
cmp dword [esi], edi
jle 0x502501
lea ecx, [ecx]
push dword [ebp - 0x290]
mov eax, dword [esi + 0x34]
call eax
shr ax, 4
add esp, 4
mov word [ebx + edi*2], ax
cmp word [ebp - 0x2dc], ax
jbe 0x5024d8
movzx ecx, ax
mov dword [ebp - 0x2dc], ecx
cmp word [ebp - 0x2e4], ax
jae 0x5024ea
movzx eax, ax
mov dword [ebp - 0x2e4], eax
inc edi
cmp edi, dword [esi]
jl 0x5024b0
mov eax, dword [ebp - 0x2bc]
mov ecx, dword [ebp - 0x2cc]
mov edx, dword [ebp - 0x298]
mov edi, dword [ebp - 0x2c8]
mov ebx, dword [ebp - 0x2d8]
dec ecx
mov dword [ebp - 0x2cc], ecx
jne 0x502480
jmp case.0x5020c3.6
mov eax, dword [ebp - 0x290]
push dword [eax]
push 1
push edx
push ebx
call fcn.00595b79
add esp, 0x10
test eax, eax
je 0x5025c1
cmp word [esi + 0x4a], 2
mov edx, dword [ebp - 0x298]
jne 0x502562
xor ecx, ecx
test edx, edx
jle 0x502562
mov edi, edi
movzx eax, byte [ecx + ebx]
mov al, byte [eax + 0x5d1f28]
mov byte [ecx + ebx], al
inc ecx
cmp ecx, edx
jl 0x502550
push dword [ebp - 0x2a4]
push esi
push edx
push 1
push dword [ebp - 0x2b8]
push dword [ebp - 0x2b4]
push dword [ebp - 0x2bc]
push dword [ebp - 0x2c0]
push dword [ebp - 0x2a0]
push dword [ebp - 0x28c]
call fcn.004fd130
mov edx, dword [ebp - 0x298]
add esp, 0x28
mov ecx, dword [ebp - 0x2cc]
movzx eax, ax
mov dword [ebp - 0x294], eax
mov eax, dword [ebp - 0x2bc]
inc eax
add edi, edx
mov dword [ebp - 0x2bc], eax
jmp 0x50250d
mov dword [ebp - 0x294], 4
jmp case.0x5020c3.6
mov edx, dword [ebp - 0x2ac]
test edx, edx
jne 0x502620
mov ebx, dword [ebp - 0x290]
lea eax, [ebp - 0x2e0]
push dword [ebx]
push 1
push 2
push eax
call fcn.00595b79
mov ax, word [ebp - 0x2e0]
add esp, 0x10
test al, al
jne 0x50260f
cmp ah, 1
jne 0x50260f
mov dword [esi + 0x9c], 1
push 0xfffffffffffffffe
push ebx
call fcn.0045d3f0
mov edx, dword [ebp - 0x2ac]
add esp, 8
mov ecx, dword [ebp - 0x28c]
test ecx, ecx
mov ebx, dword [ebp - 0x2a0]
mov eax, ebx
cmovne eax, ecx
cmp dword [esi + 0x9c], 0
mov ecx, dword [ebp - 0x2a8]
je 0x50266e
test ecx, ecx
je 0x50265a
mov ecx, dword [ecx + edx*4]
push esi
push ecx
push edi
push eax
push dword [ebp - 0x290]
call fcn.00548740
jmp 0x502689
push esi
or ecx, 0xffffffff
push ecx
push edi
push eax
push dword [ebp - 0x290]
call fcn.00548740
jmp 0x502689
test ecx, ecx
je 0x502677
mov ecx, dword [ecx + edx*4]
jmp 0x50267a
or ecx, 0xffffffff
push esi
push ecx
push edi
push eax
push dword [ebp - 0x290]
call fcn.005483c0
movzx eax, ax
add esp, 0x14
mov dword [ebp - 0x294], eax
test ax, ax
jne case.0x5020c3.6
cmp word [esi + 0x48], 6
jne 0x502924
movsx eax, word [esi + 8]
mov edi, dword [ebp - 0x288]
push eax
push edi
push dword [esi]
lea eax, [esi + 0x72]
push eax
lea eax, [esi + 0x7c]
push eax
push ebx
mov ebx, dword [ebp - 0x28c]
push ebx
call fcn.00500380
push edi
push dword [ebp - 0x29c]
push dword [ebp - 0x2c0]
push dword [ebp - 0x2a4]
call fcn.004585b0
movzx eax, ax
add esp, 0x2c
mov dword [ebp - 0x294], eax
jmp 0x5021a1
cmp ecx, 6
jne 0x502738
mov ebx, dword [ebp - 0x28c]
xor eax, eax
cmp word [esi + 0x4a], 2
sete al
push eax
push edi
push ebx
push dword [ebp - 0x290]
call fcn.00501770
movzx eax, ax
add esp, 0x10
mov dword [ebp - 0x294], eax
test ax, ax
jne 0x50219b
mov ebx, dword [ebp - 0x2a0]
jmp 0x5026a9
mov eax, dword [ebp - 0x28c]
test eax, eax
mov ecx, dword [ebp - 0x2a0]
mov edi, dword [ebp - 0x29c]
cmovne ecx, eax
xor ebx, ebx
mov dword [ebp - 0x2bc], edi
mov dword [ebp - 0x2c8], ecx
mov dword [ebp - 0x2cc], ebx
cmp dword [ebp - 0x288], ebx
jle case.0x5020c3.6
nop
xor eax, eax
cmp word [esi + 0x4a], 2
sete al
push eax
push edx
push ecx
push dword [ebp - 0x290]
call fcn.00501770
movzx eax, ax
add esp, 0x10
mov dword [ebp - 0x294], eax
test ax, ax
jne case.0x5020c3.6
movzx eax, word [esi + 8]
cmp ax, 0x10
jne 0x5027e5
xor edi, edi
cmp dword [ebp - 0x2d0], edi
jle 0x502826
mov ebx, dword [ebp - 0x2a0]
jmp 0x5027c0
mov eax, dword [ebp - 0x28c]
movzx eax, word [eax + edi*2]
push eax
mov eax, dword [esi + 0x3c]
call eax
shr ax, 8
add esp, 4
mov byte [ebx + edi], al
inc edi
cmp edi, dword [ebp - 0x2d0]
jl 0x5027c0
jmp 0x502820
cmp ax, 0x20
jne 0x50282c
xor edi, edi
cmp dword [ebp - 0x2d0], edi
jle 0x502826
mov ebx, dword [ebp - 0x2a0]
jmp 0x502800
mov eax, dword [ebp - 0x28c]
push dword [eax + edi*4]
mov eax, dword [esi + 0x40]
call eax
shr eax, 0x18
add esp, 4
mov byte [ebx + edi], al
inc edi
cmp edi, dword [ebp - 0x2d0]
jl 0x502800
mov ebx, dword [ebp - 0x2cc]
mov edi, dword [ebp - 0x2bc]
cmp dword [esi + 0x28], 0
jle 0x502861
cmp dword [esi + 0x2c], 0
jle 0x502861
push dword [ebp - 0x2b8]
mov eax, dword [ebp - 0x29c]
push dword [ebp - 0x2b4]
add eax, ebx
push 1
push eax
push 0xffffffffffffffff
push dword [ebp - 0x2a4]
call fcn.00458910
add esp, 0x18
jmp 0x502891
push 1
push edi
push dword [ebp - 0x2c0]
push dword [ebp - 0x2a4]
call fcn.004585b0
movzx eax, ax
inc edi
add esp, 0x10
mov dword [ebp - 0x294], eax
mov dword [ebp - 0x2bc], edi
test ax, ax
jne case.0x5020c3.6
mov ecx, dword [ebp - 0x2c8]
inc ebx
mov edx, dword [ebp - 0x298]
mov dword [ebp - 0x2cc], ebx
cmp ebx, dword [ebp - 0x288]
jl 0x502770
jmp case.0x5020c3.6
cmp eax, 0x8774
jg 0x5029ce
je 0x502990
cmp eax, 0x8029
je 0x502969
cmp eax, 0x80b2
jne case.0x5020c3.6
push dword [ebp - 0x2a4]
mov ebx, dword [ebp - 0x2a0]
lea eax, [ebp - 0x320]
push esi
push dword [ebp - 0x28c]
push ebx
push edi
push dword [ebp - 0x288]
push dword [ebp - 0x29c]
push eax
push dword [ebp - 0x290]
call fcn.00548f80
movzx eax, ax
add esp, 0x24
mov dword [ebp - 0x294], eax
test ax, ax
jne case.0x5020c3.6
push dword [ebp - 0x2a4]
push esi
push edi
mov edi, dword [ebp - 0x288]
push edi
push dword [ebp - 0x2b8]
push dword [ebp - 0x2b4]
push dword [ebp - 0x29c]
push dword [ebp - 0x2c0]
push ebx
mov ebx, dword [ebp - 0x28c]
push ebx
call fcn.004fd130
movzx eax, ax
add esp, 0x28
mov dword [ebp - 0x294], eax
jmp 0x5021a1
push dword [ebp - 0x2a4]
push esi
push dword [ebp - 0x2a0]
push ebx
push dword [ebp - 0x29c]
push dword [ebp - 0x290]
call fcn.00549c10
add esp, 0x18
jmp 0x50218c
push dword [ebp - 0x2a4]
mov eax, 0x804c
push esi
push dword [ebp - 0x2a0]
push ebx
push dword [ebp - 0x29c]
push dword [ebp - 0x290]
cmp cx, ax
jne 0x5029c1
call fcn.005490a0
add esp, 0x18
jmp 0x50218c
call fcn.00549310
add esp, 0x18
jmp 0x50218c
cmp eax, 0x8775
jne case.0x5020c3.6
push dword [ebp - 0x2a4]
push esi
push dword [ebp - 0x2a0]
push ebx
push dword [ebp - 0x29c]
push dword [ebp - 0x290]
call fcn.00549220
add esp, 0x18
jmp 0x50218c
mov ebx, dword [ebp - 0x28c]
jmp 0x5021a1
mov edx, dword [ebp - 0x29c]
add edx, edi
mov dword [ebp - 0x29c], edx
mov ecx, dword [ebp - 0x2ac]
mov edi, dword [ebp - 0x2d4]
inc ecx
mov dword [ebp - 0x2ac], ecx
cmp ecx, dword [ebp - 0x2b0]
jl 0x501e10
cmp word [esi + 0x70], 0
je 0x502ade
cmp word [esi + 8], 0x10
jne 0x502ade
mov edi, ebx
xor ebx, ebx
mov dword [ebp - 0x2c8], ebx
cmp dword [esi + 4], ebx
jle 0x502ade
xor ecx, ecx
cmp dword [esi], ecx
jle 0x502aad
mov eax, dword [ebp - 0x2dc]
movzx edx, ax
mov eax, dword [ebp - 0x2e4]
movzx ebx, ax
mov dword [ebp - 0x2d8], edx
sub ebx, edx
movzx eax, word [edi]
add edi, 2
sub eax, edx
xor edx, edx
imul eax, eax, 0xff
div ebx
mov edx, dword [ebp - 0x2a0]
mov byte [edx + ecx], al
inc ecx
mov edx, dword [ebp - 0x2d8]
cmp ecx, dword [esi]
jl 0x502a81
mov ebx, dword [ebp - 0x2c8]
push 1
push ebx
push dword [ebp - 0x2c0]
push dword [ebp - 0x2a4]
call fcn.004585b0
movzx eax, ax
add esp, 0x10
mov dword [ebp - 0x294], eax
test ax, ax
jne 0x502ade
inc ebx
mov dword [ebp - 0x2c8], ebx
cmp ebx, dword [esi + 4]
jl 0x502a61
mov eax, dword [ebp - 0x28c]
test eax, eax
je 0x502af1
push eax
call fcn.00592c4b
add esp, 4
push dword [ebp - 0x2c4]
call fcn.00592c4b
mov eax, dword [ebp - 0x2a8]
add esp, 4
test eax, eax
je 0x502b12
push eax
call fcn.00592c4b
add esp, 4
movzx eax, word [esi + 0x44]
cmp eax, 5
jne 0x502b23
push esi
call fcn.00548a90
jmp 0x502b8b
cmp eax, 2
je 0x502b85
cmp eax, 3
je 0x502b85
cmp eax, 4
je 0x502b85
cmp eax, 7
jne 0x502b45
lea eax, [ebp - 0x284]
push eax
call fcn.00548b90
jmp 0x502b8b
cmp ax, word [ebp - 0x2e8]
jne 0x502b68
mov eax, 0x804c
push esi
cmp word [esi + 0x48], ax
jne 0x502b61
call fcn.00549200
jmp 0x502b8b
call fcn.00549440
jmp 0x502b8b
mov ecx, 0x80b2
cmp ax, cx
je 0x502b77
cmp eax, 8
jne 0x502b8e
lea eax, [ebp - 0x320]
push eax
call fcn.004d9180
jmp 0x502b8b
push esi
call fcn.00531850
add esp, 4
mov ecx, dword [ebp - 4]
mov ax, word [ebp - 0x294]
xor ecx, ebp
pop edi
pop esi
pop ebx
call fcn.005920c1
mov esp, ebp
pop ebp
ret