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

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x451ed8
mov eax, dword fs:[0]
push eax
sub esp, 0x88
mov eax, dword [0x46a524]
xor eax, esp
mov dword [esp + 0x80], eax
push ebx
push esi
push edi
mov eax, dword [0x46a524]
xor eax, esp
push eax
lea eax, [esp + 0x98]
mov dword fs:[0], eax
mov edi, ecx
mov eax, dword [edi + 0x20]
mov eax, dword [eax]
xor esi, esi
cmp eax, esi
je 0x40d1e3
mov ecx, dword [edi + 0x20]
mov eax, dword [ecx]
mov edx, dword [edi + 0x30]
mov ecx, dword [edx]
add ecx, eax
cmp eax, ecx
jae 0x40d1e3
mov eax, edx
dec dword [eax]
mov edi, dword [edi + 0x20]
mov eax, dword [edi]
lea edx, [eax + 1]
mov dword [edi], edx
movzx eax, byte [eax]
jmp 0x40d452
cmp dword [edi + 0x54], esi
je 0x40d4ec
mov ecx, dword [edi + 0x10]
lea edx, [edi + 0x48]
cmp dword [ecx], edx
jne 0x40d20a
mov edx, dword [edi + 0x3c]
mov eax, dword [edi + 0x40]
mov dword [ecx], edx
mov ecx, dword [edi + 0x20]
mov dword [ecx], eax
mov edx, dword [edi + 0x30]
sub eax, eax
mov dword [edx], eax
cmp dword [edi + 0x44], esi
jne 0x40d22c
mov edi, dword [edi + 0x54]
push edi
call fcn.004258c0
add esp, 4
cmp eax, 0xffffffff
je 0x40d4ec
movzx eax, al
jmp 0x40d452
mov dword [esp + 0x70], esi
push 8
mov dword [esp + 0xa4], esi
call fcn.00420770
add esp, 4
cmp eax, esi
je 0x40d562
mov dword [esp + 0x70], eax
xor ecx, ecx
mov dword [eax], ecx
xor edx, edx
mov dword [eax + 4], edx
mov ecx, dword [esp + 0x70]
lea eax, [esp + 0x70]
mov dword [ecx], eax
mov dword [esp + 0x88], 0xf
mov dword [esp + 0x84], esi
mov byte [esp + 0x74], dl
mov dword [esp + 0xa0], 1
mov edx, dword [edi + 0x54]
push edx
call fcn.004258c0
mov ebx, eax
add esp, 4
cmp ebx, 0xffffffff
je 0x40d4d8
mov eax, dword [esp + 0x84]
or ecx, 0xffffffff
sub ecx, eax
cmp ecx, 1
jbe 0x40d4f4
lea esi, [eax + 1]
cmp esi, 0xfffffffe
ja 0x40d4f4
mov ecx, dword [esp + 0x88]
cmp ecx, esi
jae 0x40d2d1
push eax
push esi
lea ecx, [esp + 0x78]
call fcn.00401880
jmp 0x40d2ec
test esi, esi
jne 0x40d2f5
mov eax, dword [esp + 0x74]
mov dword [esp + 0x84], esi
cmp ecx, 0x10
jae 0x40d2e9
lea eax, [esp + 0x74]
mov byte [eax], 0
mov eax, dword [esp + 0x84]
test esi, esi
setne cl
test cl, cl
je 0x40d331
mov ecx, dword [esp + 0x74]
mov edx, 0x10
cmp dword [esp + 0x88], edx
jae 0x40d312
lea ecx, [esp + 0x74]
mov byte [ecx + eax], bl
mov eax, dword [esp + 0x74]
mov dword [esp + 0x84], esi
cmp dword [esp + 0x88], edx
jae 0x40d32d
lea eax, [esp + 0x74]
mov byte [eax + esi], 0
lea edx, [esp + 0x4c]
push edx
lea eax, [esp + 0x74]
push eax
call fcn.00406880
mov esi, eax
lea ecx, [esp + 0x64]
push ecx
lea edx, [esp + 0x74]
push edx
mov byte [esp + 0xa8], 2
call fcn.00406880
mov ebx, eax
mov byte [esp + 0xa0], 3
call fcn.0040f210
mov dword [esp + 0x20], eax
mov eax, dword [esp + 0x84]
mov esi, ebx
mov dword [esp + 0x18], eax
call fcn.0040f210
mov ecx, dword [edi + 0x44]
mov edx, dword [ecx]
mov edx, dword [edx + 0x10]
lea esi, [esp + 0x1c]
push esi
lea esi, [esp + 0x18]
push esi
lea esi, [esp + 0x1b]
push esi
lea esi, [esp + 0x20]
push esi
mov esi, dword [esp + 0x28]
add esi, dword [esp + 0x30]
push esi
push eax
lea eax, [edi + 0x4c]
push eax
call edx
lea ecx, [esp + 0x64]
mov esi, eax
mov byte [esp + 0xa0], 2
call fcn.004050a0
lea ecx, [esp + 0x4c]
mov byte [esp + 0xa0], 1
call fcn.004050a0
test esi, esi
js 0x40d4d8
cmp esi, 1
jle 0x40d476
cmp esi, 3
jne 0x40d4d8
cmp dword [esp + 0x84], 1
jb 0x40d4c1
lea eax, [esp + 0x40]
push eax
lea ecx, [esp + 0x74]
push ecx
call fcn.00406880
push 1
mov esi, eax
mov byte [esp + 0xa4], 6
call fcn.0040f210
push eax
lea edx, [esp + 0x1b]
push 1
push edx
call fcn.00426260
add esp, 0x10
lea ecx, [esp + 0x40]
mov byte [esp + 0xa0], 1
call fcn.004050a0
movzx esi, byte [esp + 0x13]
lea ecx, [esp + 0x70]
mov dword [esp + 0xa0], 0xffffffff
call fcn.00401210
mov eax, esi
mov ecx, dword [esp + 0x98]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x80]
xor ecx, esp
call fcn.0041fd40
mov esp, ebp
pop ebp
ret
lea eax, [esp + 0x13]
cmp dword [esp + 0x1c], eax
jne 0x40d4fe
lea ecx, [esp + 0x34]
push ecx
lea edx, [esp + 0x74]
push edx
call fcn.00406880
mov esi, eax
mov byte [esp + 0xa0], 5
call fcn.0040f210
mov ecx, dword [esp + 0x14]
sub ecx, eax
push ecx
push 0
lea ecx, [esp + 0x78]
call fcn.00401800
lea ecx, [esp + 0x34]
mov byte [esp + 0xa0], 1
call fcn.004050a0
mov edx, dword [edi + 0x54]
push edx
call fcn.004258c0
mov ebx, eax
add esp, 4
cmp ebx, 0xffffffff
jne 0x40d298
lea ecx, [esp + 0x70]
mov dword [esp + 0xa0], 0xffffffff
call fcn.00401210
or eax, 0xffffffff
jmp 0x40d452
push str.string_too_long
call fcn.0041e4c0
lea eax, [esp + 0x58]
push eax
lea ecx, [esp + 0x74]
push ecx
call fcn.00406880
mov esi, eax
mov byte [esp + 0xa0], 4
call fcn.0040f210
mov esi, dword [esp + 0x84]
sub esi, dword [esp + 0x14]
lea ecx, [esp + 0x58]
add esi, eax
mov byte [esp + 0xa0], 1
call fcn.004050a0
test esi, esi
jle 0x40d437
mov eax, dword [esp + 0x14]
mov edx, dword [edi + 0x54]
movsx ecx, byte [esi + eax - 1]
dec esi
push edx
push ecx
call fcn.00424da0
add esp, 8
test esi, esi
jg 0x40d542
jmp 0x40d437
lea edx, [esp + 0x24]
push edx
lea ecx, [esp + 0x2c]
mov dword [esp + 0x28], esi
call fcn.0041fd80
push 0x467ba8
lea eax, [esp + 0x2c]
push eax
mov dword [esp + 0x30], vtable.std::bad_alloc.0
call fcn.004287b0
int3