Function at 0x40d160
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 0x40d1d3
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 0x40d1d3
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 0x40d442
cmp dword [edi + 0x54], esi
je 0x40d4dc
mov ecx, dword [edi + 0x10]
lea edx, [edi + 0x48]
cmp dword [ecx], edx
jne 0x40d1fa
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 0x40d21c
mov edi, dword [edi + 0x54]
push edi
call fcn.004258a0
add esp, 4
cmp eax, 0xffffffff
je 0x40d4dc
movzx eax, al
jmp 0x40d442
mov dword [esp + 0x70], esi
push 8
mov dword [esp + 0xa4], esi
call fcn.00420760
add esp, 4
cmp eax, esi
je 0x40d552
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.004258a0
mov ebx, eax
add esp, 4
cmp ebx, 0xffffffff
je 0x40d4c8
mov eax, dword [esp + 0x84]
or ecx, 0xffffffff
sub ecx, eax
cmp ecx, 1
jbe 0x40d4e4
lea esi, [eax + 1]
cmp esi, 0xfffffffe
ja 0x40d4e4
mov ecx, dword [esp + 0x88]
cmp ecx, esi
jae 0x40d2c1
push eax
push esi
lea ecx, [esp + 0x78]
call fcn.00401880
jmp 0x40d2dc
test esi, esi
jne 0x40d2e5
mov eax, dword [esp + 0x74]
mov dword [esp + 0x84], esi
cmp ecx, 0x10
jae 0x40d2d9
lea eax, [esp + 0x74]
mov byte [eax], 0
mov eax, dword [esp + 0x84]
test esi, esi
setne cl
test cl, cl
je 0x40d321
mov ecx, dword [esp + 0x74]
mov edx, 0x10
cmp dword [esp + 0x88], edx
jae 0x40d302
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 0x40d31d
lea eax, [esp + 0x74]
mov byte [eax + esi], 0
lea edx, [esp + 0x4c]
push edx
lea eax, [esp + 0x74]
push eax
call fcn.00406870
mov esi, eax
lea ecx, [esp + 0x64]
push ecx
lea edx, [esp + 0x74]
push edx
mov byte [esp + 0xa8], 2
call fcn.00406870
mov ebx, eax
mov byte [esp + 0xa0], 3
call fcn.0040f200
mov dword [esp + 0x20], eax
mov eax, dword [esp + 0x84]
mov esi, ebx
mov dword [esp + 0x18], eax
call fcn.0040f200
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.00405090
lea ecx, [esp + 0x4c]
mov byte [esp + 0xa0], 1
call fcn.00405090
test esi, esi
js 0x40d4c8
cmp esi, 1
jle 0x40d466
cmp esi, 3
jne 0x40d4c8
cmp dword [esp + 0x84], 1
jb 0x40d4b1
lea eax, [esp + 0x40]
push eax
lea ecx, [esp + 0x74]
push ecx
call fcn.00406870
push 1
mov esi, eax
mov byte [esp + 0xa4], 6
call fcn.0040f200
push eax
lea edx, [esp + 0x1b]
push 1
push edx
call fcn.00426240
add esp, 0x10
lea ecx, [esp + 0x40]
mov byte [esp + 0xa0], 1
call fcn.00405090
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.0041fd30
mov esp, ebp
pop ebp
ret
lea eax, [esp + 0x13]
cmp dword [esp + 0x1c], eax
jne 0x40d4ee
lea ecx, [esp + 0x34]
push ecx
lea edx, [esp + 0x74]
push edx
call fcn.00406870
mov esi, eax
mov byte [esp + 0xa0], 5
call fcn.0040f200
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.00405090
mov edx, dword [edi + 0x54]
push edx
call fcn.004258a0
mov ebx, eax
add esp, 4
cmp ebx, 0xffffffff
jne 0x40d288
lea ecx, [esp + 0x70]
mov dword [esp + 0xa0], 0xffffffff
call fcn.00401210
or eax, 0xffffffff
jmp 0x40d442
push str.string_too_long
call fcn.0041e4b0
lea eax, [esp + 0x58]
push eax
lea ecx, [esp + 0x74]
push ecx
call fcn.00406870
mov esi, eax
mov byte [esp + 0xa0], 4
call fcn.0040f200
mov esi, dword [esp + 0x84]
sub esi, dword [esp + 0x14]
lea ecx, [esp + 0x58]
add esi, eax
mov byte [esp + 0xa0], 1
call fcn.00405090
test esi, esi
jle 0x40d427
mov eax, dword [esp + 0x14]
mov edx, dword [edi + 0x54]
movsx ecx, byte [esi + eax - 1]
dec esi
push edx
push ecx
call fcn.00424d80
add esp, 8
test esi, esi
jg 0x40d532
jmp 0x40d427
lea edx, [esp + 0x24]
push edx
lea ecx, [esp + 0x2c]
mov dword [esp + 0x28], esi
call fcn.0041fd70
push 0x467b98
lea eax, [esp + 0x2c]
push eax
mov dword [esp + 0x30], vtable.std::bad_alloc.0
call fcn.00428790
int3