Function at 0x517460
Capabilities:
Encode data using xor
Encrypt data using speck
Resolve function by parsing pe exports

Disassembly:
sub esp, 0x18
mov ecx, dword [esp + 0x30]
push ebx
mov ebx, dword [esp + 0x20]
push ebp
mov ebp, dword [esp + 0x28]
push esi
lea esi, [ebx + 8]
push edi
mov eax, dword [ebp]
mov edi, 1
mov dword [esp + 0x10], eax
test ecx, ecx
je 0x517492
mov eax, dword [ebx + 0x108]
mov dword [ecx], eax
mov eax, dword [esp + 0x10]
cmp dword [ebx + 0x5c], 0
jge 0x5174a2
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x18
ret
mov ecx, dword [esp + 0x38]
cmp dword [ecx], 0
je 0x5174cf
mov edx, dword [esp + 0x3c]
test edx, edx
je 0x5174b8
cmp dword [edx], 0
jne 0x5174d7
sub eax, dword [ebp]
push eax
push 0xffffffffffffffec
push ebx
call fcn.0051c990
add esp, 0xc
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x18
ret
mov dword [esp + 0x3c], 0
mov ecx, dword [ebx + 0x30]
test ecx, ecx
jne 0x51752b
mov eax, dword [esp + 0x34]
mov edx, dword [ebp]
mov ecx, dword [eax]
mov eax, ecx
mov dword [esi + 8], ecx
test edx, edx
je 0x5174f3
lea eax, [ecx + edx]
mov dword [esi + 0x10], eax
lea eax, [edx + 1]
cmp eax, 0x1c
jbe 0x517517
lea eax, [edx - 0x1b]
mov edx, 1
add eax, ecx
mov dword [esi + 0xc], eax
lea eax, [ebx + 0x254]
mov dword [esp + 0x24], eax
jmp case.default.0x517682
lea eax, [ebx + 0x254]
mov dword [esi + 0xc], ecx
mov dword [esp + 0x24], eax
mov edx, 1
jmp case.default.0x517682
lea edx, [ebx + 0x28]
mov edi, 2
mov dword [esi + 8], edx
mov eax, edx
test ecx, ecx
je 0x51753f
lea eax, [edx + ecx]
mov dword [esi + 0x10], eax
lea eax, [ecx + 1]
cmp eax, 0x1c
jbe 0x517563
lea eax, [ecx - 0x1b]
add eax, edx
mov edx, 1
mov dword [esi + 0xc], eax
lea eax, [ebx + 0x254]
mov dword [esp + 0x24], eax
jmp case.default.0x517682
lea eax, [ebx + 0x254]
mov dword [esi + 0xc], edx
mov dword [esp + 0x24], eax
mov edx, 1
jmp case.default.0x517682
mov edx, 1
nop dword [eax]
mov ebp, dword [esp + 0x30]
cmp edi, 1
je 0x517677
cmp edi, 2
jne 0x518159
cmp dword [ebx + 0x64], 0
je 0x5175bb
push 1
push dword [esp + 0x44]
push dword [esp + 0x44]
push dword [esp + 0x44]
push ebx
call fcn.0051cb50
add esp, 0x14
test eax, eax
js 0x51812c
mov ecx, dword [ebx + 0x30]
mov eax, dword [esi + 8]
test ecx, ecx
je 0x518130
cmp eax, dword [esi + 0x10]
jne 0x517613
mov eax, dword [esp + 0x34]
mov edi, 1
mov dword [ebx + 0x30], 0
mov edx, dword [ebp]
mov ecx, dword [eax]
mov eax, ecx
mov dword [esi + 8], ecx
test edx, edx
je 0x5175ef
lea eax, [ecx + edx]
mov dword [esi + 0x10], eax
lea eax, [edx + 1]
cmp eax, 0x1c
jbe 0x517609
lea eax, [ecx - 0x1b]
add eax, edx
mov edx, edi
mov dword [esi + 0xc], eax
jmp case.default.0x517682
mov dword [esi + 0xc], ecx
mov edx, edi
jmp case.default.0x517682
cmp dword [ebp], 0
je 0x518112
mov eax, dword [esp + 0x34]
mov edi, 1
mov eax, dword [eax]
mov al, byte [eax]
mov byte [ecx + ebx + 0x28], al
lea ecx, [ebx + 0x28]
add dword [ebx + 0x30], edi
mov eax, ecx
mov edx, dword [ebx + 0x30]
mov dword [esi + 8], ecx
je 0x517641
lea eax, [ecx + edx]
mov dword [esi + 0x10], eax
lea eax, [edx + 1]
cmp eax, 0x1c
jbe 0x517664
lea eax, [edx - 0x1b]
mov edx, edi
add eax, ecx
mov dword [esi + 0xc], eax
mov eax, dword [esp + 0x34]
inc dword [eax]
dec dword [ebp]
jmp case.default.0x517682
mov eax, dword [esp + 0x34]
mov edx, edi
mov dword [esi + 0xc], ecx
inc dword [eax]
dec dword [ebp]
jmp case.default.0x517682
mov eax, dword [ebx]
cmp eax, 0x1a
ja case.default.0x517682
jmp dword [eax*4 + 0x5181f0]
push esi
call fcn.0051cd90
add esp, 4
test eax, eax
jne 0x5176a3
mov edi, 2
lea edx, [edi - 1]
jmp case.default.0x517682
push esi
push ebx
call fcn.00519680
mov edi, eax
add esp, 8
mov edx, 1
cmp edi, 1
jne 0x51758d
mov cl, byte [ebx + 0x24c]
and cl, 0x20
movzx ecx, cl
neg ecx
sbb ecx, ecx
add ecx, 2
mov dword [ebx], ecx
jmp case.default.0x517682
cmp dword [esi + 4], 6
jae 0x517707
mov edi, dword [esi + 0x10]
mov edx, dword [esi + 8]
cmp edx, edi
je 0x517696
movzx eax, byte [edx]
mov ecx, dword [esi + 4]
shl eax, cl
add ecx, 8
or dword [esi], eax
lea eax, [edx + 1]
mov dword [esi + 4], ecx
mov dword [esi + 8], eax
cmp ecx, 6
jb 0x5176e0
mov edx, 1
mov eax, dword [esi]
mov ecx, eax
and ecx, dword [0x576988]
add dword [esi + 4], 0xfffffffa
shr eax, 6
mov dword [esi], eax
shl ecx, 6
xor ecx, dword [ebx + 0x24c]
and ecx, 0xfc0
xor dword [ebx + 0x24c], ecx
mov eax, dword [ebx + 0x24c]
shr eax, 6
and eax, 0x3f
cmp eax, 0xa
jb 0x517786
cmp eax, 0x1e
ja 0x517786
mov dword [ebx], 2
mov ecx, dword [ebx + 0x24c]
mov eax, edx
shr ecx, 6
and ecx, 0x3f
shl eax, cl
sub eax, 0x10
push 0x3030
push dword [ebx + 0x24]
mov dword [ebx + 0x38], eax
mov eax, dword [ebx + 0x1c]
call eax
add esp, 8
mov dword [ebx + 0xac], eax
test eax, eax
jne 0x517790
lea edi, [eax - 0x1e]
lea edx, [eax + 1]
jmp case.default.0x517682
mov edi, 0xfffffff3
jmp case.default.0x517682
add eax, 0x1da0
mov dword [ebx], 3
mov dword [ebx + 0xb0], eax
push ebx
call fcn.0051d8f0
add esp, 4
mov dword [ebx], 4
push esi
push ebx
call fcn.00519090
mov edi, eax
add esp, 8
mov edx, 1
cmp edi, 1
jne 0x51758d
test byte [ebx + 0x24c], 6
je 0x517818
mov edx, dword [esi + 4]
mov ebp, 0
mov ecx, edx
and ecx, 7
je 0x5177f6
mov ebp, dword [ecx*4 + 0x576970]
sub edx, ecx
mov eax, dword [esi]
and ebp, eax
shr eax, cl
mov dword [esi + 4], edx
mov dword [esi], eax
mov ecx, dword [esi + 4]
mov edx, 1
cmp ecx, 0x20
jae 0x51780a
mov eax, edx
shl eax, cl
dec eax
and dword [esi], eax
test ebp, ebp
je 0x517818
mov edi, 0xfffffff2
jmp 0x517580
test byte [ebx + 0x24c], 4
je 0x517856
mov eax, dword [ebx + 0x220]
mov edx, 1
mov ebp, dword [esp + 0x30]
mov dword [ebx], 0xc
test eax, eax
je case.default.0x517682
push dword [ebx + 0x60]
push dword [ebx + 0x228]
call eax
add esp, 8
mov edx, 1
jmp case.default.0x517682
cmp dword [ebx + 0x60], 0
jne 0x517867
mov dword [ebx], 0xe
jmp 0x517577
push ebx
call fcn.00517370
add esp, 4
mov edx, 1
test byte [ebx + 0x24c], 2
je 0x517889
mov dword [ebx], 0xb
jmp 0x517580
mov dword [ebx], 0x11
mov dword [ebx + 4], 0
lea eax, [ebx + 0x34c]
mov dword [ebx + 0x290], 0
mov dword [ebx + 0x328], eax
mov dword [ebx + 0x28c], 0
mov dword [ebx + 0x284], 0
mov dword [ebx + 0x288], 0
mov dword [ebx], 0x12
mov eax, dword [ebx + 4]
cmp eax, 3
jl 0x5178e3
mov dword [ebx], 5
jmp 0x517580
add eax, 0x33
lea eax, [ebx + eax*4]
push eax
push esi
push ebx
call fcn.00519500
mov ebp, dword [esp + 0x3c]
mov edi, eax
add esp, 0xc
mov edx, 1
cmp edi, 1
jne 0x51758d
mov eax, dword [ebx + 4]
inc dword [ebx + eax*4 + 0xcc]
mov eax, dword [ebx + 4]
cmp dword [ebx + eax*4 + 0xcc], 2
jae 0x517928
inc eax
mov dword [ebx + 4], eax
jmp case.default.0x517682
mov dword [ebx], 0x13
mov eax, dword [ebx + 4]
imul ecx, eax, 0x278
push ebx
push 0
mov edx, dword [ebx + eax*4 + 0xcc]
mov eax, dword [ebx + 0xac]
add edx, 2
lea eax, [eax + ecx*4]
push eax
push edx
push edx
call fcn.0051ab10
mov ebp, dword [esp + 0x44]
mov edi, eax
add esp, 0x14
mov edx, 1
cmp edi, 1
jne 0x51758d
mov dword [ebx], 0x14
imul ecx, dword [ebx + 4], 0x18c
mov eax, dword [ebx + 0xb0]
push ebx
push 0
lea eax, [eax + ecx*4]
push eax
push 0x1a
push 0x1a
call fcn.0051ab10
mov ebp, dword [esp + 0x44]
mov edi, eax
add esp, 0x14
mov edx, 1
cmp edi, 1
jne 0x51758d
mov dword [ebx], 0x15
mov eax, dword [ebx + 4]
imul ecx, eax, 0x630
add eax, 0x2f
lea eax, [ebx + eax*4]
add ecx, dword [ebx + 0xb0]
cmp dword [ebx + 0x244], 0
mov dword [esp + 0x18], ecx
mov dword [esp + 0x20], eax
jne 0x517a73
cmp dword [esi + 4], 0xf
jae 0x517a06
mov ebp, dword [esi + 0x10]
nop
mov edx, dword [esi + 8]
cmp edx, ebp
je 0x517a53
movzx eax, byte [edx]
mov ecx, dword [esi + 4]
shl eax, cl
add ecx, 8
or dword [esi], eax
lea eax, [edx + 1]
mov dword [esi + 4], ecx
mov dword [esi + 8], eax
cmp ecx, 0xf
jb 0x5179e0
mov ecx, dword [esp + 0x18]
mov ebp, dword [esi]
mov eax, ebp
and eax, dword [0x5769ac]
mov dword [esp + 0x18], eax
movzx eax, al
lea edx, [ecx + eax*4]
mov al, byte [edx]
cmp al, 8
jbe 0x517a45
add dword [esi + 4], 0xfffffff8
movzx ecx, al
mov eax, dword [esp + 0x18]
shr ebp, 8
mov dword [esi], ebp
mov ecx, dword [ecx*4 + 0x576950]
shr eax, 8
and ecx, eax
movzx eax, word [edx + 2]
add ecx, eax
lea edx, [edx + ecx*4]
movzx ecx, byte [edx]
sub dword [esi + 4], ecx
shr dword [esi], cl
movzx eax, word [edx + 2]
jmp 0x517a79
lea eax, [esp + 0x14]
push eax
push esi
push dword [esp + 0x20]
call fcn.0051ba40
add esp, 0xc
test eax, eax
je 0x517b0f
mov eax, dword [esp + 0x14]
jmp 0x517a7d
mov eax, dword [ebx + 0xc8]
mov dword [esp + 0x14], eax
movzx ecx, byte [eax*4 + 0x57d9ea]
movzx eax, word [eax*4 + 0x57d9e8]
mov dword [esp + 0x18], ecx
mov dword [esp + 0x1c], eax
cmp dword [esi + 4], ecx
jae 0x517ac7
mov ebp, dword [esi + 0x10]
nop dword [eax]
mov edx, dword [esi + 8]
cmp edx, ebp
je 0x517afb
movzx eax, byte [edx]
mov ecx, dword [esi + 4]
shl eax, cl
add ecx, 8
or dword [esi], eax
lea eax, [edx + 1]
mov dword [esi + 4], ecx
mov dword [esi + 8], eax
cmp ecx, dword [esp + 0x18]
jb 0x517aa0
mov ecx, dword [esp + 0x18]
mov eax, dword [ecx*4 + 0x576970]
mov edx, dword [esi]
and eax, edx
sub dword [esi + 4], ecx
add eax, dword [esp + 0x1c]
shr edx, cl
mov ecx, dword [esp + 0x20]
mov dword [esi], edx
mov dword [ecx], eax
inc dword [ebx + 4]
mov dword [ebx + 0x244], 0
mov dword [ebx], 0x12
jmp 0x517577
mov eax, dword [esp + 0x14]
mov dword [ebx + 0xc8], eax
mov dword [ebx + 0x244], 1
mov edi, 2
jmp 0x517577
push ebx
push dword [esp + 0x44]
push dword [esp + 0x44]
push dword [esp + 0x44]
call fcn.005184e0
add esp, 0x10
mov edi, eax
mov edx, 1
cmp edi, 1
jne 0x51758d
mov dword [ebx], 0xe
jmp case.default.0x517682
push ebx
call fcn.0051c9f0
add esp, 4
jmp 0x517b2e
cmp dword [esi + 4], 6
jae 0x517b86
mov edi, dword [esi + 0x10]
nop dword [eax]
mov edx, dword [esi + 8]
cmp edx, edi
je 0x517696
movzx eax, byte [edx]
mov ecx, dword [esi + 4]
shl eax, cl
add ecx, 8
or dword [esi], eax
lea eax, [edx + 1]
mov dword [esi + 4], ecx
mov dword [esi + 8], eax
cmp ecx, 6
jb 0x517b60
mov eax, dword [esi]
mov edx, eax
and edx, dword [0x576988]
add dword [esi + 4], 0xfffffffa
shr eax, 6
mov dword [esi], eax
mov eax, dword [0x576978]
and eax, edx
shr edx, 2
mov ecx, eax
mov dword [ebx + 0xf0], eax
mov eax, dword [ebx + 0x1c]
shl edx, cl
mov dword [ebx + 0xf4], edx
push dword [ebx + 0xcc]
push dword [ebx + 0x24]
call eax
add esp, 8
mov dword [ebx + 0x258], eax
test eax, eax
jne 0x517bd9
lea edi, [eax - 0x15]
lea edx, [eax + 1]
jmp case.default.0x517682
mov dword [ebx + 4], 0
mov dword [ebx], 6
push ebx
call fcn.0051aa90
mov edi, eax
add esp, 4
mov edx, 1
cmp edi, 1
jne 0x51758d
mov dword [ebx], 0x16
push ebx
lea eax, [ebx + 0x254]
push eax
lea eax, [ebx + 0x250]
push eax
mov eax, dword [ebx + 0xcc]
shl eax, 6
push eax
call fcn.00518830
mov edi, eax
add esp, 0x10
mov edx, 1
cmp edi, 1
jne 0x51758d
xorps xmm0, xmm0
xor ebp, ebp
movups xmmword [ebx + 0x264], xmm0
mov dword [esp + 0x18], ebp
movups xmmword [ebx + 0x274], xmm0
cmp dword [ebx + 0xcc], ebp
jbe 0x517cd3
mov edx, dword [esp + 0x24]
mov ecx, ebp
shl ecx, 6
xor esi, esi
xor ebp, ebp
mov eax, dword [edx]
movzx edi, byte [ecx + eax]
lea ebx, [ecx + eax]
lea edx, [ebx + 2]
nop
movzx ecx, byte [ebx + ebp]
lea edx, [edx + 4]
movzx eax, byte [edx - 5]
xor ecx, edi
xor eax, edi
add ebp, 4
or ecx, eax
movzx eax, byte [edx - 3]
xor eax, edi
or ecx, eax
movzx eax, byte [edx - 4]
xor eax, edi
or ecx, eax
or esi, ecx
cmp ebp, 0x40
jb 0x517c70
mov ebx, dword [esp + 0x2c]
mov ebp, dword [esp + 0x18]
test esi, esi
jne 0x517cc3
mov eax, ebp
mov ecx, ebp
shr eax, 5
and ecx, 0x1f
lea edx, [ebx + eax*4]
mov eax, dword [edx + 0x264]
bts eax, ecx
mov dword [edx + 0x264], eax
inc ebp
mov dword [esp + 0x18], ebp
cmp ebp, dword [ebx + 0xcc]
jb 0x517c55
lea esi, [ebx + 8]
mov dword [ebx], 0x17
mov edx, dword [ebx + 0xf0]
mov eax, 0x18
mov edi, dword [ebx + 0xf4]
lea ebp, [edx + 1]
mov ecx, ebp
mov dword [esp + 0x20], ebp
shl eax, cl
add eax, 0x10
add eax, edi
test byte [ebx + 0x24c], 0x20
mov dword [esp + 0x18], eax
mov ebp, eax
je 0x517d81
cmp edi, 0x7ffffffc
jb 0x517d18
mov ebp, ntohs
jmp 0x517d6d
mov ecx, edx
mov ebp, 1
shl ebp, cl
mov edx, 0x7ffffffc
mov ecx, dword [ebx + 0xf0]
sub edx, edi
shr edx, cl
xor eax, eax
add edx, 4
dec ebp
mov ecx, edx
shr ecx, 1
je 0x517d45
nop dword [eax]
inc eax
shr ecx, 1
jne 0x517d40
lea ecx, [eax - 1]
shr edx, cl
lea eax, [eax*2 - 4]
and edx, 1
or edx, eax
jne 0x517d5d
lea ebp, [edi + 0x10]
jmp 0x517d6d
mov ecx, dword [ebx + 0xf0]
dec edx
shl edx, cl
or ebp, edx
add ebp, 0x11
add ebp, edi
mov ecx, dword [esp + 0x20]
mov eax, 0x3e
shl eax, cl
add eax, 0x10
add eax, edi
mov dword [esp + 0x18], eax
push ebx
lea eax, [ebx + 0xfc]
push eax
mov eax, dword [ebx + 0xd4]
lea ecx, [ebx + 0xf8]
push ecx
shl eax, 2
push eax
call fcn.00518830
mov edi, eax
add esp, 0x10
mov edx, 1
cmp edi, 1
jne 0x517580
push dword [ebx + 0x250]
lea eax, [ebx + 0x7c]
push 0x100
push 0x100
push eax
push ebx
call fcn.0051d5a0
push dword [ebx + 0xd0]
lea ecx, [ebx + 0x8c]
mov edi, eax
push 0x2c0
push 0x2c0
push ecx
push ebx
and edi, 1
call fcn.0051d5a0
push dword [ebx + 0xf8]
and edi, eax
lea eax, [ebx + 0x9c]
push ebp
push dword [esp + 0x48]
push eax
push ebx
call fcn.0051d5a0
add esp, 0x3c
test edi, eax
je 0x5181b1
mov dword [ebx + 4], 0
mov dword [ebx], 0x18
mov eax, dword [ebx + 4]
sub eax, 0
je 0x517e46
sub eax, 1
je 0x517e3e
sub eax, 1
jne 0x5181d0
lea eax, [ebx + 0x9c]
jmp 0x517e49
lea eax, [ebx + 0x8c]
jmp 0x517e49
lea eax, [ebx + 0x7c]
push ebx
push eax
call fcn.00519830
mov ebp, dword [esp + 0x38]
mov edi, eax
add esp, 8
mov edx, 1
cmp edi, 1
jne 0x51758d
inc dword [ebx + 4]
cmp dword [ebx + 4], 3
jl case.default.0x517682
mov dword [ebx], 0x19
mov edi, dword [ebx + 0xdc]
mov edx, edi
mov eax, edi
shl edx, 6
add edx, dword [ebx + 0x254]
mov ecx, edi
shr eax, 5
and ecx, 0x1f
mov dword [ebx + 0x74], edx
push ebx
mov eax, dword [ebx + eax*4 + 0x264]
shr eax, cl
and eax, 1
mov dword [ebx + 0xb4], eax
movzx ecx, byte [edx]
mov eax, dword [ebx + 0x7c]
mov eax, dword [eax + ecx*4]
mov dword [ebx + 0x100], eax
mov eax, dword [ebx + 0x258]
movzx eax, byte [eax + edi]
and eax, 3
shl eax, 9
add eax, 0x57da50
mov dword [ebx + 0x70], eax
mov eax, dword [ebx + 0xfc]
mov dword [ebx + 0x78], eax
mov eax, dword [ebx + 0x8c]
mov eax, dword [eax]
mov dword [ebx + 0x6c], eax
call fcn.005182a0
add esp, 4
test eax, eax
jne 0x517efa
lea edi, [eax - 0x1b]
jmp 0x517577
push ebx
call fcn.00518330
add esp, 4
mov dword [ebx], 7
push ebx
call fcn.00519cf0
mov ebp, dword [esp + 0x34]
mov edi, eax
add esp, 4
mov edx, 1
cmp edi, 2
jne case.default.0x517682
push ebx
call fcn.0051bae0
add esp, 4
mov edi, eax
mov edx, 1
jmp case.default.0x517682
push 0
push dword [esp + 0x44]
push dword [esp + 0x44]
push dword [esp + 0x44]
push ebx
call fcn.0051cb50
mov edi, eax
add esp, 0x14
mov edx, 1
cmp edi, 1
jne 0x51758d
push ebx
call fcn.0051cb20
mov ecx, dword [ebx + 0x24c]
mov edx, 1
shr ecx, 6
mov eax, edx
and ecx, 0x3f
add esp, 4
shl eax, cl
cmp dword [ebx + 0x40], eax
jne 0x517f8b
mov eax, dword [ebx + 0x38]
mov dword [ebx + 0x3c], eax
mov eax, dword [ebx]
cmp eax, 0xf
jne 0x517fdc
mov ecx, dword [ebx + 0x260]
test ecx, ecx
je 0x517fc4
mov eax, dword [ecx + 0x10]
cmp eax, dword [ecx + 0x14]
je 0x517fc4
push dword [ebx + 0x34]
push ebx
call fcn.00518430
add dword [ebx + 0x34], eax
add esp, 8
mov eax, dword [ebx + 0x34]
mov edx, 1
cmp eax, dword [ebx + 0x40]
jge case.default.0x517682
cmp dword [ebx + 0x60], 0
mov eax, 7
mov ecx, 0xe
cmove eax, ecx
mov dword [ebx], eax
jmp case.default.0x517682
cmp eax, 0x10
jne 0x517fec
mov dword [ebx], 0xa
jmp case.default.0x517682
cmp dword [ebx + 4], 0
jne 0x51800a
cmp dword [ebx + 0x60], 0
mov eax, 9
mov ecx, 0xe
cmove eax, ecx
mov dword [ebx], eax
jmp case.default.0x517682
mov dword [ebx], 8
jmp case.default.0x517682
cmp dword [ebx + 0x60], 0
jge 0x518025
mov edi, 0xfffffff6
jmp case.default.0x517682
push ebx
call fcn.0051d670
add esp, 4
test byte [ebx + 0x24c], 1
jne 0x518047
mov dword [ebx], 3
mov edx, 1
jmp case.default.0x517682
mov edx, dword [esi + 4]
mov ebp, 0
mov ecx, edx
and ecx, 7
je 0x51806a
mov ebp, dword [ecx*4 + 0x576970]
sub edx, ecx
mov eax, dword [esi]
and ebp, eax
shr eax, cl
mov dword [esi + 4], edx
mov dword [esi], eax
mov ecx, dword [esi + 4]
mov edx, 1
cmp ecx, 0x20
jae 0x51807e
mov eax, edx
shl eax, cl
dec eax
and dword [esi], eax
test ebp, ebp
je 0x51808c
mov edi, 0xfffffff1
jmp 0x517580
cmp dword [ebx + 0x30], 0
jne 0x5180da
mov edx, dword [esi + 8]
shr ecx, 3
lea eax, [ecx*8]
test ecx, ecx
je 0x5180a5
sub edx, ecx
sub dword [esi + 4], eax
mov ecx, dword [esi + 4]
mov dword [esi + 8], edx
cmp ecx, 0x20
jae 0x5180bd
mov eax, 1
shl eax, cl
dec eax
and dword [esi], eax
mov eax, dword [esi + 0x10]
mov ebp, dword [esp + 0x30]
sub eax, edx
mov ecx, dword [esp + 0x34]
mov dword [ebp], eax
mov eax, dword [esi + 8]
mov dword [ecx], eax
mov dword [ebx], 0x1a
jmp 0x5180ea
mov ebp, dword [esp + 0x30]
mov dword [ebx], 0x1a
jmp 0x5180ea
mov ebp, dword [esp + 0x30]
cmp dword [ebx + 0x64], 0
je 0x518112
push 1
push dword [esp + 0x44]
push dword [esp + 0x44]
push dword [esp + 0x44]
push ebx
call fcn.0051cb50
mov edi, eax
add esp, 0x14
cmp edi, 1
jne 0x517577
mov eax, dword [esp + 0x10]
sub eax, dword [ebp]
push eax
push edi
push ebx
call fcn.0051c990
add esp, 0xc
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x18
ret
mov edi, eax
jmp 0x518112
mov edx, dword [esp + 0x34]
mov dword [edx], eax
mov eax, dword [esi + 0x10]
sub eax, dword [esi + 8]
mov dword [ebp], eax
je 0x518112
mov eax, dword [edx]
mov ecx, dword [ebx + 0x30]
mov al, byte [eax]
mov byte [ecx + ebx + 0x28], al
inc dword [ebx + 0x30]
inc dword [edx]
add dword [ebp], 0xffffffff
jne 0x518141
jmp 0x518112
cmp dword [ebx + 0x30], 0
je 0x518168
mov dword [ebx + 0x30], 0
jmp 0x518112
mov ecx, dword [esi + 4]
mov eax, ecx
mov edx, dword [esi + 8]
shr eax, 3
lea ebp, [eax*8]
test eax, eax
je 0x518180
sub edx, eax
sub ecx, ebp
mov dword [esi + 8], edx
mov dword [esi + 4], ecx
cmp ecx, 0x20
jae 0x518197
mov eax, 1
shl eax, cl
dec eax
and dword [esi], eax
mov eax, dword [esi + 0x10]
mov ebp, dword [esp + 0x30]
sub eax, edx
mov ecx, dword [esp + 0x34]
mov dword [ebp], eax
mov eax, dword [esi + 8]
mov dword [ecx], eax
jmp 0x518112
mov ebp, dword [esp + 0x30]
mov eax, dword [esp + 0x10]
sub eax, dword [ebp]
push eax
push 0xffffffffffffffea
push ebx
call fcn.0051c990
add esp, 0xc
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x18
ret
mov ebp, dword [esp + 0x30]
mov eax, dword [esp + 0x10]
sub eax, dword [ebp]
push eax
push 0xffffffffffffffe1
push ebx
call fcn.0051c990
add esp, 0xc
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x18
ret