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

Disassembly:
mov eax, dword fs:[0]
push 0xffffffffffffffff
push 0x542bb0
push eax
mov al, byte [0x582bec]
mov dword fs:[0], esp
sub esp, 0x48
push ebx
push ebp
push esi
xor ebx, ebx
push edi
mov edi, ecx
test al, 1
jne 0x512a58
or al, 1
mov byte [0x582bec], al
lea eax, [esp + 0x12]
mov ecx, 0x582be8
push eax
mov dword [esp + 0x64], ebx
call fcn.00504c30
push 0x5133e0
mov dword [esp + 0x64], 0xffffffff
call fcn.005265ec
add esp, 4
mov eax, dword [0x582be8]
mov esi, dword [eax]
cmp esi, eax
je 0x512a7d
mov eax, esi
mov esi, dword [esi]
push 1
push eax
mov ecx, 0x582be8
call fcn.004fdfd0
mov eax, dword [0x582be8]
cmp esi, eax
jne 0x512a63
mov dword [eax], eax
mov eax, dword [0x582be8]
mov dword [eax + 4], eax
mov eax, dword [esp + 0x6c]
cmp eax, 1
jle 0x512a95
lea ebp, [eax - 1]
jmp 0x512a97
xor ebp, ebp
mov edx, dword [esp + 0x78]
mov ecx, dword [edx + 8]
mov esi, dword [edx]
sub ecx, esi
dec ecx
cmp eax, ecx
lea ecx, [eax + 1]
jl 0x512aac
mov ecx, eax
mov dword [esp + 0x44], eax
mov eax, dword [esp + 0x70]
cmp eax, 1
mov dword [esp + 0x20], ecx
mov dword [esp + 0x40], ebp
mov dword [esp + 0x48], ecx
jle 0x512ace
lea ecx, [eax - 1]
mov dword [esp + 0x1c], ecx
jmp 0x512ad2
mov dword [esp + 0x1c], ebx
mov ecx, dword [edx + 0xc]
mov ebx, dword [edx + 4]
sub ecx, ebx
dec ecx
cmp eax, ecx
jge 0x512ae0
inc eax
mov edx, dword [esp + 0x1c]
mov ebx, dword [esp + 0x68]
mov dword [esp + 0x14], eax
mov eax, dword [esp + 0x70]
mov ecx, dword [esp + 0x14]
mov dword [esp + 0x4c], edx
mov edx, dword [ebx + 4]
mov dword [esp + 0x50], eax
mov dword [esp + 0x54], ecx
mov ecx, dword [esp + 0x6c]
mov eax, dword [edx + eax*4]
mov dl, byte [eax + ecx*2]
mov ecx, edi
push edx
call fcn.00513960
mov ecx, dword [esp + 0x14]
mov byte [esp + 0x18], al
mov eax, dword [ebx + 4]
mov edx, dword [esp + 0x18]
push edx
xor esi, esi
mov eax, dword [eax + ecx*4]
mov ecx, edi
mov al, byte [eax + ebp*2]
push eax
call fcn.00513960
push eax
mov ecx, edi
call fcn.005126d0
cmp eax, 1
jne 0x512b60
mov ecx, dword [ebx + 4]
mov edx, dword [esp + 0x14]
mov eax, dword [ecx + edx*4]
mov ecx, edi
mov al, byte [eax + ebp*2]
push eax
call fcn.00513960
mov esi, 1
mov ecx, eax
shl esi, cl
mov ecx, dword [ebx + 4]
mov edx, dword [esp + 0x70]
mov eax, dword [ecx + edx*4]
mov ecx, dword [esp + 0x18]
push ecx
mov ecx, edi
mov dl, byte [eax + ebp*2]
push edx
call fcn.00513960
push eax
mov ecx, edi
call fcn.005126d0
cmp eax, 1
jne 0x512ba7
mov eax, dword [ebx + 4]
mov ecx, dword [esp + 0x70]
mov eax, dword [eax + ecx*4]
mov ecx, edi
mov dl, byte [eax + ebp*2]
push edx
call fcn.00513960
mov edx, 1
mov ecx, eax
shl edx, cl
or esi, edx
mov eax, dword [ebx + 4]
mov ecx, dword [esp + 0x1c]
mov edx, dword [esp + 0x18]
mov eax, dword [eax + ecx*4]
push edx
mov ecx, edi
mov al, byte [eax + ebp*2]
push eax
call fcn.00513960
push eax
mov ecx, edi
call fcn.005126d0
cmp eax, 1
jne 0x512bee
mov ecx, dword [ebx + 4]
mov edx, dword [esp + 0x1c]
mov eax, dword [ecx + edx*4]
mov ecx, edi
mov al, byte [eax + ebp*2]
push eax
call fcn.00513960
mov edx, 1
mov ecx, eax
shl edx, cl
or esi, edx
mov eax, dword [ebx + 4]
mov ecx, dword [esp + 0x14]
mov ebp, dword [esp + 0x6c]
mov edx, dword [esp + 0x18]
mov eax, dword [eax + ecx*4]
push edx
mov ecx, edi
mov al, byte [eax + ebp*2]
push eax
call fcn.00513960
push eax
mov ecx, edi
call fcn.005126d0
cmp eax, 1
jne 0x512c39
mov ecx, dword [ebx + 4]
mov edx, dword [esp + 0x14]
mov eax, dword [ecx + edx*4]
mov ecx, edi
mov al, byte [eax + ebp*2]
push eax
call fcn.00513960
mov edx, 1
mov ecx, eax
shl edx, cl
or esi, edx
mov eax, dword [ebx + 4]
mov ecx, dword [esp + 0x1c]
mov edx, dword [esp + 0x18]
mov eax, dword [eax + ecx*4]
push edx
mov ecx, edi
mov al, byte [eax + ebp*2]
push eax
call fcn.00513960
push eax
mov ecx, edi
call fcn.005126d0
cmp eax, 1
jne 0x512c80
mov ecx, dword [ebx + 4]
mov edx, dword [esp + 0x1c]
mov eax, dword [ecx + edx*4]
mov ecx, edi
mov al, byte [eax + ebp*2]
push eax
call fcn.00513960
mov edx, 1
mov ecx, eax
shl edx, cl
or esi, edx
mov eax, dword [ebx + 4]
mov ecx, dword [esp + 0x14]
mov ebp, dword [esp + 0x20]
mov edx, dword [esp + 0x18]
mov eax, dword [eax + ecx*4]
push edx
mov ecx, edi
mov al, byte [eax + ebp*2]
push eax
call fcn.00513960
push eax
mov ecx, edi
call fcn.005126d0
cmp eax, 1
jne 0x512ccb
mov ecx, dword [ebx + 4]
mov edx, dword [esp + 0x14]
mov eax, dword [ecx + edx*4]
mov ecx, edi
mov al, byte [eax + ebp*2]
push eax
call fcn.00513960
mov edx, 1
mov ecx, eax
shl edx, cl
or esi, edx
mov eax, dword [ebx + 4]
mov ecx, dword [esp + 0x70]
mov edx, dword [esp + 0x18]
mov eax, dword [eax + ecx*4]
push edx
mov ecx, edi
mov al, byte [eax + ebp*2]
push eax
call fcn.00513960
push eax
mov ecx, edi
call fcn.005126d0
cmp eax, 1
jne 0x512d12
mov ecx, dword [ebx + 4]
mov edx, dword [esp + 0x70]
mov eax, dword [ecx + edx*4]
mov ecx, edi
mov al, byte [eax + ebp*2]
push eax
call fcn.00513960
mov edx, 1
mov ecx, eax
shl edx, cl
or esi, edx
mov eax, dword [ebx + 4]
mov ecx, dword [esp + 0x1c]
mov edx, dword [esp + 0x18]
mov eax, dword [eax + ecx*4]
push edx
mov ecx, edi
mov al, byte [eax + ebp*2]
push eax
call fcn.00513960
push eax
mov ecx, edi
call fcn.005126d0
cmp eax, 1
jne 0x512d59
mov ecx, dword [ebx + 4]
mov edx, dword [esp + 0x1c]
mov eax, dword [ecx + edx*4]
mov ecx, edi
mov al, byte [eax + ebp*2]
push eax
call fcn.00513960
mov edx, 1
mov ecx, eax
shl edx, cl
or esi, edx
test esi, esi
mov dword [esp + 0x1c], 0
je 0x5130ee
xor eax, eax
lea ecx, [esp + 0x3c]
mov dword [esp + 0x34], eax
mov dword [esp + 0x38], eax
push eax
lea eax, [esp + 0x17]
push eax
mov dword [esp + 0x68], 1
call fcn.005124c0
mov ecx, dword [esp + 0x3c]
mov ebp, dword [esp + 0x34]
sub ecx, ebp
mov byte [esp + 0x60], 3
sar ecx, 2
cmp ecx, 0x100
jae 0x512e10
mov ecx, dword [esp + 0x38]
mov eax, ecx
sub eax, ebp
sar eax, 2
test ebp, ebp
mov dword [esp + 0x24], eax
je 0x512de3
push ecx
push ebp
push 0x100
lea ecx, [esp + 0x40]
call fcn.00512560
mov edx, dword [esp + 0x3c]
mov ebp, eax
mov eax, dword [esp + 0x34]
lea ecx, [esp + 0x3c]
sub edx, eax
sar edx, 2
push edx
push eax
call fcn.004fdfd0
jmp 0x512df2
push 0x400
call sub.msvcrt.dll_void____cdecl_operator_new_unsigned_int_
add esp, 4
mov ebp, eax
mov ecx, dword [esp + 0x24]
lea eax, [ebp + 0x400]
push eax
lea edx, [ebp + ecx*4]
lea ecx, [esp + 0x38]
push edx
push ebp
call fcn.0043edb0
mov ebp, dword [esp + 0x34]
mov edx, dword [esp + 0x38]
xor ecx, ecx
mov eax, esi
test esi, 0xffff
jne 0x512e28
mov ecx, 0x10
shr eax, 0x10
test al, al
jne 0x512e32
add ecx, 8
shr eax, 8
test al, 0xf
jne 0x512e3c
add ecx, 4
shr eax, 4
test al, 3
jne 0x512e46
add ecx, 2
shr eax, 2
test al, 1
jne 0x512e4b
inc ecx
mov eax, dword [esp + 0x3c]
mov dword [esp + 0x20], ecx
cmp edx, eax
je 0x512e6e
test edx, edx
je 0x512e65
mov dword [edx], ecx
mov edx, dword [esp + 0x38]
mov ebp, dword [esp + 0x34]
add edx, 4
mov dword [esp + 0x38], edx
jmp 0x512e8e
push 1
lea eax, [esp + 0x16]
push 1
lea ecx, [esp + 0x28]
push eax
push ecx
push edx
lea ecx, [esp + 0x48]
call fcn.00475600
mov edx, dword [esp + 0x38]
mov ebp, dword [esp + 0x34]
mov ecx, dword [esp + 0x20]
mov eax, 1
shl eax, cl
not eax
and esi, eax
jne 0x512e14
mov esi, dword [edi]
cmp ebp, edx
mov dword [esp + 0x24], edx
mov dword [esp + 0x20], ebp
je 0x512eef
mov eax, edx
xor ecx, ecx
sub eax, ebp
sar eax, 2
cmp eax, 1
je 0x512ec7
sar eax, 1
inc ecx
cmp eax, 1
jne 0x512ebf
add ecx, ecx
push esi
push ecx
push 0
push edx
push ebp
call fcn.00514d10
mov edx, dword [esp + 0x38]
mov eax, dword [esp + 0x34]
push esi
push edx
push eax
call fcn.00514ee0
mov edx, dword [esp + 0x58]
mov ebp, dword [esp + 0x54]
add esp, 0x20
mov eax, ebp
cmp ebp, edx
mov dword [esp + 0x24], eax
je 0x5130c6
mov ecx, dword [esp + 0x78]
mov edx, dword [esp + 0x74]
mov eax, dword [eax]
push ecx
mov ecx, dword [esp + 0x70]
push edx
push eax
mov eax, dword [esp + 0x7c]
push eax
push ecx
push ebx
mov ecx, edi
call fcn.00512720
mov ecx, 0x54922c
mov byte [esp + 0x12], al
mov dword [esp + 0x18], 0
mov dword [esp + 0x14], ecx
xor esi, esi
mov edx, dword [esp + 0x18]
mov eax, dword [ecx]
mov bl, byte [esp + 0x12]
lea ebp, [edx + esi]
mov dl, byte [eax + eax*2 + 0x57edd0]
and dl, bl
mov bl, byte [eax + eax*2 + 0x57edd1]
cmp dl, bl
je 0x512f66
inc esi
add ecx, 4
cmp esi, 3
jl 0x512f33
mov ebx, dword [esp + 0x68]
jmp 0x51307e
lea eax, [esp + 0x2c]
push eax
push ecx
push esp
mov ecx, 0x582be8
call fcn.00513c50
lea ecx, [esp + 0x30]
push ecx
mov ecx, 0x582be8
call fcn.00513da0
mov eax, dword [ebp*4 + 0x54922c]
mov edx, dword [0x582be8]
mov ebx, dword [esp + 0x68]
xor ecx, ecx
mov cl, byte [eax + eax*2 + 0x57edd2]
mov esi, dword [edx + 4]
mov edx, dword [ebx + 4]
mov eax, ecx
and eax, 0xf
shr ecx, 4
mov eax, dword [esp + eax*4 + 0x4c]
mov ecx, dword [esp + ecx*4 + 0x40]
mov eax, dword [edx + eax*4]
mov al, byte [eax + ecx*2]
mov byte [esi + 0xa], al
mov eax, dword [esp + 0x6c]
cdq
idiv dword [0x549294]
mov eax, dword [esp + 0x70]
mov byte [esi + 8], dl
cdq
idiv dword [0x549298]
mov byte [esi + 9], dl
mov cl, byte [ebp*4 + 0x54922c]
mov dl, byte [esi + 0xa]
mov byte [esi + 0xb], cl
push edx
mov ecx, edi
call fcn.00513960
mov ecx, dword [edi]
lea edx, [eax + eax*4]
shl edx, 4
mov ecx, dword [ecx + 0x18]
mov eax, dword [edx + ecx + 0x1c]
mov ecx, dword [edi + 4]
mov ecx, dword [ecx]
lea edx, [eax + eax*2]
xor eax, eax
mov al, byte [esi + 0xb]
mov ecx, dword [ecx + edx*8 + 0xc]
lea edx, [eax*8]
sub edx, eax
lea ebp, [ecx + edx*4]
call dword [sym.imp.msvcrt.dll_rand]
cdq
mov ecx, 0x2710
idiv ecx
mov dword [esp + 0x20], edx
mov edx, dword [ebp + 4]
fild dword [esp + 0x20]
mov ebp, dword [ebp + 8]
mov ecx, edx
cmp ecx, ebp
fmul dword [0x546d74]
fstp dword [esp + 0x20]
je 0x51306b
fld dword [esp + 0x20]
fcomp dword [ecx + 4]
fnstsw ax
test ah, 1
jne 0x513064
fld dword [esp + 0x20]
fcomp dword [ecx + 8]
fnstsw ax
test ah, 0x41
jne 0x5130c1
add ecx, 0xc
cmp ecx, ebp
jne 0x513048
mov cx, word [edx]
mov eax, dword [esp + 0x1c]
mov byte [esi + 0xb], cl
inc eax
mov byte [esi + 0xc], 1
mov dword [esp + 0x1c], eax
mov ecx, dword [esp + 0x14]
mov edx, dword [esp + 0x18]
add ecx, 0xc
add edx, 3
cmp ecx, 0x54925c
mov dword [esp + 0x14], ecx
mov dword [esp + 0x18], edx
jl 0x512f31
mov eax, dword [esp + 0x24]
mov ecx, dword [esp + 0x38]
add eax, 4
cmp eax, ecx
mov dword [esp + 0x24], eax
jne 0x512efd
mov eax, dword [esp + 0x3c]
mov ebp, dword [esp + 0x34]
jmp 0x5130ca
mov cx, word [ecx]
jmp 0x51306e
mov eax, dword [esp + 0x3c]
test ebp, ebp
mov dword [esp + 0x60], 4
je 0x5130e6
sub eax, ebp
lea ecx, [esp + 0x3c]
sar eax, 2
push eax
push ebp
call fcn.004fdfd0
mov dword [esp + 0x60], 0xffffffff
mov eax, dword [0x582be8]
cmp dword [eax], eax
jne 0x5130fe
xor eax, eax
jmp 0x5133bc
mov edx, dword [ebx + 4]
mov ebp, dword [esp + 0x70]
mov ecx, dword [esp + 0x6c]
mov eax, dword [edx + ebp*4]
mov dl, byte [eax + ecx*2]
mov ecx, edi
push edx
call fcn.00513b30
mov ecx, dword [0x582be8]
mov byte [esp + 0x70], al
mov byte [esp + 0x68], 0
mov esi, dword [ecx]
cmp esi, ecx
je 0x51317a
mov al, byte [esp + 0x70]
test al, al
je 0x513148
mov al, byte [esi + 0xa]
mov ecx, edi
push eax
call fcn.00513b30
test al, al
mov byte [esp + 0x70], 1
jne 0x51314d
mov byte [esp + 0x70], 0
mov al, byte [esp + 0x68]
test al, al
jne 0x513169
mov cl, byte [esi + 0xa]
push ecx
mov ecx, edi
call fcn.00513b30
test al, al
mov byte [esp + 0x68], 0
je 0x51316e
mov byte [esp + 0x68], 1
mov esi, dword [esi]
mov ecx, dword [0x582be8]
cmp esi, ecx
jne 0x51312c
mov al, byte [esp + 0x70]
test al, al
je 0x513248
mov eax, dword [ecx]
mov esi, dword [esp + 0x7c]
cmp eax, ecx
je 0x5131d1
add eax, 8
push eax
push ecx
push esp
mov ecx, esi
call fcn.00513c50
lea edx, [esp + 0x78]
mov ecx, esi
push edx
call fcn.00513da0
push ecx
mov ecx, dword [0x582be8]
mov eax, esp
mov edx, dword [ecx]
mov ecx, 0x582be8
mov dword [eax], edx
lea eax, [esp + 0x6c]
push eax
call fcn.00513dd0
mov ecx, dword [0x582be8]
mov eax, dword [ecx]
cmp eax, ecx
jne 0x513190
lea ecx, [esp + 0x2c]
add esi, 0x10
push ecx
push ecx
push esp
mov ecx, esi
call fcn.00513c50
lea edx, [esp + 0x78]
mov ecx, esi
push edx
call fcn.00513da0
mov eax, dword [esi]
mov esi, dword [esp + 0x6c]
mov ecx, dword [eax + 4]
mov eax, esi
add ecx, 8
cdq
mov byte [ecx + 4], 2
idiv dword [0x549294]
mov eax, ebp
mov byte [ecx], dl
cdq
idiv dword [0x549298]
mov byte [ecx + 2], 0
mov byte [ecx + 3], 0
mov byte [ecx + 1], dl
mov ecx, dword [ebx + 4]
mov eax, dword [ecx + ebp*4]
mov ecx, edi
mov dl, byte [eax + esi*2]
push edx
call fcn.00513b30
test al, al
je 0x51323f
mov eax, dword [ebx + 4]
mov edx, esi
mov ecx, dword [eax + ebp*4]
mov byte [ecx + edx*2 + 1], 2
inc dword [esp + 0x1c]
jmp 0x5133b8
mov al, byte [esp + 0x68]
test al, al
je 0x51336a
mov eax, dword [esp + 0x7c]
mov esi, dword [eax + 8]
mov ebp, dword [eax + 4]
lea ebx, [eax + 4]
mov eax, dword [esp + 0x1c]
sub esi, ebp
sar esi, 2
cmp esi, eax
jg 0x513270
mov esi, eax
lea ecx, [esp + 0x70]
mov dword [esp + 0x60], 5
push ecx
lea ecx, [esp + 0x70]
call fcn.00504c30
mov ecx, dword [ebx + 4]
mov edx, dword [ebx]
mov eax, ecx
mov byte [esp + 0x60], 6
sub eax, edx
sar eax, 2
cmp esi, eax
jae 0x5132a9
lea edx, [edx + esi*4]
push ecx
push edx
mov ecx, ebx
call fcn.00513e00
jmp 0x5132b9
sub esi, eax
lea eax, [esp + 0x6c]
push eax
push esi
push ecx
mov ecx, ebx
call fcn.00514160
lea ecx, [esp + 0x6c]
mov byte [esp + 0x60], 5
call fcn.00474a00
mov eax, dword [0x582be8]
mov dword [esp + 0x60], 0xffffffff
mov esi, dword [eax]
cmp esi, eax
je 0x51333e
mov dword [esp + 0x70], 0
mov ebp, dword [esp + 0x70]
mov ecx, dword [ebx]
lea eax, [esi + 8]
add ebp, ecx
push eax
push ecx
push esp
mov ecx, ebp
call fcn.00513c50
lea ecx, [esp + 0x74]
push ecx
mov ecx, ebp
call fcn.00513da0
mov edx, dword [ebx]
mov eax, dword [esp + 0x70]
mov ecx, dword [eax + edx]
mov dl, byte [esi + 0xa]
push edx
mov ebp, dword [ecx + 4]
mov ecx, edi
add ebp, 8
call fcn.00513b30
neg al
mov edx, dword [esp + 0x70]
sbb al, al
add edx, 4
and al, 2
mov dword [esp + 0x70], edx
inc al
mov byte [ebp + 4], al
mov esi, dword [esi]
mov eax, dword [0x582be8]
cmp esi, eax
jne 0x5132e2
mov esi, dword [eax]
cmp esi, eax
je 0x51335e
mov ecx, esi
mov esi, dword [esi]
test ecx, ecx
je 0x51335a
push ecx
call fcn.005265a0
mov eax, dword [0x582be8]
add esp, 4
cmp esi, eax
jne 0x513344
mov dword [eax], eax
mov eax, dword [0x582be8]
mov dword [eax + 4], eax
jmp 0x5133b8
mov eax, dword [ecx]
cmp eax, ecx
je 0x5133b8
mov esi, dword [esp + 0x7c]
add eax, 8
push eax
push ecx
push esp
mov ecx, esi
call fcn.00513c50
lea eax, [esp + 0x78]
mov ecx, esi
push eax
call fcn.00513da0
push ecx
mov ecx, dword [0x582be8]
mov eax, esp
mov edx, dword [ecx]
mov ecx, 0x582be8
mov dword [eax], edx
lea eax, [esp + 0x80]
push eax
call fcn.00513dd0
mov ecx, dword [0x582be8]
mov eax, dword [ecx]
cmp eax, ecx
jne 0x513374
mov eax, dword [esp + 0x1c]
mov ecx, dword [esp + 0x58]
pop edi
pop esi
pop ebp
mov dword fs:[0], ecx
pop ebx
add esp, 0x54
ret 0x18