Function at 0x504070
Capabilities:
Resolve function by parsing pe exports

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x74
mov eax, dword [ebp + 0x24]
mov edx, dword [ebp + 0x1c]
push ebx
push esi
mov dword [eax], 0
mov eax, dword [edx + 0x30]
mov dword [esp + 0x5c], eax
mov eax, dword [edx + 0x28]
mov dword [esp + 0x34], eax
mov eax, dword [ebp + 0x18]
push edi
cmp dword [eax + 0x2c], 0
mov esi, dword [eax + 0x38]
jl 0x5040b8
jg 0x5040aa
cmp dword [eax + 0x28], 1
jbe 0x5040b8
mov eax, dword [esi + 4]
sub eax, dword [esi]
sar eax, 3
mov dword [esp + 0x10], eax
jmp 0x5040c0
mov dword [esp + 0x10], 0
cmp dword [edx + 0x2c], 0
jl 0x5040db
jg 0x5040ce
cmp dword [edx + 0x28], 1
jbe 0x5040db
mov eax, dword [edx + 0x38]
mov edi, dword [eax + 4]
sub edi, dword [eax]
sar edi, 3
jmp 0x5040dd
xor edi, edi
mov eax, dword [ebp + 0xc]
mov ebx, 1
add eax, 6
mov dword [esp + 0x18], edi
mov ecx, eax
mov dword [esp + 0x20], eax
mov eax, dword [edx + 0x38]
shl ebx, cl
mov ecx, dword [esp + 0x38]
mov dword [esp + 0x1c], ebx
mov ebx, dword [esi + 4]
mov edx, dword [eax]
add ebx, 8
mov dword [esp + 0x58], ebx
mov dword [esp + 0x5c], edx
test ecx, ecx
jle 0x5048b3
mov esi, dword [esp + 0x10]
mov eax, edi
shl esi, 5
shl eax, 5
mov dword [esp + 0x68], esi
mov dword [esp + 0x6c], eax
nop dword [eax + eax]
mov esi, dword [esp + 0x60]
mov eax, 4
cmp ecx, eax
mov dword [esp + 0x54], esi
mov edi, ebx
mov ebx, edx
cmovb eax, ecx
mov dword [esp + 0x14], ebx
test esi, esi
mov esi, dword [esp + 0x10]
je 0x504890
dec eax
mov dword [esp + 0x64], eax
nop dword [eax + eax]
mov ecx, dword [edi]
movzx eax, cl
or eax, 0
mov dword [esp + 0x30], ecx
je 0x50438a
mov eax, ecx
and eax, 0x5000
or eax, 0
jne 0x50438a
mov ecx, dword [ebx + 4]
mov esi, dword [ebx]
test ecx, ecx
jl 0x504191
jg 0x504198
test esi, esi
jae 0x504198
neg esi
adc ecx, 0
neg ecx
mov eax, dword [esp + 0x1c]
cdq
and eax, esi
and edx, ecx
or eax, edx
je 0x5041a9
mov bl, 1
jmp 0x5041ab
xor bl, bl
mov eax, dword [esp + 0x30]
mov esi, dword [ebp + 8]
movzx ecx, al
mov eax, dword [ebp + 0x10]
shl eax, 8
or ecx, eax
mov byte [esp + 0x3c], bl
mov eax, dword [esi + 0x10]
push dword [esp + 0x3c]
movzx ecx, byte [ecx + 0x7c07c0]
push esi
lea eax, [eax + ecx*4]
mov dword [esi + 0x14], eax
call fcn.005014e0
add esp, 8
test bl, bl
je 0x504376
mov ebx, dword [esp + 0x14]
mov edx, dword [ebx + 4]
mov eax, dword [ebx]
test edx, edx
jl 0x5041f9
jg 0x504200
test eax, eax
jae 0x504200
neg eax
adc edx, 0
neg edx
cmp dword [esp + 0x20], 6
mov ecx, dword [ebp + 0xc]
mov dword [esp + 0x74], edx
mov dword [esp + 0x70], eax
jle 0x504223
call fcn.0068e460
and eax, 0x7f
mov ecx, dword [eax*8 + 0x7bedc0]
jmp 0x504254
test ecx, ecx
js 0x50422e
call fcn.0068e460
jmp 0x50424a
movq xmm1, qword [esp + 0x70]
mov eax, ecx
neg eax
movd xmm0, eax
psllq xmm1, xmm0
movq qword [esp + 0x48], xmm1
mov eax, dword [esp + 0x48]
and eax, 0x7f
mov ecx, dword [eax*8 + 0x7be5c0]
mov eax, dword [ebp + 0x24]
add dword [eax], ecx
cmp dword [ebx + 4], 0
jg 0x50426a
jl 0x504266
cmp dword [ebx], 0
jae 0x50426a
mov bl, 1
jmp 0x50426c
xor bl, bl
mov eax, dword [esp + 0x30]
shr eax, 4
movzx edx, al
mov eax, dword [esi + 0x10]
movzx ecx, byte [edx + 0x7c05c0]
lea eax, [eax + ecx*4]
mov dword [esi + 0x14], eax
cmp byte [edx + 0x7c06c0], bl
setne al
movzx eax, al
push eax
push esi
call fcn.005014e0
mov eax, dword [esp + 0x18]
mov esi, edi
shl eax, 3
add esp, 8
sub esi, eax
cmp byte [ebp + 0x14], 0
lea edx, [eax + edi]
je 0x5042ee
mov eax, dword [edx - 4]
or dword [edx - 8], 1
or dword [edx + 8], 8
mov ecx, dword [edx + 4]
mov dword [edx - 4], eax
mov eax, dword [edx + 0xc]
mov dword [edx + 0xc], eax
mov eax, dword [edx]
mov dword [edx + 4], ecx
test bl, bl
je 0x5042e7
or eax, 0x110
mov dword [edx], eax
or dword [edi - 8], 0x220
or dword [edi + 8], 0x880
jmp 0x50435e
or eax, 0x10
mov dword [edx], eax
jmp 0x504353
mov eax, dword [esi - 4]
or dword [esi - 8], 2
or dword [esi + 8], 4
mov dword [esi - 4], eax
mov eax, dword [esi + 0xc]
mov dword [esi + 0xc], eax
mov eax, dword [edx - 4]
or dword [edx - 8], 1
or dword [edx + 8], 8
mov dword [edx - 4], eax
mov eax, dword [edx + 0xc]
mov dword [edx + 0xc], eax
mov ecx, dword [esi + 4]
mov eax, dword [esi]
mov dword [esi + 4], ecx
test bl, bl
je 0x504345
or eax, 0x440
mov dword [esi], eax
mov eax, dword [edx + 4]
or dword [edx], 0x110
mov dword [edx + 4], eax
or dword [edi - 8], 0x220
or dword [edi + 8], 0x880
jmp 0x50435e
or eax, 0x40
mov dword [esi], eax
mov eax, dword [edx + 4]
or dword [edx], 0x10
mov dword [edx + 4], eax
or dword [edi - 8], 0x20
or dword [edi + 8], 0x80
mov eax, dword [edi - 4]
mov dword [edi - 4], eax
mov eax, dword [edi + 0xc]
mov dword [edi + 0xc], eax
mov eax, dword [edi + 4]
or dword [edi], 0x1000
mov dword [edi + 4], eax
mov eax, dword [edi + 4]
or dword [edi], 0x4000
mov ebx, dword [esp + 0x14]
mov esi, dword [esp + 0x10]
mov dword [edi + 4], eax
mov edx, dword [esp + 0x64]
mov dword [esp + 0x30], edx
test edx, edx
je 0x50486f
mov eax, dword [esp + 0x18]
lea esi, [esi*8]
add esi, edi
shl eax, 3
add ebx, eax
mov ecx, dword [esi]
movzx eax, cl
or eax, 0
mov dword [esp + 0x48], ecx
je 0x5045b3
mov eax, ecx
and eax, 0x5000
or eax, 0
jne 0x5045b3
mov ecx, dword [ebx + 4]
mov eax, dword [ebx]
mov dword [esp + 0x40], eax
test ecx, ecx
jl 0x5043e1
jg 0x5043ec
test eax, eax
jae 0x5043ec
neg eax
mov dword [esp + 0x40], eax
adc ecx, 0
neg ecx
mov eax, dword [esp + 0x1c]
cdq
and eax, dword [esp + 0x40]
and edx, ecx
or eax, edx
mov byte [esp + 0x24], 1
jne 0x504405
mov byte [esp + 0x24], 0
mov eax, dword [esp + 0x48]
mov edx, dword [ebp + 8]
push dword [esp + 0x24]
movzx ecx, al
mov eax, dword [ebp + 0x10]
shl eax, 8
or ecx, eax
mov eax, dword [edx + 0x10]
push edx
movzx ecx, byte [ecx + 0x7c07c0]
lea eax, [eax + ecx*4]
mov dword [edx + 0x14], eax
call fcn.005014e0
add esp, 8
cmp byte [esp + 0x24], 0
je 0x5045a3
mov edx, dword [ebx + 4]
mov eax, dword [ebx]
test edx, edx
jl 0x50444e
jg 0x504455
test eax, eax
jae 0x504455
neg eax
adc edx, 0
neg edx
cmp dword [esp + 0x20], 6
mov ecx, dword [ebp + 0xc]
mov dword [esp + 0x7c], edx
mov dword [esp + 0x78], eax
jle 0x504478
call fcn.0068e460
and eax, 0x7f
mov ecx, dword [eax*8 + 0x7bedc0]
jmp 0x5044a9
test ecx, ecx
js 0x504483
call fcn.0068e460
jmp 0x50449f
movq xmm1, qword [esp + 0x78]
mov eax, ecx
neg eax
movd xmm0, eax
psllq xmm1, xmm0
movq qword [esp + 0x40], xmm1
mov eax, dword [esp + 0x40]
and eax, 0x7f
mov ecx, dword [eax*8 + 0x7be5c0]
mov eax, dword [ebp + 0x24]
add dword [eax], ecx
cmp dword [ebx + 4], 0
jg 0x5044c2
jl 0x5044bb
cmp dword [ebx], 0
jae 0x5044c2
mov byte [esp + 0xf], 1
jmp 0x5044c7
mov byte [esp + 0xf], 0
mov eax, dword [esp + 0x48]
shr eax, 4
movzx edx, al
mov eax, dword [ebp + 8]
movzx ecx, byte [edx + 0x7c05c0]
mov eax, dword [eax + 0x10]
lea eax, [eax + ecx*4]
mov ecx, dword [ebp + 8]
mov dword [ecx + 0x14], eax
mov al, byte [esp + 0xf]
cmp byte [edx + 0x7c06c0], al
setne al
movzx eax, al
push eax
push ecx
call fcn.005014e0
mov eax, dword [edi - 4]
add esp, 8
or dword [edi - 8], 2
or dword [edi + 8], 4
mov dword [edi - 4], eax
mov eax, dword [edi + 0xc]
mov dword [edi + 0xc], eax
mov eax, dword [esp + 0x10]
lea edx, [eax*8]
mov eax, dword [edx + esi - 4]
or dword [edx + esi - 8], 1
or dword [edx + esi + 8], 8
cmp byte [esp + 0xf], 0
mov dword [edx + esi - 4], eax
mov eax, dword [edx + esi + 0xc]
mov dword [edx + esi + 0xc], eax
mov ecx, dword [edi + 4]
mov eax, dword [edi]
mov dword [edi + 4], ecx
je 0x50456f
or eax, 0x440
mov dword [edi], eax
mov eax, dword [edx + esi + 4]
or dword [edx + esi], 0x110
mov dword [edx + esi + 4], eax
or dword [esi - 8], 0x220
or dword [esi + 8], 0x880
jmp 0x50458b
or eax, 0x40
mov dword [edi], eax
mov eax, dword [edx + esi + 4]
or dword [edx + esi], 0x10
mov dword [edx + esi + 4], eax
or dword [esi - 8], 0x20
or dword [esi + 8], 0x80
mov eax, dword [esi - 4]
mov dword [esi - 4], eax
mov eax, dword [esi + 0xc]
mov dword [esi + 0xc], eax
mov eax, dword [esi + 4]
or dword [esi], 0x1000
mov dword [esi + 4], eax
mov eax, dword [esi + 4]
or dword [esi], 0x4000
mov edx, dword [esp + 0x30]
mov dword [esi + 4], eax
sub edx, 1
mov dword [esp + 0x30], edx
je 0x50486b
mov ecx, dword [esp + 0x10]
lea eax, [ecx*8]
mov ecx, dword [esp + 0x18]
add esi, eax
lea eax, [ecx*8]
mov ecx, dword [esi]
add ebx, eax
movzx eax, cl
or eax, 0
mov dword [esp + 0x40], ecx
je 0x504715
mov eax, ecx
and eax, 0x5000
or eax, 0
jne 0x504715
mov ecx, dword [ebx + 4]
mov eax, dword [ebx]
mov dword [esp + 0x48], eax
test ecx, ecx
jl 0x50460f
jg 0x50461a
test eax, eax
jae 0x50461a
neg eax
mov dword [esp + 0x48], eax
adc ecx, 0
neg ecx
mov eax, dword [esp + 0x1c]
cdq
and eax, dword [esp + 0x48]
and edx, ecx
or eax, edx
mov byte [esp + 0x28], 1
jne 0x504633
mov byte [esp + 0x28], 0
mov eax, dword [esp + 0x40]
mov edx, dword [ebp + 8]
push dword [esp + 0x28]
movzx ecx, al
mov eax, dword [ebp + 0x10]
shl eax, 8
or ecx, eax
mov eax, dword [edx + 0x10]
push edx
movzx ecx, byte [ecx + 0x7c07c0]
lea eax, [eax + ecx*4]
mov dword [edx + 0x14], eax
call fcn.005014e0
add esp, 8
cmp byte [esp + 0x28], 0
je 0x504705
mov eax, dword [ebx + 4]
mov ecx, dword [ebx]
test eax, eax
jl 0x50467c
jg 0x504683
test ecx, ecx
jae 0x504683
neg ecx
adc eax, 0
neg eax
push dword [esp + 0x20]
push eax
push ecx
call fcn.005017e0
mov ecx, dword [ebp + 0x24]
add esp, 0xc
add dword [ecx], eax
cmp dword [ebx + 4], 0
jg 0x5046aa
jl 0x5046a3
cmp dword [ebx], 0
jae 0x5046aa
mov byte [esp + 0x2c], 1
jmp 0x5046af
mov byte [esp + 0x2c], 0
mov eax, dword [esp + 0x40]
shr eax, 4
movzx edx, al
mov eax, dword [ebp + 8]
movzx ecx, byte [edx + 0x7c05c0]
mov eax, dword [eax + 0x10]
lea eax, [eax + ecx*4]
mov ecx, dword [ebp + 8]
mov dword [ecx + 0x14], eax
mov al, byte [esp + 0x2c]
cmp byte [edx + 0x7c06c0], al
setne al
movzx eax, al
push eax
push ecx
call fcn.005014e0
push 0
push dword [esp + 0x38]
push dword [esp + 0x20]
push esi
call fcn.004ff080
mov eax, dword [esi + 4]
add esp, 0x18
or dword [esi], 0x1000
mov dword [esi + 4], eax
mov eax, dword [esi + 4]
or dword [esi], 0x4000
mov edx, dword [esp + 0x30]
mov dword [esi + 4], eax
lea eax, [edx - 1]
test eax, eax
je 0x50486b
mov ecx, dword [esp + 0x10]
lea eax, [ecx*8]
mov ecx, dword [esp + 0x18]
add esi, eax
lea eax, [ecx*8]
mov ecx, dword [esi]
add ebx, eax
movzx eax, cl
or eax, 0
mov dword [esp + 0x40], ecx
je 0x50486b
mov eax, ecx
and eax, 0x5000
or eax, 0
jne 0x50486b
mov ecx, dword [ebx + 4]
mov eax, dword [ebx]
mov dword [esp + 0x48], eax
test ecx, ecx
jl 0x50476f
jg 0x50477a
test eax, eax
jae 0x50477a
neg eax
mov dword [esp + 0x48], eax
adc ecx, 0
neg ecx
mov eax, dword [esp + 0x1c]
cdq
and eax, dword [esp + 0x48]
and edx, ecx
or eax, edx
mov byte [esp + 0x34], 1
jne 0x504793
mov byte [esp + 0x34], 0
mov eax, dword [esp + 0x40]
mov edx, dword [ebp + 8]
push dword [esp + 0x34]
movzx ecx, al
mov eax, dword [ebp + 0x10]
shl eax, 8
or ecx, eax
mov eax, dword [edx + 0x10]
push edx
movzx ecx, byte [ecx + 0x7c07c0]
lea eax, [eax + ecx*4]
mov dword [edx + 0x14], eax
call fcn.005014e0
add esp, 8
cmp byte [esp + 0x34], 0
je 0x50485f
mov eax, dword [ebx + 4]
mov ecx, dword [ebx]
test eax, eax
jl 0x5047dc
jg 0x5047e3
test ecx, ecx
jae 0x5047e3
neg ecx
adc eax, 0
neg eax
push dword [esp + 0x20]
push eax
push ecx
call fcn.005017e0
mov ecx, dword [ebp + 0x24]
add esp, 0xc
add dword [ecx], eax
cmp dword [ebx + 4], 0
jg 0x504807
jl 0x504803
cmp dword [ebx], 0
jae 0x504807
mov bl, 1
jmp 0x504809
xor bl, bl
mov eax, dword [esp + 0x40]
shr eax, 4
movzx edx, al
mov eax, dword [ebp + 8]
mov byte [esp + 0x50], bl
movzx ecx, byte [edx + 0x7c05c0]
mov eax, dword [eax + 0x10]
lea eax, [eax + ecx*4]
mov ecx, dword [ebp + 8]
mov dword [ecx + 0x14], eax
cmp byte [edx + 0x7c06c0], bl
setne al
movzx eax, al
push eax
push ecx
call fcn.005014e0
push 0
push dword [esp + 0x5c]
push dword [esp + 0x20]
push esi
call fcn.004ff080
mov eax, dword [esi + 4]
add esp, 0x18
or dword [esi], 0x1000
mov dword [esi + 4], eax
mov eax, dword [esi + 4]
or dword [esi], 0x4000
mov dword [esi + 4], eax
mov ebx, dword [esp + 0x14]
mov esi, dword [esp + 0x10]
add ebx, 8
add edi, 8
mov dword [esp + 0x14], ebx
sub dword [esp + 0x54], 1
jne 0x504160
mov ecx, dword [esp + 0x38]
mov edx, dword [esp + 0x5c]
mov ebx, dword [esp + 0x58]
sub ecx, 4
add ebx, dword [esp + 0x68]
add edx, dword [esp + 0x6c]
mov dword [esp + 0x38], ecx
mov dword [esp + 0x58], ebx
mov dword [esp + 0x5c], edx
test ecx, ecx
jg 0x504130
mov eax, dword [ebp + 0x20]
test eax, eax
je 0x5048c8
dec eax
push eax
mov eax, dword [ebp + 8]
push eax
call fcn.00501040
add esp, 8
mov eax, dword [ebp + 8]
pop edi
pop esi
pop ebx
movzx eax, byte [eax + 0x20]
neg eax
sbb eax, eax
mov esp, ebp
pop ebp
ret