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

Disassembly:
sub esp, 0x40
push ebx
push ebp
push esi
push edi
mov edi, dword [esp + 0x60]
lea edi, [edi + edi + 0x10]
mov eax, edi
imul eax, eax, 0x1d
add eax, 8
push eax
mov dword [esp + 0x30], 0
call fcn.0069c0de
mov ebx, eax
lea esi, [ebx + edi*8 + 8]
lea ebp, [esi + edi]
mov dword [esp + 0x2c], ebp
lea ebp, [ebp + edi*4]
lea eax, [ebp + edi*2]
lea eax, [eax + edi*2]
add esp, 4
mov dword [esp + 0x18], eax
lea edx, [esp + 0x44]
lea eax, [eax + edi*2]
push edx
lea ecx, [eax + edi*8]
push 0x400
mov dword [esp + 0x3c], ecx
call sub.USP10.dll_ScriptRecordDigitSubstitution
xor eax, eax
mov dword [esp + 0x24], eax
mov word [esp + 0x10], ax
lea eax, [esp + 0x10]
push eax
lea ecx, [esp + 0x28]
push ecx
lea edx, [esp + 0x4c]
push edx
call sub.USP10.dll_ScriptApplyDigitSubstitution
lea eax, [esp + 0x14]
push eax
mov eax, dword [esp + 0x64]
push ebx
lea ecx, [esp + 0x18]
push ecx
mov ecx, dword [esp + 0x68]
lea edx, [esp + 0x30]
push edx
push edi
push eax
push ecx
mov dword [esp + 0x30], 0
call sub.USP10.dll_ScriptItemize
test eax, eax
je 0x50541d
push ebx
call fcn.0069c8fa
add esp, 4
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x40
ret 0x1c
mov edx, dword [esp + 0x14]
mov eax, dword [esp + 0x60]
mov dword [ebx + edx*8], eax
mov edx, dword [esp + 0x14]
xor eax, eax
test edx, edx
jle 0x50544b
lea ecx, [ebx + 6]
mov dl, byte [ecx]
and dl, 0x1f
mov byte [eax + esi], dl
mov edx, dword [esp + 0x14]
add eax, 1
add ecx, 8
cmp eax, edx
jl 0x505435
mov eax, dword [esp + 0x28]
push 0
push eax
push esi
push edx
call sub.USP10.dll_ScriptLayout
test eax, eax
jne 0x505408
cmp dword [esp + 0x14], eax
mov dword [esp + 0x38], eax
mov dword [esp + 0x3c], eax
mov dword [esp + 0x40], eax
mov dword [esp + 0x60], eax
mov dword [esp + 0x20], eax
jle 0x505587
mov ecx, dword [esp + 0x28]
mov edx, dword [esp + 0x20]
mov eax, dword [ecx + edx*4]
mov edx, dword [ebx + eax*8]
mov ecx, dword [ebx + eax*8 + 8]
lea esi, [ebx + eax*8 + 4]
lea eax, [esp + 0x1c]
push eax
mov eax, dword [esp + 0x1c]
push eax
lea eax, [ebp + edi*2]
push eax
push ebp
push esi
sub ecx, edx
push edi
push ecx
mov ecx, dword [esp + 0x78]
lea edx, [ecx + edx*2]
mov ecx, dword [esp + 0x70]
push edx
lea eax, [esp + 0x4c]
push eax
push ecx
call sub.USP10.dll_ScriptShape
test eax, eax
jne 0x505587
mov eax, dword [esp + 0x18]
mov ecx, dword [esp + 0x34]
lea edx, [esp + 0x38]
push edx
mov edx, dword [esp + 0x1c]
lea eax, [eax + edi*2]
push eax
mov eax, dword [esp + 0x24]
push ecx
push esi
push edx
mov edx, dword [esp + 0x68]
push eax
push ebp
lea ecx, [esp + 0x48]
push ecx
push edx
call sub.USP10.dll_ScriptPlace
test eax, eax
jne 0x505587
test word [esi], 0x8000
mov dword [esp + 0x30], 0x102
jne 0x505511
mov dword [esp + 0x30], 0x182
xor esi, esi
cmp dword [esp + 0x1c], esi
jle 0x505572
mov eax, dword [esp + 0x6c]
mov ecx, dword [esp + 0x18]
mov edx, dword [esp + 0x58]
push eax
lea eax, [ecx + edi*2]
fild dword [eax + esi*8 + 4]
mov ecx, dword [esp + 0x34]
sub esp, 8
fadd dword [esp + 0x74]
fstp dword [esp + 4]
fild dword [eax + esi*8]
mov eax, dword [esp + 0x60]
fiadd dword [esp + 0x6c]
fadd dword [esp + 0x70]
fstp dword [esp]
push edx
mov dx, word [ebp + esi*2]
push eax
call fcn.00504780
test al, al
je 0x505572
mov ecx, dword [esp + 0x34]
mov edx, dword [ecx + esi*4]
add dword [esp + 0x60], edx
add esi, 1
cmp esi, dword [esp + 0x1c]
jl 0x505519
mov eax, dword [esp + 0x20]
add eax, 1
cmp eax, dword [esp + 0x14]
mov dword [esp + 0x20], eax
jl 0x50547b
push ebx
call fcn.0069c8fa
mov eax, dword [esp + 0x64]
add esp, 4
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x40
ret 0x1c