Function at 0x504160
Capabilities:
Inspect section memory permissions

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x5f2ac8
mov eax, dword fs:[0]
push eax
sub esp, 0x40
push ebx
push esi
push edi
mov eax, dword [0x64c874]
xor eax, esp
push eax
lea eax, [esp + 0x50]
mov dword fs:[0], eax
mov esi, ecx
mov edi, dword [ebp + 8]
mov dword [esp + 0x18], 0xf4240
mov dword [esp + 0x14], edi
call fcn.00505380
xor eax, eax
cmp edi, dword [ebp + 0xc]
je 0x504596
mov dword [esp + 0x40], eax
mov dword [esp + 0x44], eax
mov dword [esp + 0x48], eax
mov dword [esp + 0x58], eax
mov dword [esp + 0x1c], esi
lea ebx, [esp + 0x1c]
lea esi, [esp + 0x3c]
call fcn.00518b70
cmp edi, dword [ebp + 0xc]
jae 0x504583
mov edi, dword [esp + 0x44]
mov eax, dword [esp + 0x40]
test eax, eax
je 0x504594
mov ecx, edi
sub ecx, eax
sar ecx, 2
je 0x504583
mov ecx, eax
cmp ecx, edi
mov esi, edi
jbe 0x504209
call fcn.005b8b18
mov edi, dword [esp + 0x44]
mov ecx, dword [esp + 0x40]
lea eax, [esp + 0x3c]
mov ebx, eax
lea eax, [esi - 4]
cmp eax, edi
mov dword [esp + 0x20], esi
ja 0x50421e
cmp eax, ecx
jae 0x50422b
call fcn.005b8b18
mov edi, dword [esp + 0x44]
mov ecx, dword [esp + 0x40]
add esi, 0xfffffffc
cmp esi, dword [ebx + 8]
jb 0x504240
call fcn.005b8b18
mov edi, dword [esp + 0x44]
mov ecx, dword [esp + 0x40]
test ecx, ecx
mov esi, dword [esi]
mov dword [esp + 0x1c], esi
je 0x50425c
mov eax, edi
sub eax, ecx
sar eax, 2
cmp eax, 0x3e8
jg 0x5045a9
mov edx, dword [ebp + 8]
mov bl, byte [edx]
add edx, 1
cmp edx, dword [ebp + 0xc]
mov byte [esp + 0x13], bl
mov dword [ebp + 8], edx
jb 0x504279
cmp bl, 0x65
jne 0x504668
mov eax, dword [esi + 0x10]
shr eax, 0x1d
sub eax, 1
je 0x5042e4
sub eax, 1
jne 0x5043d1
cmp bl, 0x65
jne 0x5042c1
sub edx, dword [esi + 4]
mov dword [esi + 8], edx
mov eax, dword [esp + 0x40]
test eax, eax
je 0x504573
mov edi, dword [esp + 0x44]
mov edx, edi
sub edx, eax
sar edx, 2
je 0x504577
sub edi, 4
mov dword [esp + 0x44], edi
jmp 0x504577
call fcn.00505110
test eax, eax
mov dword [esp + 0x1c], eax
je 0x5046fa
lea ebx, [esp + 0x1c]
lea esi, [esp + 0x3c]
call fcn.00518b70
jmp 0x5043c5
cmp bl, 0x65
jne 0x504318
sub edx, dword [esi + 4]
mov dword [esi + 8], edx
mov eax, dword [esp + 0x40]
test eax, eax
je 0x504573
mov edi, dword [esp + 0x44]
mov ecx, edi
sub ecx, eax
sar ecx, 2
je 0x504577
sub edi, 4
mov dword [esp + 0x44], edi
jmp 0x504577
mov dl, bl
sub dl, 0x30
cmp dl, 9
ja 0x504781
movsx eax, bl
sub eax, 0x30
cdq
mov dword [esp + 0x24], eax
mov eax, dword [ebp + 0xc]
push eax
mov eax, dword [ebp + 8]
lea esi, [esp + 0x28]
mov bl, 0x3a
mov dword [esp + 0x2c], edx
call fcn.00504110
add esp, 4
test eax, eax
mov dword [ebp + 8], eax
je 0x504c22
mov edx, dword [esp + 0x24]
mov ebx, dword [ebp + 0xc]
mov ecx, eax
lea eax, [edx + ecx + 3]
cmp eax, ebx
ja 0x504c22
cmp byte [ecx], 0x3a
jne 0x504c22
mov esi, ecx
add esi, 1
cmp esi, ebx
mov dword [ebp + 8], esi
je 0x504810
mov edi, esi
mov esi, dword [esp + 0x1c]
push edi
call fcn.00504d30
test eax, eax
mov dword [esp + 0x1c], eax
je 0x5048ae
add edi, dword [esp + 0x24]
cmp edi, ebx
mov dword [ebp + 8], edi
jae 0x504948
lea ebx, [esp + 0x1c]
lea esi, [esp + 0x3c]
call fcn.00518b70
mov eax, edi
mov dl, byte [eax]
add eax, 1
mov byte [esp + 0x13], dl
mov dword [ebp + 8], eax
mov ecx, dword [esp + 0x40]
mov bl, byte [esp + 0x13]
mov edi, dword [esp + 0x44]
mov eax, dword [esp + 0x18]
sub eax, 1
test eax, eax
mov dword [esp + 0x18], eax
jle 0x5049e2
cmp ecx, edi
mov esi, edi
jbe 0x5043f7
call fcn.005b8b18
mov edi, dword [esp + 0x44]
mov ecx, dword [esp + 0x40]
lea eax, [esp + 0x3c]
mov dword [esp + 0x34], eax
lea eax, [esi - 4]
cmp eax, edi
mov dword [esp + 0x38], esi
ja 0x50440e
cmp eax, ecx
jae 0x504413
call fcn.005b8b18
mov eax, dword [esp + 0x34]
add esi, 0xfffffffc
cmp esi, dword [eax + 8]
jb 0x504424
call fcn.005b8b18
cmp bl, 0x64
mov edi, dword [esi]
je 0x50455c
cmp bl, 0x69
je 0x504502
cmp bl, 0x6c
je 0x5044f0
mov cl, bl
sub cl, 0x30
cmp cl, 9
ja 0x504a71
movsx eax, bl
sub eax, 0x30
cdq
mov dword [esp + 0x30], edx
mov edx, dword [ebp + 0xc]
mov dword [esp + 0x2c], eax
mov eax, dword [ebp + 8]
push edx
lea esi, [esp + 0x30]
mov bl, 0x3a
call fcn.00504110
add esp, 4
test eax, eax
mov dword [ebp + 8], eax
mov ebx, eax
je 0x504af8
mov esi, dword [esp + 0x2c]
lea eax, [esi + ebx + 1]
cmp eax, dword [ebp + 0xc]
ja 0x504af8
cmp byte [ebx], 0x3a
jne 0x504af8
mov ecx, dword [edi + 0x10]
and ecx, 0x1fffffff
or ecx, 0x60000000
mov dword [edi + 0x10], ecx
add ebx, 1
mov ecx, esi
mov dword [edi], ebx
mov dword [edi + 0xc], esi
call fcn.00504f50
mov edx, ebx
sub edx, eax
lea eax, [edx - 1]
mov ecx, esi
sub ecx, eax
add ecx, ebx
mov dword [edi + 4], eax
mov dword [edi + 8], ecx
mov eax, dword [esp + 0x40]
test eax, eax
je 0x5044e6
mov edx, dword [esp + 0x44]
sub edx, eax
sar edx, 2
je 0x5044e6
sub dword [esp + 0x44], 4
add ebx, esi
mov dword [ebp + 8], ebx
jmp 0x504573
mov eax, dword [ebp + 8]
add eax, 0xffffffff
mov dword [edi + 0x10], 0x40000000
mov dword [edi + 4], eax
jmp 0x50456c
mov ecx, dword [ebp + 8]
mov edx, dword [ebp + 0xc]
cmp ecx, edx
mov esi, ecx
jae 0x50451c
mov edi, edi
cmp byte [esi], 0x65
je 0x50451c
add esi, 1
cmp esi, edx
jb 0x504510
mov ebx, dword [edi + 0x10]
mov eax, esi
sub eax, ecx
and ebx, 0x1fffffff
or ebx, 0x80000000
mov dword [edi], ecx
mov dword [edi + 0xc], eax
add ecx, 0xffffffff
add eax, 2
cmp esi, edx
mov dword [edi + 0x10], ebx
mov dword [edi + 4], ecx
mov dword [edi + 8], eax
je 0x504b8d
add esi, 1
lea ecx, [esp + 0x3c]
mov dword [ebp + 8], esi
call fcn.00505440
jmp 0x504573
mov ecx, dword [ebp + 8]
add ecx, 0xffffffff
mov dword [edi + 0x10], 0x20000000
mov dword [edi + 4], ecx
mov dword [edi + 0xc], 0
mov edi, dword [esp + 0x44]
mov edx, dword [ebp + 0xc]
cmp dword [ebp + 8], edx
jb 0x5041db
mov eax, dword [esp + 0x40]
test eax, eax
je 0x504594
push eax
call fcn.0059b877
add esp, 4
xor eax, eax
mov ecx, dword [esp + 0x50]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov ebx, 1
test byte [0x65b670], bl
jne 0x5045db
or dword [0x65b670], ebx
push 0x5fbd80
mov dword [0x65b674], 0x6155fc
call fcn.005b89dc
mov edi, dword [esp + 0x48]
mov ecx, dword [esp + 0x44]
add esp, 4
mov esi, dword [ebp + 0x10]
mov eax, 0xc2
mov edx, 0x65b674
mov dword [esi], eax
mov dword [esi + 4], edx
lea ecx, [ecx]
test ecx, ecx
je 0x504635
sub edi, ecx
sar edi, 2
je 0x504635
lea eax, [esp + 0x3c]
call fcn.005053f0
mov ecx, dword [eax]
mov eax, dword [ecx + 0x10]
shr eax, 0x1d
cmp eax, ebx
je 0x504615
cmp eax, 2
jne 0x504622
mov eax, dword [ecx + 0xc]
test eax, eax
jbe 0x504622
add eax, 0xffffffff
mov dword [ecx + 0xc], eax
lea ecx, [esp + 0x3c]
call fcn.00505440
mov edi, dword [esp + 0x44]
mov ecx, dword [esp + 0x40]
jmp 0x5045f0
mov edx, dword [ebp + 0x14]
test edx, edx
je 0x504645
mov eax, dword [ebp + 8]
sub eax, dword [esp + 0x14]
mov dword [edx], eax
test ecx, ecx
je 0x504652
push ecx
call fcn.0059b877
add esp, 4
or eax, 0xffffffff
mov ecx, dword [esp + 0x50]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
test byte [0x65b670], 1
jne 0x504697
or dword [0x65b670], 1
push 0x5fbd80
mov dword [0x65b674], 0x6155fc
call fcn.005b89dc
mov edi, dword [esp + 0x48]
mov ecx, dword [esp + 0x44]
add esp, 4
mov esi, dword [ebp + 0x10]
mov eax, 0xc0
mov edx, 0x65b674
mov dword [esi], eax
mov dword [esi + 4], edx
lea esp, [esp]
test ecx, ecx
je 0x504635
sub edi, ecx
sar edi, 2
je 0x504635
lea eax, [esp + 0x3c]
call fcn.005053f0
mov ecx, dword [eax]
mov eax, dword [ecx + 0x10]
shr eax, 0x1d
cmp eax, 1
je 0x5046da
cmp eax, 2
jne 0x5046e7
mov eax, dword [ecx + 0xc]
test eax, eax
jbe 0x5046e7
add eax, 0xffffffff
mov dword [ecx + 0xc], eax
lea ecx, [esp + 0x3c]
call fcn.00505440
mov edi, dword [esp + 0x44]
mov ecx, dword [esp + 0x40]
jmp 0x5046b0
test byte [0x65b670], 1
jne 0x504721
or dword [0x65b670], 1
push 0x5fbd80
mov dword [0x65b674], 0x6155fc
call fcn.005b89dc
add esp, 4
mov edx, dword [ebp + 0x10]
mov eax, 0x2d
mov ecx, 0x65b674
mov dword [edx], eax
mov dword [edx + 4], ecx
mov eax, dword [esp + 0x40]
test eax, eax
je 0x504ca7
mov ecx, dword [esp + 0x44]
sub ecx, eax
sar ecx, 2
je 0x504ca7
lea eax, [esp + 0x3c]
call fcn.005053f0
mov ecx, dword [eax]
mov eax, dword [ecx + 0x10]
shr eax, 0x1d
cmp eax, 1
je 0x504769
cmp eax, 2
jne 0x504776
mov eax, dword [ecx + 0xc]
test eax, eax
jbe 0x504776
add eax, 0xffffffff
mov dword [ecx + 0xc], eax
lea ecx, [esp + 0x3c]
call fcn.00505440
jmp 0x504733
test byte [0x65b670], 1
jne 0x5047b0
or dword [0x65b670], 1
push 0x5fbd80
mov dword [0x65b674], 0x6155fc
call fcn.005b89dc
mov edi, dword [esp + 0x48]
mov ecx, dword [esp + 0x44]
add esp, 4
mov esi, dword [ebp + 0x10]
mov eax, 0xbe
mov edx, 0x65b674
mov dword [esi], eax
mov dword [esi + 4], edx
test ecx, ecx
je 0x504635
sub edi, ecx
sar edi, 2
je 0x504635
lea eax, [esp + 0x3c]
call fcn.005053f0
mov ecx, dword [eax]
mov eax, dword [ecx + 0x10]
shr eax, 0x1d
cmp eax, 1
je 0x5047f0
cmp eax, 2
jne 0x5047fd
mov eax, dword [ecx + 0xc]
test eax, eax
jbe 0x5047fd
add eax, 0xffffffff
mov dword [ecx + 0xc], eax
lea ecx, [esp + 0x3c]
call fcn.00505440
mov edi, dword [esp + 0x44]
mov ecx, dword [esp + 0x40]
jmp 0x5047c2
test byte [0x65b670], 1
jne 0x50483b
or dword [0x65b670], 1
push 0x5fbd80
mov dword [0x65b674], 0x6155fc
call fcn.005b89dc
mov edi, dword [esp + 0x48]
add esp, 4
mov ebx, dword [ebp + 0x10]
mov ecx, 0xc0
mov edx, 0x65b674
mov dword [ebx], ecx
mov dword [ebx + 4], edx
mov eax, dword [esp + 0x40]
test eax, eax
je 0x504893
sub edi, eax
sar edi, 2
je 0x504893
lea eax, [esp + 0x3c]
call fcn.005053f0
mov ecx, dword [eax]
mov eax, dword [ecx + 0x10]
shr eax, 0x1d
cmp eax, 1
je 0x504877
cmp eax, 2
jne 0x504884
mov eax, dword [ecx + 0xc]
test eax, eax
jbe 0x504884
add eax, 0xffffffff
mov dword [ecx + 0xc], eax
lea ecx, [esp + 0x3c]
call fcn.00505440
mov edi, dword [esp + 0x44]
jmp 0x50484d
mov ecx, dword [ebp + 0x14]
test ecx, ecx
je 0x5048a0
sub esi, dword [esp + 0x14]
mov dword [ecx], esi
test eax, eax
je 0x504652
push eax
jmp 0x50464a
test byte [0x65b670], 1
jne 0x5048d5
or dword [0x65b670], 1
push 0x5fbd80
mov dword [0x65b674], 0x6155fc
call fcn.005b89dc
add esp, 4
mov edx, dword [ebp + 0x10]
mov eax, 0x2d
mov ecx, 0x65b674
mov dword [edx], eax
mov dword [edx + 4], ecx
mov eax, dword [esp + 0x40]
test eax, eax
je 0x50492d
mov edx, dword [esp + 0x44]
sub edx, eax
sar edx, 2
je 0x50492d
lea eax, [esp + 0x3c]
call fcn.005053f0
mov ecx, dword [eax]
mov eax, dword [ecx + 0x10]
shr eax, 0x1d
cmp eax, 1
je 0x504915
cmp eax, 2
jne 0x504922
mov eax, dword [ecx + 0xc]
test eax, eax
jbe 0x504922
add eax, 0xffffffff
mov dword [ecx + 0xc], eax
lea ecx, [esp + 0x3c]
call fcn.00505440
jmp 0x5048e7
mov ecx, dword [ebp + 0x14]
test ecx, ecx
je 0x50493a
sub edi, dword [esp + 0x14]
mov dword [ecx], edi
test eax, eax
je 0x504652
push eax
jmp 0x50464a
test byte [0x65b670], 1
jne 0x50496f
or dword [0x65b670], 1
push 0x5fbd80
mov dword [0x65b674], 0x6155fc
call fcn.005b89dc
add esp, 4
mov edx, dword [ebp + 0x10]
mov eax, 0xc0
mov ecx, 0x65b674
mov dword [edx], eax
mov dword [edx + 4], ecx
mov eax, dword [esp + 0x40]
test eax, eax
je 0x5049c7
mov ecx, dword [esp + 0x44]
sub ecx, eax
sar ecx, 2
je 0x5049c7
lea eax, [esp + 0x3c]
call fcn.005053f0
mov ecx, dword [eax]
mov eax, dword [ecx + 0x10]
shr eax, 0x1d
cmp eax, 1
je 0x5049af
cmp eax, 2
jne 0x5049bc
mov eax, dword [ecx + 0xc]
test eax, eax
jbe 0x5049bc
add eax, 0xffffffff
mov dword [ecx + 0xc], eax
lea ecx, [esp + 0x3c]
call fcn.00505440
jmp 0x504981
mov ecx, dword [ebp + 0x14]
test ecx, ecx
je 0x5049d4
sub edi, dword [esp + 0x14]
mov dword [ecx], edi
test eax, eax
je 0x504652
push eax
jmp 0x50464a
test byte [0x65b670], 1
jne 0x504a11
or dword [0x65b670], 1
push 0x5fbd80
mov dword [0x65b674], 0x6155fc
call fcn.005b89dc
mov edi, dword [esp + 0x48]
mov ecx, dword [esp + 0x44]
add esp, 4
mov esi, dword [ebp + 0x10]
mov eax, 0xc3
mov edx, 0x65b674
mov dword [esi], eax
mov dword [esi + 4], edx
test ecx, ecx
je 0x504635
sub edi, ecx
sar edi, 2
je 0x504635
lea eax, [esp + 0x3c]
call fcn.005053f0
mov ecx, dword [eax]
mov eax, dword [ecx + 0x10]
shr eax, 0x1d
cmp eax, 1
je 0x504a51
cmp eax, 2
jne 0x504a5e
mov eax, dword [ecx + 0xc]
test eax, eax
jbe 0x504a5e
add eax, 0xffffffff
mov dword [ecx + 0xc], eax
lea ecx, [esp + 0x3c]
call fcn.00505440
mov edi, dword [esp + 0x44]
mov ecx, dword [esp + 0x40]
jmp 0x504a23
test byte [0x65b670], 1
jne 0x504a98
or dword [0x65b670], 1
push 0x5fbd80
mov dword [0x65b674], 0x6155fc
call fcn.005b89dc
add esp, 4
mov edi, dword [ebp + 0x10]
mov edx, 0xc1
mov esi, 0x65b674
mov dword [edi], edx
mov dword [edi + 4], esi
mov ecx, dword [esp + 0x40]
test ecx, ecx
mov eax, dword [esp + 0x44]
je 0x504635
sub eax, ecx
sar eax, 2
je 0x504635
lea eax, [esp + 0x3c]
call fcn.005053f0
mov ecx, dword [eax]
mov eax, dword [ecx + 0x10]
shr eax, 0x1d
cmp eax, 1
je 0x504ae0
cmp eax, 2
jne 0x504aed
mov eax, dword [ecx + 0xc]
test eax, eax
jbe 0x504aed
add eax, 0xffffffff
mov dword [ecx + 0xc], eax
lea ecx, [esp + 0x3c]
call fcn.00505440
jmp 0x504aaa
test byte [0x65b670], 1
jne 0x504b1f
or dword [0x65b670], 1
push 0x5fbd80
mov dword [0x65b674], 0x6155fc
call fcn.005b89dc
add esp, 4
mov edi, dword [ebp + 0x10]
mov edx, 0xbf
mov esi, 0x65b674
mov dword [edi], edx
mov dword [edi + 4], esi
mov ecx, dword [esp + 0x40]
test ecx, ecx
mov eax, dword [esp + 0x44]
je 0x504b77
sub eax, ecx
sar eax, 2
je 0x504b77
lea eax, [esp + 0x3c]
call fcn.005053f0
mov ecx, dword [eax]
mov eax, dword [ecx + 0x10]
shr eax, 0x1d
cmp eax, 1
je 0x504b5f
cmp eax, 2
jne 0x504b6c
mov eax, dword [ecx + 0xc]
test eax, eax
jbe 0x504b6c
add eax, 0xffffffff
mov dword [ecx + 0xc], eax
lea ecx, [esp + 0x3c]
call fcn.00505440
jmp 0x504b31
mov eax, dword [ebp + 0x14]
test eax, eax
je 0x504645
sub ebx, dword [esp + 0x14]
mov dword [eax], ebx
jmp 0x504645
test byte [0x65b670], 1
jne 0x504bb4
or dword [0x65b670], 1
push 0x5fbd80
mov dword [0x65b674], 0x6155fc
call fcn.005b89dc
add esp, 4
mov edx, dword [ebp + 0x10]
mov eax, 0xc0
mov ecx, 0x65b674
mov dword [edx], eax
mov dword [edx + 4], ecx
mov eax, dword [esp + 0x40]
test eax, eax
je 0x504c0c
mov edx, dword [esp + 0x44]
sub edx, eax
sar edx, 2
je 0x504c0c
lea eax, [esp + 0x3c]
call fcn.005053f0
mov ecx, dword [eax]
mov eax, dword [ecx + 0x10]
shr eax, 0x1d
cmp eax, 1
je 0x504bf4
cmp eax, 2
jne 0x504c01
mov eax, dword [ecx + 0xc]
test eax, eax
jbe 0x504c01
add eax, 0xffffffff
mov dword [ecx + 0xc], eax
lea ecx, [esp + 0x3c]
call fcn.00505440
jmp 0x504bc6
mov ecx, dword [ebp + 0x14]
test ecx, ecx
je 0x504cb7
sub esi, dword [esp + 0x14]
mov dword [ecx], esi
jmp 0x504cb7
mov ebx, 1
test byte [0x65b670], bl
jne 0x504c50
or dword [0x65b670], ebx
push 0x5fbd80
mov dword [0x65b674], 0x6155fc
call fcn.005b89dc
mov edi, dword [esp + 0x48]
add esp, 4
mov esi, dword [ebp + 0x10]
mov ecx, 0xbf
mov edx, 0x65b674
mov dword [esi], ecx
mov dword [esi + 4], edx
mov eax, dword [esp + 0x40]
test eax, eax
je 0x504ca7
sub edi, eax
sar edi, 2
je 0x504ca7
lea eax, [esp + 0x3c]
call fcn.005053f0
mov ecx, dword [eax]
mov eax, dword [ecx + 0x10]
shr eax, 0x1d
cmp eax, ebx
je 0x504c8b
cmp eax, 2
jne 0x504c98
mov eax, dword [ecx + 0xc]
test eax, eax
jbe 0x504c98
add eax, 0xffffffff
mov dword [ecx + 0xc], eax
lea ecx, [esp + 0x3c]
call fcn.00505440
mov edi, dword [esp + 0x44]
jmp 0x504c62
mov edx, dword [ebp + 0x14]
test edx, edx
je 0x504cb7
mov ecx, dword [ebp + 8]
sub ecx, dword [esp + 0x14]
mov dword [edx], ecx
test eax, eax
je 0x504652
push eax
jmp 0x50464a