Function at 0x5175c0
Capabilities:
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 0x5175f2
mov eax, dword [ebx + 0x108]
mov dword [ecx], eax
mov eax, dword [esp + 0x10]
cmp dword [ebx + 0x5c], 0
jge 0x517602
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 0x51762f
mov edx, dword [esp + 0x3c]
test edx, edx
je 0x517618
cmp dword [edx], 0
jne 0x517637
sub eax, dword [ebp]
push eax
push 0xffffffffffffffec
push ebx
call fcn.0051cb00
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 0x51768b
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 0x517653
lea eax, [ecx + edx]
mov dword [esi + 0x10], eax
lea eax, [edx + 1]
cmp eax, 0x1c
jbe 0x517677
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.0x5177e2
lea eax, [ebx + 0x254]
mov dword [esi + 0xc], ecx
mov dword [esp + 0x24], eax
mov edx, 1
jmp case.default.0x5177e2
lea edx, [ebx + 0x28]
mov edi, 2
mov dword [esi + 8], edx
mov eax, edx
test ecx, ecx
je 0x51769f
lea eax, [edx + ecx]
mov dword [esi + 0x10], eax
lea eax, [ecx + 1]
cmp eax, 0x1c
jbe 0x5176c3
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.0x5177e2
lea eax, [ebx + 0x254]
mov dword [esi + 0xc], edx
mov dword [esp + 0x24], eax
mov edx, 1
jmp case.default.0x5177e2
mov edx, 1
nop dword [eax]
mov ebp, dword [esp + 0x30]
cmp edi, 1
je 0x5177d7
cmp edi, 2
jne 0x5182b9
cmp dword [ebx + 0x64], 0
je 0x51771b
push 1
push dword [esp + 0x44]
push dword [esp + 0x44]
push dword [esp + 0x44]
push ebx
call fcn.0051ccc0
add esp, 0x14
test eax, eax
js 0x51828c
mov ecx, dword [ebx + 0x30]
mov eax, dword [esi + 8]
test ecx, ecx
je 0x518290
cmp eax, dword [esi + 0x10]
jne 0x517773
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 0x51774f
lea eax, [ecx + edx]
mov dword [esi + 0x10], eax
lea eax, [edx + 1]
cmp eax, 0x1c
jbe 0x517769
lea eax, [ecx - 0x1b]
add eax, edx
mov edx, edi
mov dword [esi + 0xc], eax
jmp case.default.0x5177e2
mov dword [esi + 0xc], ecx
mov edx, edi
jmp case.default.0x5177e2
cmp dword [ebp], 0
je 0x518272
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 0x5177a1
lea eax, [ecx + edx]
mov dword [esi + 0x10], eax
lea eax, [edx + 1]
cmp eax, 0x1c
jbe 0x5177c4
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.0x5177e2
mov eax, dword [esp + 0x34]
mov edx, edi
mov dword [esi + 0xc], ecx
inc dword [eax]
dec dword [ebp]
jmp case.default.0x5177e2
mov eax, dword [ebx]
cmp eax, 0x1a
ja case.default.0x5177e2
jmp dword [eax*4 + 0x518350]
push esi
call fcn.0051cf00
add esp, 4
test eax, eax
jne 0x517803
mov edi, 2
lea edx, [edi - 1]
jmp case.default.0x5177e2
push esi
push ebx
call fcn.005197e0
mov edi, eax
add esp, 8
mov edx, 1
cmp edi, 1
jne 0x5176ed
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.0x5177e2
cmp dword [esi + 4], 6
jae 0x517867
mov edi, dword [esi + 0x10]
mov edx, dword [esi + 8]
cmp edx, edi
je 0x5177f6
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 0x517840
mov edx, 1
mov eax, dword [esi]
mov ecx, eax
and ecx, dword [0x576a38]
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 0x5178e6
cmp eax, 0x1e
ja 0x5178e6
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 0x5178f0
lea edi, [eax - 0x1e]
lea edx, [eax + 1]
jmp case.default.0x5177e2
mov edi, 0xfffffff3
jmp case.default.0x5177e2
add eax, 0x1da0
mov dword [ebx], 3
mov dword [ebx + 0xb0], eax
push ebx
call fcn.0051da60
add esp, 4
mov dword [ebx], 4
push esi
push ebx
call fcn.005191f0
mov edi, eax
add esp, 8
mov edx, 1
cmp edi, 1
jne 0x5176ed
test byte [ebx + 0x24c], 6
je 0x517978
mov edx, dword [esi + 4]
mov ebp, 0
mov ecx, edx
and ecx, 7
je 0x517956
mov ebp, dword [ecx*4 + 0x576a20]
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 0x51796a
mov eax, edx
shl eax, cl
dec eax
and dword [esi], eax
test ebp, ebp
je 0x517978
mov edi, 0xfffffff2
jmp 0x5176e0
test byte [ebx + 0x24c], 4
je 0x5179b6
mov eax, dword [ebx + 0x220]
mov edx, 1
mov ebp, dword [esp + 0x30]
mov dword [ebx], 0xc
test eax, eax
je case.default.0x5177e2
push dword [ebx + 0x60]
push dword [ebx + 0x228]
call eax
add esp, 8
mov edx, 1
jmp case.default.0x5177e2
cmp dword [ebx + 0x60], 0
jne 0x5179c7
mov dword [ebx], 0xe
jmp 0x5176d7
push ebx
call fcn.005174d0
add esp, 4
mov edx, 1
test byte [ebx + 0x24c], 2
je 0x5179e9
mov dword [ebx], 0xb
jmp 0x5176e0
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 0x517a43
mov dword [ebx], 5
jmp 0x5176e0
add eax, 0x33
lea eax, [ebx + eax*4]
push eax
push esi
push ebx
call fcn.00519660
mov ebp, dword [esp + 0x3c]
mov edi, eax
add esp, 0xc
mov edx, 1
cmp edi, 1
jne 0x5176ed
mov eax, dword [ebx + 4]
inc dword [ebx + eax*4 + 0xcc]
mov eax, dword [ebx + 4]
cmp dword [ebx + eax*4 + 0xcc], 2
jae 0x517a88
inc eax
mov dword [ebx + 4], eax
jmp case.default.0x5177e2
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.0051ac80
mov ebp, dword [esp + 0x44]
mov edi, eax
add esp, 0x14
mov edx, 1
cmp edi, 1
jne 0x5176ed
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.0051ac80
mov ebp, dword [esp + 0x44]
mov edi, eax
add esp, 0x14
mov edx, 1
cmp edi, 1
jne 0x5176ed
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 0x517bd3
cmp dword [esi + 4], 0xf
jae 0x517b66
mov ebp, dword [esi + 0x10]
nop
mov edx, dword [esi + 8]
cmp edx, ebp
je 0x517bb3
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 0x517b40
mov ecx, dword [esp + 0x18]
mov ebp, dword [esi]
mov eax, ebp
and eax, dword [0x576a5c]
mov dword [esp + 0x18], eax
movzx eax, al
lea edx, [ecx + eax*4]
mov al, byte [edx]
cmp al, 8
jbe 0x517ba5
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 + 0x576a00]
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 0x517bd9
lea eax, [esp + 0x14]
push eax
push esi
push dword [esp + 0x20]
call fcn.0051bbb0
add esp, 0xc
test eax, eax
je 0x517c6f
mov eax, dword [esp + 0x14]
jmp 0x517bdd
mov eax, dword [ebx + 0xc8]
mov dword [esp + 0x14], eax
movzx ecx, byte [eax*4 + 0x57daa2]
movzx eax, word [eax*4 + 0x57daa0]
mov dword [esp + 0x18], ecx
mov dword [esp + 0x1c], eax
cmp dword [esi + 4], ecx
jae 0x517c27
mov ebp, dword [esi + 0x10]
nop dword [eax]
mov edx, dword [esi + 8]
cmp edx, ebp
je 0x517c5b
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 0x517c00
mov ecx, dword [esp + 0x18]
mov eax, dword [ecx*4 + 0x576a20]
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 0x5176d7
mov eax, dword [esp + 0x14]
mov dword [ebx + 0xc8], eax
mov dword [ebx + 0x244], 1
mov edi, 2
jmp 0x5176d7
push ebx
push dword [esp + 0x44]
push dword [esp + 0x44]
push dword [esp + 0x44]
call fcn.00518640
add esp, 0x10
mov edi, eax
mov edx, 1
cmp edi, 1
jne 0x5176ed
mov dword [ebx], 0xe
jmp case.default.0x5177e2
push ebx
call fcn.0051cb60
add esp, 4
jmp 0x517c8e
cmp dword [esi + 4], 6
jae 0x517ce6
mov edi, dword [esi + 0x10]
nop dword [eax]
mov edx, dword [esi + 8]
cmp edx, edi
je 0x5177f6
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 0x517cc0
mov eax, dword [esi]
mov edx, eax
and edx, dword [0x576a38]
add dword [esi + 4], 0xfffffffa
shr eax, 6
mov dword [esi], eax
mov eax, dword [0x576a28]
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 0x517d39
lea edi, [eax - 0x15]
lea edx, [eax + 1]
jmp case.default.0x5177e2
mov dword [ebx + 4], 0
mov dword [ebx], 6
push ebx
call fcn.0051ac00
mov edi, eax
add esp, 4
mov edx, 1
cmp edi, 1
jne 0x5176ed
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.00518990
mov edi, eax
add esp, 0x10
mov edx, 1
cmp edi, 1
jne 0x5176ed
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 0x517e33
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 0x517dd0
mov ebx, dword [esp + 0x2c]
mov ebp, dword [esp + 0x18]
test esi, esi
jne 0x517e23
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 0x517db5
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 0x517ee1
cmp edi, 0x7ffffffc
jb 0x517e78
mov ebp, ntohl
jmp 0x517ecd
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 0x517ea5
nop dword [eax]
inc eax
shr ecx, 1
jne 0x517ea0
lea ecx, [eax - 1]
shr edx, cl
lea eax, [eax*2 - 4]
and edx, 1
or edx, eax
jne 0x517ebd
lea ebp, [edi + 0x10]
jmp 0x517ecd
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.00518990
mov edi, eax
add esp, 0x10
mov edx, 1
cmp edi, 1
jne 0x5176e0
push dword [ebx + 0x250]
lea eax, [ebx + 0x7c]
push 0x100
push 0x100
push eax
push ebx
call fcn.0051d710
push dword [ebx + 0xd0]
lea ecx, [ebx + 0x8c]
mov edi, eax
push 0x2c0
push 0x2c0
push ecx
push ebx
and edi, 1
call fcn.0051d710
push dword [ebx + 0xf8]
and edi, eax
lea eax, [ebx + 0x9c]
push ebp
push dword [esp + 0x48]
push eax
push ebx
call fcn.0051d710
add esp, 0x3c
test edi, eax
je 0x518311
mov dword [ebx + 4], 0
mov dword [ebx], 0x18
mov eax, dword [ebx + 4]
sub eax, 0
je 0x517fa6
sub eax, 1
je 0x517f9e
sub eax, 1
jne 0x518330
lea eax, [ebx + 0x9c]
jmp 0x517fa9
lea eax, [ebx + 0x8c]
jmp 0x517fa9
lea eax, [ebx + 0x7c]
push ebx
push eax
call fcn.00519990
mov ebp, dword [esp + 0x38]
mov edi, eax
add esp, 8
mov edx, 1
cmp edi, 1
jne 0x5176ed
inc dword [ebx + 4]
cmp dword [ebx + 4], 3
jl case.default.0x5177e2
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, 0x57db08
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.00518400
add esp, 4
test eax, eax
jne 0x51805a
lea edi, [eax - 0x1b]
jmp 0x5176d7
push ebx
call fcn.00518490
add esp, 4
mov dword [ebx], 7
push ebx
call fcn.00519e60
mov ebp, dword [esp + 0x34]
mov edi, eax
add esp, 4
mov edx, 1
cmp edi, 2
jne case.default.0x5177e2
push ebx
call fcn.0051bc50
add esp, 4
mov edi, eax
mov edx, 1
jmp case.default.0x5177e2
push 0
push dword [esp + 0x44]
push dword [esp + 0x44]
push dword [esp + 0x44]
push ebx
call fcn.0051ccc0
mov edi, eax
add esp, 0x14
mov edx, 1
cmp edi, 1
jne 0x5176ed
push ebx
call fcn.0051cc90
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 0x5180eb
mov eax, dword [ebx + 0x38]
mov dword [ebx + 0x3c], eax
mov eax, dword [ebx]
cmp eax, 0xf
jne 0x51813c
mov ecx, dword [ebx + 0x260]
test ecx, ecx
je 0x518124
mov eax, dword [ecx + 0x10]
cmp eax, dword [ecx + 0x14]
je 0x518124
push dword [ebx + 0x34]
push ebx
call fcn.00518590
add dword [ebx + 0x34], eax
add esp, 8
mov eax, dword [ebx + 0x34]
mov edx, 1
cmp eax, dword [ebx + 0x40]
jge case.default.0x5177e2
cmp dword [ebx + 0x60], 0
mov eax, 7
mov ecx, 0xe
cmove eax, ecx
mov dword [ebx], eax
jmp case.default.0x5177e2
cmp eax, 0x10
jne 0x51814c
mov dword [ebx], 0xa
jmp case.default.0x5177e2
cmp dword [ebx + 4], 0
jne 0x51816a
cmp dword [ebx + 0x60], 0
mov eax, 9
mov ecx, 0xe
cmove eax, ecx
mov dword [ebx], eax
jmp case.default.0x5177e2
mov dword [ebx], 8
jmp case.default.0x5177e2
cmp dword [ebx + 0x60], 0
jge 0x518185
mov edi, 0xfffffff6
jmp case.default.0x5177e2
push ebx
call fcn.0051d7e0
add esp, 4
test byte [ebx + 0x24c], 1
jne 0x5181a7
mov dword [ebx], 3
mov edx, 1
jmp case.default.0x5177e2
mov edx, dword [esi + 4]
mov ebp, 0
mov ecx, edx
and ecx, 7
je 0x5181ca
mov ebp, dword [ecx*4 + 0x576a20]
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 0x5181de
mov eax, edx
shl eax, cl
dec eax
and dword [esi], eax
test ebp, ebp
je 0x5181ec
mov edi, 0xfffffff1
jmp 0x5176e0
cmp dword [ebx + 0x30], 0
jne 0x51823a
mov edx, dword [esi + 8]
shr ecx, 3
lea eax, [ecx*8]
test ecx, ecx
je 0x518205
sub edx, ecx
sub dword [esi + 4], eax
mov ecx, dword [esi + 4]
mov dword [esi + 8], edx
cmp ecx, 0x20
jae 0x51821d
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 0x51824a
mov ebp, dword [esp + 0x30]
mov dword [ebx], 0x1a
jmp 0x51824a
mov ebp, dword [esp + 0x30]
cmp dword [ebx + 0x64], 0
je 0x518272
push 1
push dword [esp + 0x44]
push dword [esp + 0x44]
push dword [esp + 0x44]
push ebx
call fcn.0051ccc0
mov edi, eax
add esp, 0x14
cmp edi, 1
jne 0x5176d7
mov eax, dword [esp + 0x10]
sub eax, dword [ebp]
push eax
push edi
push ebx
call fcn.0051cb00
add esp, 0xc
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x18
ret
mov edi, eax
jmp 0x518272
mov edx, dword [esp + 0x34]
mov dword [edx], eax
mov eax, dword [esi + 0x10]
sub eax, dword [esi + 8]
mov dword [ebp], eax
je 0x518272
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 0x5182a1
jmp 0x518272
cmp dword [ebx + 0x30], 0
je 0x5182c8
mov dword [ebx + 0x30], 0
jmp 0x518272
mov ecx, dword [esi + 4]
mov eax, ecx
mov edx, dword [esi + 8]
shr eax, 3
lea ebp, [eax*8]
test eax, eax
je 0x5182e0
sub edx, eax
sub ecx, ebp
mov dword [esi + 8], edx
mov dword [esi + 4], ecx
cmp ecx, 0x20
jae 0x5182f7
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 0x518272
mov ebp, dword [esp + 0x30]
mov eax, dword [esp + 0x10]
sub eax, dword [ebp]
push eax
push 0xffffffffffffffea
push ebx
call fcn.0051cb00
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.0051cb00
add esp, 0xc
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x18
ret