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

Disassembly:
push ebp
push edi
push esi
push ebx
mov ebx, eax
sub esp, 0x8c
mov ebp, dword [eax]
xor eax, eax
mov dword [esp + 0x30], edx
mov edx, dword [esp + 0xa0]
mov dword [esp + 0x24], ecx
test edx, edx
setne al
movzx esi, byte [ecx + eax + 0x19]
mov edx, esi
mov dword [esp + 0x28], esi
mov byte [esp + 0x43], dl
cmp dl, 7
je 0x665bc320
mov edi, dword [esp + 0x24]
add eax, 4
mov dword [esp + 0x44], eax
mov esi, dword [edi + eax*4 + 0xc]
mov eax, dword [esp + 0x28]
test eax, eax
je 0x665bbd77
test esi, esi
je 0x665bbd88
add esp, 0x8c
mov eax, esi
pop ebx
pop esi
pop edi
pop ebp
ret
lea eax, [esp + 0x5c]
mov edx, dword [esp + 0x30]
mov ecx, edi
mov dword [esp + 0x58], 0
mov dword [esp + 4], eax
lea eax, [esp + 0x58]
mov dword [esp], eax
mov eax, ebx
mov dword [esp + 0x5c], 0
call fcn.665b8c40
mov dword [esp + 0x20], eax
test eax, eax
jne 0x665bc32a
mov eax, dword [edi + 0x14]
mov dword [esp + 0x34], 0
mov dword [esp + 0x3c], 0
test eax, eax
mov dword [esp + 0x2c], 0
jle 0x665bc0a6
lea esi, [esi]
nop
mov eax, dword [esp + 0x5c]
mov dword [esp + 0x60], 0x6667f486
mov dword [esp + 0x64], 3
mov dword [esp + 0x68], 0x6667f48a
mov dword [esp + 0x6c], 3
test eax, eax
je 0x665bc308
mov edi, dword [esp + 0x20]
mov esi, dword [eax + edi*4]
mov eax, dword [esp + 0x30]
mov edx, dword [eax + 4]
mov eax, dword [esp + 0x58]
test eax, eax
je 0x665bc2e0
mov eax, dword [eax + 4]
mov edi, dword [esp + 0x20]
movsx eax, word [eax + edi*2]
lea eax, [eax + eax*4]
shl eax, 2
mov eax, dword [edx + eax]
mov dword [esp + 0x78], eax
test eax, eax
je 0x665bc2fd
mov dword [esp], eax
call sub.msvcrt.dll_strlen
and eax, 0x3fffffff
mov dword [esp + 0x7c], eax
lea eax, [esi + esi*4]
lea edi, [eax*4]
mov dword [esp + 0x38], edi
mov edi, dword [esp + 0x24]
mov edx, dword [edi]
mov edx, dword [edx + 4]
mov eax, dword [edx + eax*4]
mov dword [esp + 0x70], eax
test eax, eax
je 0x665bc318
mov dword [esp], eax
call sub.msvcrt.dll_strlen
and eax, 0x3fffffff
mov dword [esp], 0
lea ecx, [esp + 0x70]
mov edx, 0x3b
mov dword [esp + 0x74], eax
mov eax, ebp
call fcn.6658c010
mov dword [esp], 0
lea ecx, [esp + 0x78]
mov edx, 0x3b
mov esi, eax
mov eax, ebp
call fcn.6658c010
mov dword [esp], 0
lea ecx, [esp + 0x60]
mov edx, 0x3b
mov edi, eax
mov eax, ebp
call fcn.6658c010
mov dword [esp], edi
mov edx, 0x8c
mov ecx, eax
mov eax, ebx
call fcn.665bb3d0
mov dword [esp], esi
mov edx, 0x35
mov ecx, eax
mov eax, ebx
call fcn.665bb3d0
mov edx, dword [esp + 0x2c]
mov ecx, eax
mov eax, ebx
call fcn.665bb800
mov dword [esp + 0x2c], eax
mov eax, dword [esp + 0xa0]
test eax, eax
je 0x665bc2c0
mov dword [esp], 0
lea ecx, [esp + 0x78]
mov edx, 0x3b
mov eax, ebp
call fcn.6658c010
mov dword [esp], 0
lea ecx, [esp + 0x68]
mov edx, 0x3b
mov esi, eax
mov eax, ebp
call fcn.6658c010
mov dword [esp], esi
mov edx, 0x8c
mov ecx, eax
mov eax, ebx
call fcn.665bb3d0
mov dword [esp], 0
lea ecx, [esp + 0x78]
mov edx, 0x3b
mov esi, eax
mov eax, ebp
call fcn.6658c010
mov dword [esp], 0
lea ecx, [esp + 0x60]
mov edx, 0x3b
mov edi, eax
mov eax, ebp
call fcn.6658c010
mov dword [esp], edi
mov edx, 0x8c
mov ecx, eax
mov eax, ebx
call fcn.665bb3d0
mov dword [esp], esi
mov edx, 0x2d
mov ecx, eax
mov eax, ebx
call fcn.665bb3d0
mov edx, dword [esp + 0x34]
mov ecx, eax
mov eax, ebx
call fcn.665bb800
cmp dword [esp + 0x28], 7
mov dword [esp + 0x34], eax
je 0x665bc090
cmp dword [esp + 0x28], 0xa
je 0x665bc350
cmp dword [esp + 0x28], 9
jne 0x665bc018
mov eax, dword [esp + 0x24]
mov esi, dword [esp + 0x38]
mov eax, dword [eax]
add esi, dword [eax + 4]
test byte [esi + 0x10], 0x60
jne 0x665bc018
mov edx, dword [esi + 4]
test edx, edx
je 0x665bc018
mov dword [esp], 0
xor ecx, ecx
mov eax, ebp
call fcn.665a7430
mov edx, eax
jmp 0x665bc060
mov edx, 0x34
xor ecx, ecx
mov eax, ebp
call fcn.6658bdd0
mov edx, eax
test eax, eax
je 0x665bc060
lea edi, [eax + 4]
mov ecx, eax
mov dword [eax], 0
and edi, 0xfffffffc
mov dword [eax + 0x30], 0
xor eax, eax
sub ecx, edi
add ecx, 0x34
shr ecx, 2
rep stosd dword es:[edi], eax
mov eax, 0xffffffff
mov byte [edx], 0x78
mov word [edx + 0x22], ax
mov dword [edx + 0x18], 1
mov ecx, edx
mov eax, dword [ebx]
mov edx, dword [esp + 0x3c]
call fcn.66599380
mov dword [esp + 0x3c], eax
mov edx, eax
test eax, eax
je 0x665bc090
mov dword [esp], 0
lea ecx, [esp + 0x70]
mov eax, ebx
call fcn.66598c00
lea esi, [esi]
mov edi, dword [esp + 0x24]
add dword [esp + 0x20], 1
mov eax, dword [esp + 0x20]
cmp dword [edi + 0x14], eax
jg 0x665bbde8
mov edx, dword [esp + 0x5c]
test edx, edx
je 0x665bc0b5
mov eax, ebp
call fcn.665926e0
mov eax, dword [esp + 0x24]
mov eax, dword [eax]
mov eax, dword [eax]
mov dword [esp + 0x38], eax
test eax, eax
je 0x665bc4e0
mov dword [esp], eax
xor edi, edi
call sub.msvcrt.dll_strlen
and eax, 0x3fffffff
mov dword [esp + 0x48], eax
add eax, 0x55
mov dword [esp + 0x4c], eax
mov esi, eax
cmp dword [esp + 0x28], 7
je 0x665bc3b0
xor edx, edx
add dword [ebp + 0x120], 1
mov ecx, edi
mov eax, ebp
mov word [ebp + 0x124], dx
mov edx, esi
call fcn.6658bdd0
mov edi, eax
test eax, eax
je 0x665bc340
mov eax, dword [esp + 0x4c]
mov dword [esp + 4], 0
mov dword [esp], edi
mov dword [esp + 8], eax
call sub.msvcrt.dll_memset
mov esi, dword [esp + 0x48]
lea eax, [edi + 0x24]
mov dword [edi + 0x1c], eax
mov dword [esp + 0x28], eax
lea eax, [edi + 0x54]
mov dword [edi + 0x30], eax
mov dword [esp + 8], esi
mov esi, dword [esp + 0x38]
mov dword [esp], eax
mov dword [esp + 4], esi
call sub.msvcrt.dll_memcpy
mov edx, dword [esp + 0x2c]
test edx, edx
je 0x665bc542
mov dword [esp], 0
mov ecx, 1
mov eax, ebp
mov esi, edi
call fcn.665a7430
mov dword [esp + 0x20], 0
mov edi, dword [esp + 0x28]
mov dword [esi + 0x38], eax
mov edx, dword [esp + 0x3c]
mov ecx, 1
mov eax, ebp
call fcn.665a7910
mov edx, dword [esp + 0x20]
mov ecx, 1
mov dword [esi + 0x3c], eax
mov eax, ebp
call fcn.665a7140
mov dword [esi + 0x2c], eax
mov eax, dword [esp + 0x34]
test eax, eax
je 0x665bc1ec
mov dword [esp], 0
mov ecx, eax
mov edx, 0x13
mov eax, ebx
call fcn.665bb3d0
mov ebx, eax
mov dword [esp + 0x34], eax
xor eax, eax
test ebx, ebx
je 0x665bc1e9
mov dword [esp], 0
mov ecx, 1
mov edx, ebx
mov eax, ebp
call fcn.665a7430
mov dword [esi + 0xc], eax
sub dword [ebp + 0x120], 1
mov edx, 0
jne 0x665bc201
movzx edx, word [ebp + 0x126]
mov eax, dword [esp + 0x2c]
mov word [ebp + 0x124], dx
test eax, eax
je 0x665bc219
mov edx, eax
mov eax, ebp
call fcn.665978b0
mov eax, dword [esp + 0x34]
test eax, eax
je 0x665bc22a
mov edx, eax
mov eax, ebp
call fcn.665978b0
mov eax, dword [esp + 0x3c]
test eax, eax
je 0x665bc23b
mov edx, eax
mov eax, ebp
call fcn.66597980
mov eax, dword [esp + 0x20]
test eax, eax
je 0x665bc251
mov edx, eax
mov ecx, 1
mov eax, ebp
call fcn.665977a0
cmp byte [ebp + 0x53], 1
je 0x665bc522
mov eax, dword [esp + 0x30]
movzx ebx, byte [esp + 0x43]
mov eax, dword [eax + 0x48]
cmp bl, 7
je 0x665bc3a0
cmp bl, 0xa
jne 0x665bc284
mov ecx, dword [esp + 0xa0]
test ecx, ecx
je 0x665bc500
mov byte [edi], pe_nt_image_headers32
mov ebx, dword [esp + 0x44]
cmp dword [esp + 0xa0], 1
mov dword [edi + 4], esi
mov dword [esi + 0x14], eax
mov dword [esi + 0x18], eax
mov eax, dword [esp + 0x24]
mov dword [eax + ebx*4 + 0xc], esi
mov eax, 0x7f
sbb al, 0xff
mov byte [esi + 8], al
add esp, 0x8c
mov eax, esi
pop ebx
pop esi
pop edi
pop ebp
ret
mov eax, dword [esp + 0x28]
cmp eax, 7
je 0x665bc090
cmp eax, 0xa
je 0x665bc090
jmp 0x665bbfdd
mov eax, dword [esp + 0x30]
movsx eax, word [eax + 0x28]
lea eax, [eax + eax*4]
shl eax, 2
mov eax, dword [edx + eax]
mov dword [esp + 0x78], eax
test eax, eax
jne 0x665bbe4e
xor eax, eax
jmp 0x665bbe5b
mov eax, dword [esp + 0x24]
mov esi, dword [eax + 0x24]
jmp 0x665bbe1b
xor eax, eax
jmp 0x665bbe92
test byte [ebp + 0x22], 8
je 0x665bbd5c
xor esi, esi
add esp, 0x8c
mov eax, esi
pop ebx
pop esi
pop edi
pop ebp
ret
mov dword [esp + 0x20], 0
xor esi, esi
jmp 0x665bc1ec
mov dword [esp], 0
lea ecx, [esp + 0x78]
mov edx, 0x3b
mov eax, ebp
call fcn.6658c010
mov dword [esp], 0
lea ecx, [esp + 0x68]
mov edx, 0x3b
mov esi, eax
mov eax, ebp
call fcn.6658c010
mov dword [esp], esi
mov edx, 0x8c
mov ecx, eax
mov eax, ebx
call fcn.665bb3d0
mov edx, eax
jmp 0x665bc060
mov byte [edi], 0x89
jmp 0x665bc287
mov eax, dword [esp + 0x38]
mov dword [esp], 0
lea ecx, [esp + 0x78]
mov edx, 0x47
mov dword [esp + 0x78], str.FOREIGN_KEY_constraint_failed
mov dword [esp + 0x70], eax
mov eax, dword [esp + 0x48]
mov dword [esp + 0x7c], 0x1d
mov dword [esp + 0x74], eax
mov eax, ebp
call fcn.6658c010
mov dword [esp + 0x28], eax
test eax, eax
je 0x665bc3f3
mov byte [eax + 1], 2
mov dword [esp], 0
lea ecx, [esp + 0x70]
xor edx, edx
mov eax, ebx
call fcn.665b8200
mov ecx, dword [esp + 0x28]
xor edx, edx
mov dword [esp + 0x20], eax
mov eax, dword [ebx]
call fcn.66599380
mov dword [esp + 0x14], 0
mov ecx, dword [esp + 0x20]
mov edx, eax
mov eax, dword [esp + 0x2c]
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], 0
mov dword [esp], eax
mov eax, ebx
mov dword [esp + 8], 0
mov dword [esp + 4], 0
call fcn.6659fac0
add dword [ebp + 0x120], 1
mov edx, esi
mov ecx, edi
mov dword [esp + 0x20], eax
xor eax, eax
mov word [ebp + 0x124], ax
mov eax, ebp
call fcn.6658bdd0
mov esi, eax
test eax, eax
je 0x665bc4c8
mov eax, dword [esp + 0x4c]
mov dword [esp + 4], 0
lea edi, [esi + 0x24]
mov dword [esp], esi
mov dword [esp + 8], eax
call sub.msvcrt.dll_memset
mov edx, dword [esp + 0x48]
lea eax, [esi + 0x54]
mov dword [esi + 0x1c], edi
mov dword [esi + 0x30], eax
mov dword [esp + 8], edx
mov edx, dword [esp + 0x38]
mov dword [esp], eax
mov dword [esp + 4], edx
call sub.msvcrt.dll_memcpy
mov dword [esp + 0x2c], 0
xor eax, eax
jmp 0x665bc182
sub dword [ebp + 0x120], 1
jne 0x665bc532
mov dword [esp + 0x2c], 0
xor edi, edi
jmp 0x665bc1fa
mov dword [esp + 0x4c], 0x55
mov esi, 0x55
xor edi, edi
mov dword [esp + 0x48], 0
jmp 0x665bc0e5
mov byte [edi], 0x7f
mov ebx, dword [esp + 0x44]
mov dword [edi + 4], esi
mov dword [esi + 0x14], eax
mov dword [esi + 0x18], eax
mov eax, dword [esp + 0x24]
mov dword [eax + ebx*4 + 0xc], esi
mov eax, 0x7f
jmp 0x665bc2ab
mov edx, esi
mov eax, ebp
xor esi, esi
call fcn.66597f30
jmp 0x665bc32c
xor eax, eax
xor edi, edi
mov word [ebp + 0x124], ax
jmp 0x665bc219
mov esi, edi
mov dword [esp + 0x20], 0
mov edi, dword [esp + 0x28]
xor eax, eax
jmp 0x665bc182