Function at 0x5133c9
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 0x5131d2
mov eax, dword [ebx + 0x108]
mov dword [ecx], eax
mov eax, dword [esp + 0x10]
cmp dword [ebx + 0x5c], 0
jge 0x5131e2
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 0x51320f
mov edx, dword [esp + 0x3c]
test edx, edx
je 0x5131f8
cmp dword [edx], 0
jne 0x513217
sub eax, dword [ebp]
push eax
push 0xffffffffffffffec
push ebx
call fcn.005186d0
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 0x51326b
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 0x513233
lea eax, [ecx + edx]
mov dword [esi + 0x10], eax
lea eax, [edx + 1]
cmp eax, 0x1c
jbe 0x513257
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.0x5133c2
lea eax, [ebx + 0x254]
mov dword [esi + 0xc], ecx
mov dword [esp + 0x24], eax
mov edx, 1
jmp case.default.0x5133c2
lea edx, [ebx + 0x28]
mov edi, 2
mov dword [esi + 8], edx
mov eax, edx
test ecx, ecx
je 0x51327f
lea eax, [edx + ecx]
mov dword [esi + 0x10], eax
lea eax, [ecx + 1]
cmp eax, 0x1c
jbe 0x5132a3
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.0x5133c2
lea eax, [ebx + 0x254]
mov dword [esi + 0xc], edx
mov dword [esp + 0x24], eax
mov edx, 1
jmp case.default.0x5133c2
mov edx, 1
nop dword [eax]
mov ebp, dword [esp + 0x30]
cmp edi, 1
je 0x5133b7
cmp edi, 2
jne 0x513e99
cmp dword [ebx + 0x64], 0
je 0x5132fb
push 1
push dword [esp + 0x44]
push dword [esp + 0x44]
push dword [esp + 0x44]
push ebx
call fcn.00518890
add esp, 0x14
test eax, eax
js 0x513e6c
mov ecx, dword [ebx + 0x30]
mov eax, dword [esi + 8]
test ecx, ecx
je 0x513e70
cmp eax, dword [esi + 0x10]
jne 0x513353
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 0x51332f
lea eax, [ecx + edx]
mov dword [esi + 0x10], eax
lea eax, [edx + 1]
cmp eax, 0x1c
jbe 0x513349
lea eax, [ecx - 0x1b]
add eax, edx
mov edx, edi
mov dword [esi + 0xc], eax
jmp case.default.0x5133c2
mov dword [esi + 0xc], ecx
mov edx, edi
jmp case.default.0x5133c2
cmp dword [ebp], 0
je 0x513e52
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 0x513381
lea eax, [ecx + edx]
mov dword [esi + 0x10], eax
lea eax, [edx + 1]
cmp eax, 0x1c
jbe 0x5133a4
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.0x5133c2
mov eax, dword [esp + 0x34]
mov edx, edi
mov dword [esi + 0xc], ecx
inc dword [eax]
dec dword [ebp]
jmp case.default.0x5133c2
mov eax, dword [ebx]
cmp eax, 0x1a
ja case.default.0x5133c2
jmp dword [eax*4 + 0x513f30]
push esi
call fcn.00518ad0
add esp, 4
test eax, eax
jne 0x5133e3
mov edi, 2
lea edx, [edi - 1]
jmp case.default.0x5133c2
push esi
push ebx
call fcn.005153c0
mov edi, eax
add esp, 8
mov edx, 1
cmp edi, 1
jne 0x5132cd
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.0x5133c2
cmp dword [esi + 4], 6
jae 0x513447
mov edi, dword [esi + 0x10]
mov edx, dword [esi + 8]
cmp edx, edi
je 0x5133d6
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 0x513420
mov edx, 1
mov eax, dword [esi]
mov ecx, eax
and ecx, dword [0x572938]
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 0x5134c6
cmp eax, 0x1e
ja 0x5134c6
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 0x5134d0
lea edi, [eax - 0x1e]
lea edx, [eax + 1]
jmp case.default.0x5133c2
mov edi, 0xfffffff3
jmp case.default.0x5133c2
add eax, 0x1da0
mov dword [ebx], 3
mov dword [ebx + 0xb0], eax
push ebx
call fcn.00519630
add esp, 4
mov dword [ebx], 4
push esi
push ebx
call fcn.00514dd0
mov edi, eax
add esp, 8
mov edx, 1
cmp edi, 1
jne 0x5132cd
test byte [ebx + 0x24c], 6
je 0x513558
mov edx, dword [esi + 4]
mov ebp, 0
mov ecx, edx
and ecx, 7
je 0x513536
mov ebp, dword [ecx*4 + 0x572920]
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 0x51354a
mov eax, edx
shl eax, cl
dec eax
and dword [esi], eax
test ebp, ebp
je 0x513558
mov edi, 0xfffffff2
jmp 0x5132c0
test byte [ebx + 0x24c], 4
je 0x513596
mov eax, dword [ebx + 0x220]
mov edx, 1
mov ebp, dword [esp + 0x30]
mov dword [ebx], 0xc
test eax, eax
je case.default.0x5133c2
push dword [ebx + 0x60]
push dword [ebx + 0x228]
call eax
add esp, 8
mov edx, 1
jmp case.default.0x5133c2
cmp dword [ebx + 0x60], 0
jne 0x5135a7
mov dword [ebx], 0xe
jmp 0x5132b7
push ebx
call fcn.005130b0
add esp, 4
mov edx, 1
test byte [ebx + 0x24c], 2
je 0x5135c9
mov dword [ebx], 0xb
jmp 0x5132c0
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 0x513623
mov dword [ebx], 5
jmp 0x5132c0
add eax, 0x33
lea eax, [ebx + eax*4]
push eax
push esi
push ebx
call fcn.00515240
mov ebp, dword [esp + 0x3c]
mov edi, eax
add esp, 0xc
mov edx, 1
cmp edi, 1
jne 0x5132cd
mov eax, dword [ebx + 4]
inc dword [ebx + eax*4 + 0xcc]
mov eax, dword [ebx + 4]
cmp dword [ebx + eax*4 + 0xcc], 2
jae 0x513668
inc eax
mov dword [ebx + 4], eax
jmp case.default.0x5133c2
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.00516850
mov ebp, dword [esp + 0x44]
mov edi, eax
add esp, 0x14
mov edx, 1
cmp edi, 1
jne 0x5132cd
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.00516850
mov ebp, dword [esp + 0x44]
mov edi, eax
add esp, 0x14
mov edx, 1
cmp edi, 1
jne 0x5132cd
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 0x5137b3
cmp dword [esi + 4], 0xf
jae 0x513746
mov ebp, dword [esi + 0x10]
nop
mov edx, dword [esi + 8]
cmp edx, ebp
je 0x513793
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 0x513720
mov ecx, dword [esp + 0x18]
mov ebp, dword [esi]
mov eax, ebp
and eax, dword [0x57295c]
mov dword [esp + 0x18], eax
movzx eax, al
lea edx, [ecx + eax*4]
mov al, byte [edx]
cmp al, 8
jbe 0x513785
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 + 0x572900]
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 0x5137b9
lea eax, [esp + 0x14]
push eax
push esi
push dword [esp + 0x20]
call fcn.00517780
add esp, 0xc
test eax, eax
je 0x51384f
mov eax, dword [esp + 0x14]
jmp 0x5137bd
mov eax, dword [ebx + 0xc8]
mov dword [esp + 0x14], eax
movzx ecx, byte [eax*4 + 0x57999a]
movzx eax, word [eax*4 + 0x579998]
mov dword [esp + 0x18], ecx
mov dword [esp + 0x1c], eax
cmp dword [esi + 4], ecx
jae 0x513807
mov ebp, dword [esi + 0x10]
nop dword [eax]
mov edx, dword [esi + 8]
cmp edx, ebp
je 0x51383b
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 0x5137e0
mov ecx, dword [esp + 0x18]
mov eax, dword [ecx*4 + 0x572920]
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 0x5132b7
mov eax, dword [esp + 0x14]
mov dword [ebx + 0xc8], eax
mov dword [ebx + 0x244], 1
mov edi, 2
jmp 0x5132b7
push ebx
push dword [esp + 0x44]
push dword [esp + 0x44]
push dword [esp + 0x44]
call fcn.00514220
add esp, 0x10
mov edi, eax
mov edx, 1
cmp edi, 1
jne 0x5132cd
mov dword [ebx], 0xe
jmp case.default.0x5133c2
push ebx
call fcn.00518730
add esp, 4
jmp 0x51386e
cmp dword [esi + 4], 6
jae 0x5138c6
mov edi, dword [esi + 0x10]
nop dword [eax]
mov edx, dword [esi + 8]
cmp edx, edi
je 0x5133d6
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 0x5138a0
mov eax, dword [esi]
mov edx, eax
and edx, dword [0x572938]
add dword [esi + 4], 0xfffffffa
shr eax, 6
mov dword [esi], eax
mov eax, dword [0x572928]
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 0x513919
lea edi, [eax - 0x15]
lea edx, [eax + 1]
jmp case.default.0x5133c2
mov dword [ebx + 4], 0
mov dword [ebx], 6
push ebx
call fcn.005167d0
mov edi, eax
add esp, 4
mov edx, 1
cmp edi, 1
jne 0x5132cd
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.00514570
mov edi, eax
add esp, 0x10
mov edx, 1
cmp edi, 1
jne 0x5132cd
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 0x513a13
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 0x5139b0
mov ebx, dword [esp + 0x2c]
mov ebp, dword [esp + 0x18]
test esi, esi
jne 0x513a03
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 0x513995
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 0x513ac1
cmp edi, 0x7ffffffc
jb 0x513a58
mov ebp, ntohl
jmp 0x513aad
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 0x513a85
nop dword [eax]
inc eax
shr ecx, 1
jne 0x513a80
lea ecx, [eax - 1]
shr edx, cl
lea eax, [eax*2 - 4]
and edx, 1
or edx, eax
jne 0x513a9d
lea ebp, [edi + 0x10]
jmp 0x513aad
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.00514570
mov edi, eax
add esp, 0x10
mov edx, 1
cmp edi, 1
jne 0x5132c0
push dword [ebx + 0x250]
lea eax, [ebx + 0x7c]
push 0x100
push 0x100
push eax
push ebx
call fcn.005192e0
push dword [ebx + 0xd0]
lea ecx, [ebx + 0x8c]
mov edi, eax
push 0x2c0
push 0x2c0
push ecx
push ebx
and edi, 1
call fcn.005192e0
push dword [ebx + 0xf8]
and edi, eax
lea eax, [ebx + 0x9c]
push ebp
push dword [esp + 0x48]
push eax
push ebx
call fcn.005192e0
add esp, 0x3c
test edi, eax
je 0x513ef1
mov dword [ebx + 4], 0
mov dword [ebx], 0x18
mov eax, dword [ebx + 4]
sub eax, 0
je 0x513b86
sub eax, 1
je 0x513b7e
sub eax, 1
jne 0x513f10
lea eax, [ebx + 0x9c]
jmp 0x513b89
lea eax, [ebx + 0x8c]
jmp 0x513b89
lea eax, [ebx + 0x7c]
push ebx
push eax
call fcn.00515570
mov ebp, dword [esp + 0x38]
mov edi, eax
add esp, 8
mov edx, 1
cmp edi, 1
jne 0x5132cd
inc dword [ebx + 4]
cmp dword [ebx + 4], 3
jl case.default.0x5133c2
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, 0x579a00
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.00513fe0
add esp, 4
test eax, eax
jne 0x513c3a
lea edi, [eax - 0x1b]
jmp 0x5132b7
push ebx
call fcn.00514070
add esp, 4
mov dword [ebx], 7
push ebx
call fcn.00515a30
mov ebp, dword [esp + 0x34]
mov edi, eax
add esp, 4
mov edx, 1
cmp edi, 2
jne case.default.0x5133c2
push ebx
call fcn.00517820
add esp, 4
mov edi, eax
mov edx, 1
jmp case.default.0x5133c2
push 0
push dword [esp + 0x44]
push dword [esp + 0x44]
push dword [esp + 0x44]
push ebx
call fcn.00518890
mov edi, eax
add esp, 0x14
mov edx, 1
cmp edi, 1
jne 0x5132cd
push ebx
call fcn.00518860
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 0x513ccb
mov eax, dword [ebx + 0x38]
mov dword [ebx + 0x3c], eax
mov eax, dword [ebx]
cmp eax, 0xf
jne 0x513d1c
mov ecx, dword [ebx + 0x260]
test ecx, ecx
je 0x513d04
mov eax, dword [ecx + 0x10]
cmp eax, dword [ecx + 0x14]
je 0x513d04
push dword [ebx + 0x34]
push ebx
call fcn.00514170
add dword [ebx + 0x34], eax
add esp, 8
mov eax, dword [ebx + 0x34]
mov edx, 1
cmp eax, dword [ebx + 0x40]
jge case.default.0x5133c2
cmp dword [ebx + 0x60], 0
mov eax, 7
mov ecx, 0xe
cmove eax, ecx
mov dword [ebx], eax
jmp case.default.0x5133c2
cmp eax, 0x10
jne 0x513d2c
mov dword [ebx], 0xa
jmp case.default.0x5133c2
cmp dword [ebx + 4], 0
jne 0x513d4a
cmp dword [ebx + 0x60], 0
mov eax, 9
mov ecx, 0xe
cmove eax, ecx
mov dword [ebx], eax
jmp case.default.0x5133c2
mov dword [ebx], 8
jmp case.default.0x5133c2
cmp dword [ebx + 0x60], 0
jge 0x513d65
mov edi, 0xfffffff6
jmp case.default.0x5133c2
push ebx
call fcn.005193b0
add esp, 4
test byte [ebx + 0x24c], 1
jne 0x513d87
mov dword [ebx], 3
mov edx, 1
jmp case.default.0x5133c2
mov edx, dword [esi + 4]
mov ebp, 0
mov ecx, edx
and ecx, 7
je 0x513daa
mov ebp, dword [ecx*4 + 0x572920]
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 0x513dbe
mov eax, edx
shl eax, cl
dec eax
and dword [esi], eax
test ebp, ebp
je 0x513dcc
mov edi, 0xfffffff1
jmp 0x5132c0
cmp dword [ebx + 0x30], 0
jne 0x513e1a
mov edx, dword [esi + 8]
shr ecx, 3
lea eax, [ecx*8]
test ecx, ecx
je 0x513de5
sub edx, ecx
sub dword [esi + 4], eax
mov ecx, dword [esi + 4]
mov dword [esi + 8], edx
cmp ecx, 0x20
jae 0x513dfd
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 0x513e2a
mov ebp, dword [esp + 0x30]
mov dword [ebx], 0x1a
jmp 0x513e2a
mov ebp, dword [esp + 0x30]
cmp dword [ebx + 0x64], 0
je 0x513e52
push 1
push dword [esp + 0x44]
push dword [esp + 0x44]
push dword [esp + 0x44]
push ebx
call fcn.00518890
mov edi, eax
add esp, 0x14
cmp edi, 1
jne 0x5132b7
mov eax, dword [esp + 0x10]
sub eax, dword [ebp]
push eax
push edi
push ebx
call fcn.005186d0
add esp, 0xc
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x18
ret
mov edi, eax
jmp 0x513e52
mov edx, dword [esp + 0x34]
mov dword [edx], eax
mov eax, dword [esi + 0x10]
sub eax, dword [esi + 8]
mov dword [ebp], eax
je 0x513e52
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 0x513e81
jmp 0x513e52
cmp dword [ebx + 0x30], 0
je 0x513ea8
mov dword [ebx + 0x30], 0
jmp 0x513e52
mov ecx, dword [esi + 4]
mov eax, ecx
mov edx, dword [esi + 8]
shr eax, 3
lea ebp, [eax*8]
test eax, eax
je 0x513ec0
sub edx, eax
sub ecx, ebp
mov dword [esi + 8], edx
mov dword [esi + 4], ecx
cmp ecx, 0x20
jae 0x513ed7
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 0x513e52
mov ebp, dword [esp + 0x30]
mov eax, dword [esp + 0x10]
sub eax, dword [ebp]
push eax
push 0xffffffffffffffea
push ebx
call fcn.005186d0
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.005186d0
add esp, 0xc
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x18
ret